MeVisLab Toolbox Reference
mlIdenticalIntensitiesClusterAlgorithm.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_IDENTICAL_INTENSITIES_CLUSTER_ALGORITHM_H
14 #define ML_IDENTICAL_INTENSITIES_CLUSTER_ALGORITHM_H
15 
16 #include "mlClusterAlgorithm.h"
17 
18 ML_START_NAMESPACE
19 
20 
29 template <typename DATATYPE>
30 class IdenticalIntensitiesClusterAlgorithm : public ClusterAlgorithm<DATATYPE, IdenticalIntensitiesClusterAlgorithm<DATATYPE> >
31 {
32 public:
34  ClusterAlgorithm<DATATYPE, IdenticalIntensitiesClusterAlgorithm <DATATYPE> >(parameters, clusters)
35  {}
36 
38  ML_FORCE_INLINE static DATATYPE getVoxel(void* position)
39  {
40  return *static_cast<DATATYPE*>(position);
41  }
42 
43  ML_FORCE_INLINE static MLdouble getVoxelAsDouble(void* position)
44  {
45  return static_cast<MLdouble>(getVoxel(position));
46  }
47 
50  ML_FORCE_INLINE bool isInTolerance(DATATYPE neighborValue, DATATYPE currentValue)
51  {
52  return (currentValue == neighborValue);
53  }
54 };
55 
56 
57 ML_END_NAMESPACE
58 
59 
60 #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 clustering algorithm checking for identical image intensity values.
static ML_FORCE_INLINE DATATYPE getVoxel(void *position)
Get the typed voxel value for current position.
ML_FORCE_INLINE bool isInTolerance(DATATYPE neighborValue, DATATYPE currentValue)
Tolerance calculation for scalar images.
IdenticalIntensitiesClusterAlgorithm(const ComputeClusterParameters &parameters, Clusters *clusters)
static ML_FORCE_INLINE MLdouble getVoxelAsDouble(void *position)
#define ML_FORCE_INLINE
Forcing the use of 'inline' for methods.
Definition: mlMacros.h:87
double MLdouble
Definition: mlTypeDefs.h:223
Structure to hold parameters for cluster computation.