MeVisLab Toolbox Reference
mlSimilarIntensitiesClusterAlgorithm.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_SIMILAR_INTENSITIES_CLUSTER_ALGORITHM_H
14#define ML_SIMILAR_INTENSITIES_CLUSTER_ALGORITHM_H
15
16#include "mlClusterAlgorithm.h"
17
18
20
21
29template <typename DATATYPE>
30class SimilarIntensitiesClusterAlgorithm : public ClusterAlgorithm<DATATYPE, SimilarIntensitiesClusterAlgorithm <DATATYPE> >
31{
32public:
33
38
40 ML_FORCE_INLINE static DATATYPE getVoxel(void* position)
41 {
42 return *static_cast<DATATYPE*>(position);
43 }
44
46 {
47 return 0;
48 }
49
50 //-----------------------------------------------------------------------------------------------
52 //-----------------------------------------------------------------------------------------------
54 {
55 // intensity difference
56 const DATATYPE intensityDifference = (currentValue>neighborValue) ? (currentValue - neighborValue) : (neighborValue - currentValue);
57 const bool isInToleranceFlag = (intensityDifference <= this->_parameters.similarityToleranceIntensities);
58 return isInToleranceFlag;
59 }
60};
61
62
64
65
66#endif
Type specific implementations of the interface class for clustering algorithms.
Structure computes and holds all cluster information. For internal use.
Definition mlClusters.h:29
Implementation of a SimilarIntensities clustering algorithm.
ML_FORCE_INLINE bool isInTolerance(DATATYPE neighborValue, DATATYPE currentValue)
Tolerance calculation for scalar images.
static ML_FORCE_INLINE DATATYPE getVoxel(void *position)
Get the typed voxel value for current position.
SimilarIntensitiesClusterAlgorithm(const ComputeClusterParameters &parameters, Clusters *clusters)
static ML_FORCE_INLINE MLdouble getVoxelAsDouble(void *)
#define ML_FORCE_INLINE
Forcing the use of 'inline' for methods.
Definition mlMacros.h:54
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
double MLdouble
Definition mlTypeDefs.h:217
Structure to hold parameters for cluster computation.