MeVisLab Toolbox Reference
ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm > Class Template Reference

Type specific implementations of the interface class for clustering algorithms. More...

#include <mlClusterAlgorithm.h>

Inheritance diagram for ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm >:
ml::ClusterAlgorithmBase

Public Types

typedef CLUSTERVOXELTYPE ClusterVoxelType
 The used type of the voxels, needed by derived classes. More...
 

Public Member Functions

 ClusterAlgorithm (const ComputeClusterParameters &parameters, Clusters *clusters)
 Constructor to be used. More...
 
MLErrorCode runClustering ()
 
MLErrorCode processSlice (MLint zi, const ImageVector &inputImageExtent, TSubImage< MLint8 > &inMaskSlice)
 
- Public Member Functions inherited from ml::ClusterAlgorithmBase
 ClusterAlgorithmBase (const ComputeClusterParameters &parameters, Clusters *clusters)
 Constructor to be used. More...
 
virtual ~ClusterAlgorithmBase ()
 Default virtual destructor. More...
 
bool hasResults () const
 Returns whether getCluster() and getClusterOfVoxel() contains cluster data. More...
 

Protected Member Functions

MLuint updateClusterRefForNeighbor (void *neighborVoxelPtr, MLint x, MLint y, MLint z, CLUSTERVOXELTYPE currentValue, MLuint currentClusterRef)
 Checks if neighbor at position x,y,z belongs to the same cluster given by currentClusterRef. More...
 
MLErrorCode calcClustersForSlices ()
 Template applying cluster calculations for one slice. More...
 
- Protected Member Functions inherited from ml::ClusterAlgorithmBase
void setInSliceVoxelType (MLDataType dt)
 Sets voxel type of input slices. More...
 
void freeInSliceData ()
 Releases memory of input image slices. More...
 
void storeNextSlice (SubImage &slice)
 Sets next image data, expects the data to be managed by memory manager. More...
 
MLErrorCode loadNextSlice (MLint sliceNr, const ImageVector &inImgExt)
 Gets next image data. More...
 
MLErrorCode loadMaskSlice (TSubImage< MLint8 > &slice, MLint sliceNr, const ImageVector &inImgExt) const
 Gets current slice of the mask image. More...
 
MLuint mergeClusterReference (MLint x, MLint y, MLint z, MLuint currClusterRef)
 Merges a cluster reference currClusterRef for position (x,y,z). More...
 
void setResultFlag (bool result)
 Sets internal result flag to result. More...
 

Static Protected Member Functions

static CLUSTERVOXELTYPE convertBackgroundValue (MLdouble backgroundValue)
 

Additional Inherited Members

- Protected Types inherited from ml::ClusterAlgorithmBase
enum  { _NR_OF_SUBIMAGES = 2 }
 We do not load the whole image into memory, only keep two slices at once. More...
 
- Protected Attributes inherited from ml::ClusterAlgorithmBase
enum ml::ClusterAlgorithmBase:: { ... }  NumInImagesEnum
 We do not load the whole image into memory, only keep two slices at once. More...
 
Clusters_clusters
 Result clusters. More...
 
SubImage _currentSlices [_NR_OF_SUBIMAGES]
 do not load the whole image into memory, only keep two slices at once More...
 
ComputeClusterParameters _parameters
 

Detailed Description

template<typename CLUSTERVOXELTYPE, typename DerivedAlgorithm>
class ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm >

Type specific implementations of the interface class for clustering algorithms.

Derived classes should derive from this class.

The derived class needs to pass its class name as second template argument to ClusterAlgorithm, this allows static dispatch to overloaded members (Curiously recurring template pattern).

The derived class needs to implement getVoxel() and isInTolerance(), see IdenticalIntensitiesClusterAlgorithm for an example.

Definition at line 221 of file mlClusterAlgorithm.h.

Member Typedef Documentation

◆ ClusterVoxelType

template<typename CLUSTERVOXELTYPE , typename DerivedAlgorithm >
typedef CLUSTERVOXELTYPE ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm >::ClusterVoxelType

The used type of the voxels, needed by derived classes.

Definition at line 226 of file mlClusterAlgorithm.h.

Constructor & Destructor Documentation

◆ ClusterAlgorithm()

template<typename CLUSTERVOXELTYPE , typename DerivedAlgorithm >
ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm >::ClusterAlgorithm ( const ComputeClusterParameters parameters,
Clusters clusters 
)
inline

Constructor to be used.

Definition at line 229 of file mlClusterAlgorithm.h.

Member Function Documentation

◆ calcClustersForSlices()

template<typename CLUSTERVOXELTYPE , typename DerivedAlgorithm >
MLErrorCode ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm >::calcClustersForSlices ( )
inlineprotected

◆ convertBackgroundValue()

template<typename CLUSTERVOXELTYPE , typename DerivedAlgorithm >
static CLUSTERVOXELTYPE ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm >::convertBackgroundValue ( MLdouble  backgroundValue)
inlinestaticprotected

Definition at line 262 of file mlClusterAlgorithm.h.

◆ processSlice()

template<typename CLUSTERVOXELTYPE , typename DerivedAlgorithm >
MLErrorCode ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm >::processSlice ( MLint  zi,
const ImageVector inputImageExtent,
TSubImage< MLint8 > &  inMaskSlice 
)
inline

◆ runClustering()

template<typename CLUSTERVOXELTYPE , typename DerivedAlgorithm >
MLErrorCode ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm >::runClustering ( )
inline

Definition at line 233 of file mlClusterAlgorithm.h.

Referenced by ml::TypedComputeClusters::process().

◆ updateClusterRefForNeighbor()

template<typename CLUSTERVOXELTYPE , typename DerivedAlgorithm >
MLuint ml::ClusterAlgorithm< CLUSTERVOXELTYPE, DerivedAlgorithm >::updateClusterRefForNeighbor ( void *  neighborVoxelPtr,
MLint  x,
MLint  y,
MLint  z,
CLUSTERVOXELTYPE  currentValue,
MLuint  currentClusterRef 
)
inlineprotected

Checks if neighbor at position x,y,z belongs to the same cluster given by currentClusterRef.

Parameters
neighborVoxelPtrPointer to the neighbor voxel
x,y,zPosition of neighbor in image coordinates.
currentValueCurrently examined voxel.
currentClusterRefCluster reference of currently examined voxel.
Returns
The cluster reference after checking the neighbor. Can differ from currentClusterRef due to cluster merging.

Definition at line 248 of file mlClusterAlgorithm.h.


The documentation for this class was generated from the following file: