13#ifndef ML_SIMILAR_INTENSITIES_CLUSTER_ALGORITHM_H
14#define ML_SIMILAR_INTENSITIES_CLUSTER_ALGORITHM_H
29template <
typename DATATYPE>
42 return *
static_cast<DATATYPE*
>(position);
56 const DATATYPE intensityDifference = (currentValue>neighborValue) ? (currentValue - neighborValue) : (neighborValue - currentValue);
57 const bool isInToleranceFlag = (intensityDifference <= this->
_parameters.similarityToleranceIntensities);
58 return isInToleranceFlag;
ComputeClusterParameters _parameters
ClusterAlgorithm(const ComputeClusterParameters ¶meters, Clusters *clusters)
Structure computes and holds all cluster information. For internal use.
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 ¶meters, Clusters *clusters)
static ML_FORCE_INLINE MLdouble getVoxelAsDouble(void *)
Structure to hold parameters for cluster computation.