MeVisLab Toolbox Reference
ml::Clusters Class Reference

Structure computes and holds all cluster information. For internal use. More...

#include <mlClusters.h>

Public Member Functions

 Clusters ()
 
 ~Clusters ()
 
MLErrorCode init (MLint extentX, MLint extentY, MLint extentZ)
 Initializes this clusters object and returns an error code.
 
void calcClusterSizes (const ClusterUserDataParameters &userDataParameters)
 Calculates all cluster sizes and initializes the selection states of all clusters.
 
void incrementClusterSize (MLuint currentClusterRef)
 Increments the cluster size of the given cluster reference.
 
MLuint merge (MLuint currentClusterRef, MLuint neighborClusterRef)
 Merges the clusters with the given references and returns the reference id of the merged result which is the smaller reference id.
 
std::vector< ClusterInfogetClusterInfoList () const
 Returns the current cluster infos.
 
const ClusterInfogetClusterOfVoxel (MLint x, MLint y, MLint z) const
 Returns a cluster info of that voxel to get infos.
 
const ClusterInfogetClusterAt (MLuint rank) const
 Returns a cluster info for a given rank.
 
const ClusterInfogetBackgroundCluster () const
 Returns the background cluster.
 
MLuint getClusterRef (MLint x, MLint y, MLint z) const
 Returns the reference id for the cluster at the given voxel position in the image.
 
void setUserDataAtRank (MLuint rank, MLdouble userData)
 Sets the user data value to the cluster with the given rank.
 
MLuint getNewReference (MLdouble imageValue)
 Returns a new reference id and eventually resizes (enlarges) the internal reference array.
 
void setClusterRef (MLint xi, MLint yi, MLint zi, MLuint currentClusterRef)
 Sets a cluster reference id at a given voxel position.
 
void setImageParameters (const PagedImage *inImage)
 Sets image parameters.
 
MLuint getNumClusters () const
 Returns the number of clusters.
 
MLuint getMaxRank () const
 Returns the maximum rank.
 
MLuint getMaxClusterSize () const
 Returns the size in voxel of the largest cluster.
 
ImageVector getImageExtent () const
 Returns the image extent of the input image.
 
const ImageVectorgetPageExtent () const
 Returns the page extent of the input image.
 
const Matrix4getVoxelToWorldMatrix () const
 Returns the voxel-to-world matrix of the input image.
 
const Matrix4getWorldToVoxeldMatrix () const
 Returns the world-to-voxel matrix of the input image.
 
MLdouble getVoxelVolumeInMilliliters () const
 Returns the milliliter factor of one voxel.
 
MedicalImageProperties getImageProperties () const
 Returns the whole image properties of the input image (with c,t,u set to 1, because only the first volume is handled).
 
MLuint getRankOfSizeAt (MLint x, MLint y, MLint z) const
 Returns the rank at the given position, 0 for background.
 
void setUse2DNeighborhood ()
 Sets that this clusters were computed using a 2D neighborhood.
 
bool isUsing2DNeighborhood () const
 Returns whether this clusters were computed using a 2D neighborhood.
 

Detailed Description

Structure computes and holds all cluster information. For internal use.

Definition at line 28 of file mlClusters.h.

Constructor & Destructor Documentation

◆ Clusters()

ml::Clusters::Clusters ( )

◆ ~Clusters()

ml::Clusters::~Clusters ( )

Member Function Documentation

◆ calcClusterSizes()

void ml::Clusters::calcClusterSizes ( const ClusterUserDataParameters & userDataParameters)

Calculates all cluster sizes and initializes the selection states of all clusters.

◆ getBackgroundCluster()

const ClusterInfo & ml::Clusters::getBackgroundCluster ( ) const

Returns the background cluster.

◆ getClusterAt()

const ClusterInfo & ml::Clusters::getClusterAt ( MLuint rank) const

Returns a cluster info for a given rank.

◆ getClusterInfoList()

std::vector< ClusterInfo > ml::Clusters::getClusterInfoList ( ) const

Returns the current cluster infos.

The cluster infos are be arranged by size in descending order. The vector size is the number of clusters found.

