MeVisLab Toolbox Reference
ml::SimilarVectorDirectionsClusterAlgorithm Class Reference

#include <mlSimilarVectorDirectionsClusterAlgorithm.h>

Inheritance diagram for ml::SimilarVectorDirectionsClusterAlgorithm:
ml::ClusterAlgorithm< const void *, SimilarVectorDirectionsClusterAlgorithm > ml::ClusterAlgorithmBase

Public Types

typedef ClusterAlgorithm< constvoid *, SimilarVectorDirectionsClusterAlgorithm >::ClusterVoxelType SimilarVectorDirectionsClusterVoxelType
 Voxel type to be used for the VectorClusterAlgorithm.
Public Types inherited from ml::ClusterAlgorithm< const void *, SimilarVectorDirectionsClusterAlgorithm >
typedef const void * ClusterVoxelType
 The used type of the voxels, needed by derived classes.

Public Member Functions

 SimilarVectorDirectionsClusterAlgorithm (const ComputeClusterParameters &parameters, Clusters *clusters)
 Constructor.
MLErrorCode runClustering ()
ML_FORCE_INLINE double calcDotProduct (SimilarVectorDirectionsClusterVoxelType vec1Ptr, SimilarVectorDirectionsClusterVoxelType vec2Ptr)
 Calculates the dot product of two n-dimensional vectors.
ML_FORCE_INLINE bool isInTolerance (SimilarVectorDirectionsClusterVoxelType neighborValue, SimilarVectorDirectionsClusterVoxelType currentValue)
Public Member Functions inherited from ml::ClusterAlgorithm< const void *, SimilarVectorDirectionsClusterAlgorithm >
 ClusterAlgorithm (const ComputeClusterParameters &parameters, Clusters *clusters)
 Constructor to be used.
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.
virtual ~ClusterAlgorithmBase ()
 Default virtual destructor.
bool hasResults () const

Static Public Member Functions

static ML_FORCE_INLINE SimilarVectorDirectionsClusterVoxelType getVoxel (void *position)
 Get the typed voxel value for current position.
static ML_FORCE_INLINE MLdouble getVoxelAsDouble (void *)
static ML_FORCE_INLINE const void * convertBackgroundValue (MLdouble)

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 Member Functions inherited from ml::ClusterAlgorithm< const void *, SimilarVectorDirectionsClusterAlgorithm >
MLuint updateClusterRefForNeighbor (void *neighborVoxelPtr, MLint x, MLint y, MLint z, const void *currentValue, MLuint currentClusterRef)
MLErrorCode calcClustersForSlices ()
Protected Member Functions inherited from ml::ClusterAlgorithmBase
void setInSliceVoxelType (MLDataType dt)
 Sets voxel type of input slices.
void freeInSliceData ()
 Releases memory of input image slices.
void storeNextSlice (SubImage &slice)
 Sets next image data, expects the data to be managed by memory manager.
MLErrorCode loadNextSlice (MLint sliceNr, const ImageVector &inImgExt)
 Gets next image data.
MLErrorCode loadMaskSlice (TSubImage< MLint8 > &slice, MLint sliceNr, const ImageVector &inImgExt) const
 Gets current slice of the mask image.
MLuint mergeClusterReference (MLint x, MLint y, MLint z, MLuint currClusterRef)
 Merges a cluster reference currClusterRef for position (x,y,z).
void setResultFlag (bool result)
 Sets internal result flag to result.
Static Protected Member Functions inherited from ml::ClusterAlgorithm< const void *, SimilarVectorDirectionsClusterAlgorithm >
static const void * convertBackgroundValue (MLdouble backgroundValue)
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.
Clusters_clusters
 Result clusters.
SubImage _currentSlices [_NR_OF_SUBIMAGES]
 do not load the whole image into memory, only keep two slices at once
ComputeClusterParameters _parameters

Detailed Description

Implementation of a clustering algorithm for vector data types. It uses internally two data structures. One (class ClusterRefVolume) holds references for every image voxel to a field of cluster informations (here ClusterRefCollection). For every image voxel will be checked whether the difference between the directions of neighboring vectors is within a similarity tolerance. Merging adjacent cluster is done within ClusterRefCollection.

Definition at line 30 of file mlSimilarVectorDirectionsClusterAlgorithm.h.

Member Typedef Documentation

◆ SimilarVectorDirectionsClusterVoxelType

Constructor & Destructor Documentation

◆ SimilarVectorDirectionsClusterAlgorithm()

ml::SimilarVectorDirectionsClusterAlgorithm::SimilarVectorDirectionsClusterAlgorithm ( const ComputeClusterParameters & parameters,
Clusters * clusters )
inline

Member Function Documentation

◆ calcDotProduct()

ML_FORCE_INLINE double ml::SimilarVectorDirectionsClusterAlgorithm::calcDotProduct ( SimilarVectorDirectionsClusterVoxelType vec1Ptr,
SimilarVectorDirectionsClusterVoxelType vec2Ptr )
inline

Calculates the dot product of two n-dimensional vectors.

Definition at line 74 of file mlSimilarVectorDirectionsClusterAlgorithm.h.

References ML_FORCE_INLINE.

Referenced by isInTolerance().

◆ convertBackgroundValue()

ML_FORCE_INLINE const void * ml::SimilarVectorDirectionsClusterAlgorithm::convertBackgroundValue ( MLdouble )
inlinestatic

Definition at line 109 of file mlSimilarVectorDirectionsClusterAlgorithm.h.

References ML_FORCE_INLINE.

◆ getVoxel()

ML_FORCE_INLINE SimilarVectorDirectionsClusterVoxelType ml::SimilarVectorDirectionsClusterAlgorithm::getVoxel ( void * position)
inlinestatic

Get the typed voxel value for current position.

Definition at line 63 of file mlSimilarVectorDirectionsClusterAlgorithm.h.

References ML_FORCE_INLINE.

◆ getVoxelAsDouble()

ML_FORCE_INLINE MLdouble ml::SimilarVectorDirectionsClusterAlgorithm::getVoxelAsDouble ( void * )
inlinestatic

Definition at line 68 of file mlSimilarVectorDirectionsClusterAlgorithm.h.

References ML_FORCE_INLINE.

◆ isInTolerance()

ML_FORCE_INLINE bool ml::SimilarVectorDirectionsClusterAlgorithm::isInTolerance ( SimilarVectorDirectionsClusterVoxelType neighborValue,
SimilarVectorDirectionsClusterVoxelType currentValue )
inline

Tolerance calculation for vector images. Needed by template function updateClusterRefForNeighbor in base class.

Definition at line 102 of file mlSimilarVectorDirectionsClusterAlgorithm.h.

References ml::ClusterAlgorithmBase::_parameters, calcDotProduct(), and ML_FORCE_INLINE.

◆ runClustering()


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