MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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:
33
36
37
43
47
48
50
52 std::vector<ClusterInfo> getClusterInfoList() const;
53
58 const ClusterInfo& getClusterAt(MLuint rank) const;
65 void setUserDataAtRank(MLuint rank, MLdouble userData);
66
72
74 void setImageParameters(const PagedImage* inImage);
75
84 {
85 return _imageProperties.getImageExtent();
86 }
89 {
90 return _pageExtent;
91 }
94 {
95 return _imageProperties.getVoxelToWorldMatrix();
96 }
99 {
100 return _imageProperties.getWorldToVoxelMatrix();
101 }
104 {
105 return _imageProperties.getVoxelVolumeInMilliliters();
106 }
110 {
111 return _imageProperties;
112 }
117 {
118 _using2DNeighborhood = true;
119 }
122 {
123 return _using2DNeighborhood;
124 }
125
126
127private:
128 void computeBoundingBoxes();
129
130 void setCTUTo1(ImageVector& v);
131
132 ClusterRefVolume* _clusterRefVolume;
133 ClusterRefCollection* _clusterRefCollection;
134
135 MedicalImageProperties _imageProperties;
136 ImageVector _pageExtent;
137
138 bool _using2DNeighborhood;
139};
140
141
143
144
145#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:98
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:109
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:88
MLdouble getVoxelVolumeInMilliliters() const
Returns the milliliter factor of one voxel.
Definition mlClusters.h:103
bool isUsing2DNeighborhood() const
Returns whether this clusters were computed using a 2D neighborhood.
Definition mlClusters.h:121
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:93
void setUse2DNeighborhood()
Sets that this clusters were computed using a 2D neighborhood.
Definition mlClusters.h:116
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:83
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:
The class PagedImage, representing a fragmented image that manages properties and data of an image lo...
MLint32 MLErrorCode
Type of an ML Error code.
Definition mlTypeDefs.h:772
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:505
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:489
Cluster user data parameters.