◆ getClusterOfVoxel()

const ClusterInfo & ml::Clusters::getClusterOfVoxel ( MLint x,
MLint y,
MLint z ) const

Returns a cluster info of that voxel to get infos.

Returns the background cluster if the position is not within the image.

◆ getClusterRef()

MLuint ml::Clusters::getClusterRef ( MLint x,
MLint y,
MLint z ) const

Returns the reference id for the cluster at the given voxel position in the image.

◆ getImageExtent()

ImageVector ml::Clusters::getImageExtent ( ) const
inline

Returns the image extent of the input image.

Definition at line 84 of file mlClusters.h.

◆ getImageProperties()

MedicalImageProperties ml::Clusters::getImageProperties ( ) const
inline

Returns the whole image properties of the input image (with c,t,u set to 1, because only the first volume is handled).

Definition at line 94 of file mlClusters.h.

◆ getMaxClusterSize()

MLuint ml::Clusters::getMaxClusterSize ( ) const

Returns the size in voxel of the largest cluster.

◆ getMaxRank()

MLuint ml::Clusters::getMaxRank ( ) const

Returns the maximum rank.

◆ getNewReference()

MLuint ml::Clusters::getNewReference ( MLdouble imageValue)

Returns a new reference id and eventually resizes (enlarges) the internal reference array.

Sets up the new cluster's bounding box.

◆ getNumClusters()

MLuint ml::Clusters::getNumClusters ( ) const

Returns the number of clusters.

◆ getPageExtent()

const ImageVector & ml::Clusters::getPageExtent ( ) const
inline

Returns the page extent of the input image.

Definition at line 86 of file mlClusters.h.

◆ getRankOfSizeAt()

MLuint ml::Clusters::getRankOfSizeAt ( MLint x,
MLint y,
MLint z ) const

Returns the rank at the given position, 0 for background.

◆ getVoxelToWorldMatrix()

const Matrix4 & ml::Clusters::getVoxelToWorldMatrix ( ) const
inline

Returns the voxel-to-world matrix of the input image.

Definition at line 88 of file mlClusters.h.

◆ getVoxelVolumeInMilliliters()

MLdouble ml::Clusters::getVoxelVolumeInMilliliters ( ) const
inline

Returns the milliliter factor of one voxel.

Definition at line 92 of file mlClusters.h.

◆ getWorldToVoxeldMatrix()

const Matrix4 & ml::Clusters::getWorldToVoxeldMatrix ( ) const
inline

Returns the world-to-voxel matrix of the input image.

Definition at line 90 of file mlClusters.h.

◆ incrementClusterSize()

void ml::Clusters::incrementClusterSize ( MLuint currentClusterRef)

Increments the cluster size of the given cluster reference.

◆ init()

MLErrorCode ml::Clusters::init ( MLint extentX,
MLint extentY,
MLint extentZ )

Initializes this clusters object and returns an error code.

◆ isUsing2DNeighborhood()

bool ml::Clusters::isUsing2DNeighborhood ( ) const
inline

Returns whether this clusters were computed using a 2D neighborhood.

Definition at line 100 of file mlClusters.h.

◆ merge()

MLuint ml::Clusters::merge ( MLuint currentClusterRef,
MLuint neighborClusterRef )

Merges the clusters with the given references and returns the reference id of the merged result which is the smaller reference id.

◆ setClusterRef()

void ml::Clusters::setClusterRef ( MLint xi,
MLint yi,
MLint zi,
MLuint currentClusterRef )

Sets a cluster reference id at a given voxel position.

◆ setImageParameters()

void ml::Clusters::setImageParameters ( const PagedImage * inImage)

Sets image parameters.

◆ setUse2DNeighborhood()

void ml::Clusters::setUse2DNeighborhood ( )
inline

Sets that this clusters were computed using a 2D neighborhood.

Definition at line 98 of file mlClusters.h.

◆ setUserDataAtRank()

void ml::Clusters::setUserDataAtRank ( MLuint rank,
MLdouble userData )

Sets the user data value to the cluster with the given rank.


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