MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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> class SimilarIntensitiesClusterAlgorithm
30 : public ClusterAlgorithm<DATATYPE, SimilarIntensitiesClusterAlgorithm<DATATYPE>>
31{
32public:
36
38 ML_FORCE_INLINE static DATATYPE getVoxel(void* position)
39 {
40 return *static_cast<DATATYPE*>(position);
41 }
42
44 {
45 return 0;
46 }
47
48 //-----------------------------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------------------------
52 {
53 // intensity difference
55 (currentValue > neighborValue) ? (currentValue - neighborValue) : (neighborValue - currentValue);
56 const bool isInToleranceFlag = (intensityDifference <= this->_parameters.similarityToleranceIntensities);
57 return isInToleranceFlag;
58 }
59};
60
61
63
64
65#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:51
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
double MLdouble
Definition mlTypeDefs.h:217
Structure to hold parameters for cluster computation.