MeVisLab Toolbox Reference
mlClusters.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2014, 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_CLUSTERS_H
14#define ML_CLUSTERS_H
15
17#include "mlModuleIncludes.h"
18
19#include "mlClusterRefVolume.h"
21
22
23#include <boost/shared_ptr.hpp>
24
26
29{
30public:
31
34
37
38
44
48
49
51
53 std::vector<ClusterInfo> getClusterInfoList() const;
54
59 const ClusterInfo& getClusterAt(MLuint rank) const;
66 void setUserDataAtRank(MLuint rank, MLdouble userData);
67
73
75 void setImageParameters(const PagedImage* inImage);
76
84 ImageVector getImageExtent() const { return _imageProperties.getImageExtent(); }
86 const ImageVector& getPageExtent() const { return _pageExtent; }
88 const Matrix4& getVoxelToWorldMatrix() const { return _imageProperties.getVoxelToWorldMatrix(); }
90 const Matrix4& getWorldToVoxeldMatrix() const { return _imageProperties.getWorldToVoxelMatrix(); }
92 MLdouble getVoxelVolumeInMilliliters() const { return _imageProperties.getVoxelVolumeInMilliliters(); }
94 MedicalImageProperties getImageProperties() const { return _imageProperties; }
98 void setUse2DNeighborhood() { _using2DNeighborhood = true; }
100 bool isUsing2DNeighborhood() const { return _using2DNeighborhood; }
101
102
103private:
104
105 void computeBoundingBoxes();
106
107 void setCTUTo1(ImageVector& v);
108
109 ClusterRefVolume* _clusterRefVolume;
110 ClusterRefCollection* _clusterRefCollection;
111
112 MedicalImageProperties _imageProperties;
113 ImageVector _pageExtent;
114
115 bool _using2DNeighborhood;
116};
117
118
120
121
122#endif // __mlClusters_H
#define MLCLUSTERALGORITHM_EXPORT
Holds basic information about a cluster.
Class for handling cluster references.
A stack of slices where each entry encodes an id of a ClusterRef.
Structure computes and holds all cluster information. For internal use.
Definition mlClusters.h:29
const Matrix4 & getWorldToVoxeldMatrix() const
Returns the world-to-voxel matrix of the input image.
Definition mlClusters.h:90
MLuint merge(MLuint currentClusterRef, MLuint neighborClusterRef)
Merges the clusters with the given references and returns the reference id of the merged result which...
MedicalImageProperties getImageProperties() const
Returns the whole image properties of the input image (with c,t,u set to 1, because only the first vo...
Definition mlClusters.h:94
std::vector< ClusterInfo > getClusterInfoList() const
Returns the current cluster infos.
MLuint getClusterRef(MLint x, MLint y, MLint z) const
Returns the reference id for the cluster at the given voxel position in the image.
const ImageVector & getPageExtent() const
Returns the page extent of the input image.
Definition mlClusters.h:86
MLdouble getVoxelVolumeInMilliliters() const
Returns the milliliter factor of one voxel.
Definition mlClusters.h:92
bool isUsing2DNeighborhood() const
Returns whether this clusters were computed using a 2D neighborhood.
Definition mlClusters.h:100
void calcClusterSizes(const ClusterUserDataParameters &userDataParameters)
Calculates all cluster sizes and initializes the selection states of all clusters.
void setImageParameters(const PagedImage *inImage)
Sets image parameters.
void setUserDataAtRank(MLuint rank, MLdouble userData)
Sets the user data value to the cluster with the given rank.
MLuint getRankOfSizeAt(MLint x, MLint y, MLint z) const
Returns the rank at the given position, 0 for background.
MLuint getNewReference(MLdouble imageValue)
Returns a new reference id and eventually resizes (enlarges) the internal reference array.
MLErrorCode init(MLint extentX, MLint extentY, MLint extentZ)
Initializes this clusters object and returns an error code.
const ClusterInfo & getBackgroundCluster() const
Returns the background cluster.
MLuint getMaxClusterSize() const
Returns the size in voxel of the largest cluster.
const ClusterInfo & getClusterAt(MLuint rank) const
Returns a cluster info for a given rank.
const Matrix4 & getVoxelToWorldMatrix() const
Returns the voxel-to-world matrix of the input image.
Definition mlClusters.h:88
void setUse2DNeighborhood()
Sets that this clusters were computed using a 2D neighborhood.
Definition mlClusters.h:98
void setClusterRef(MLint xi, MLint yi, MLint zi, MLuint currentClusterRef)
Sets a cluster reference id at a given voxel position.
const ClusterInfo & getClusterOfVoxel(MLint x, MLint y, MLint z) const
Returns a cluster info of that voxel to get infos.
ImageVector getImageExtent() const
Returns the image extent of the input image.
Definition mlClusters.h:84
MLuint getMaxRank() const
Returns the maximum rank.
MLuint getNumClusters() const
Returns the number of clusters.
void incrementClusterSize(MLuint currentClusterRef)
Increments the cluster size of the given cluster reference.
This class encapsulates basic medical image properties:
Class which represents an image, which manages properties of an image and image data which is located...
MLint32 MLErrorCode
Type of an ML Error code.
Definition mlTypeDefs.h:716
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLuint64 MLuint
An unsigned ML integer type with at least 64 bits used for index calculations on very large images ev...
Definition mlTypeDefs.h:506
double MLdouble
Definition mlTypeDefs.h:217
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:490
Cluster user data parameters.