MeVisLab Toolbox Reference
mlClusterInfo.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, 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_CLUSTER_INFO_H
14#define ML_CLUSTER_INFO_H
15
17
18#include <mlVector3.h>
19
20ML_START_NAMESPACE
21
35
38{
44
46 {
47 if (min[0] > x) { min[0] = static_cast<MLdouble>(x); }
48 if (min[1] > y) { min[1] = static_cast<MLdouble>(y); }
49 if (min[2] > z) { min[2] = static_cast<MLdouble>(z); }
50
51 if (max[0] < x) { max[0] = static_cast<MLdouble>(x); }
52 if (max[1] < y) { max[1] = static_cast<MLdouble>(y); }
53 if (max[2] < z) { max[2] = static_cast<MLdouble>(z); }
54 }
55
58};
59
144
145
146
148struct less
149{
155 ML_FORCE_INLINE bool operator() (const ClusterInfo& x, const ClusterInfo& y)
156 {
157 if (x.numVoxels() > y.numVoxels())
158 {
159 return true;
160 }
161 if (x.numVoxels() < y.numVoxels())
162 {
163 return false;
164 }
165 return (x.getId() < y.getId());
166 }
167};
168
169
170ML_END_NAMESPACE
171
172#endif
ML_FORCE_INLINE void setImageValue(MLdouble imageValue)
Sets the image value associated with this cluster.
MLuint _indexId
Unique cluster id; default is 0.
ML_FORCE_INLINE MLuint getId() const
Returns a unique id; default is 0.
MLdouble _imageValue
Image value, only meaningful if Identical Intensities is used in the clustering algorithm.
ML_FORCE_INLINE MLuint numVoxels() const
Returns the cluster size in voxel; default is 0.
ClusterBoundingBox _boundingBox
ML_FORCE_INLINE Vector3 getBoundingBoxMax() const
Returns the max bounding box position.
ML_FORCE_INLINE void addPositionToBoundingBox(MLint x, MLint y, MLint z)
Adds the given position to this cluster's bounding box.
ML_FORCE_INLINE Vector3 getBoundingBoxMin() const
Returns the min bounding box position.
ML_FORCE_INLINE MLdouble imageValue() const
Returns the image value associated with this cluster.
MLuint _numVoxels
Cluster size in voxel; default is 0.
MLuint _rank
Rank of the cluster size compared to other cluster; default is 0.
ClusterInfo()
Default constructor.
ML_FORCE_INLINE void setUserData(MLdouble userData)
Sets the user data.
virtual ~ClusterInfo()
MLdouble _userData
User data, by default its value is set to the rank or original voxel value.
ML_FORCE_INLINE MLdouble userData() const
Returns the user data value.
ML_FORCE_INLINE MLuint rank() const
#define ML_FORCE_INLINE
Definition mlMacros.h:52
MLuint64 MLuint
Definition mlTypeDefs.h:505
double MLdouble
Definition mlTypeDefs.h:216
MLint64 MLint
Definition mlTypeDefs.h:489
#define ML_DOUBLE_MAX
Definition mlTypeDefs.h:219
Tvec3< MLdouble > Vector3
A vector with three components of type double.
Definition mlVector3.h:286
Cluster bounding box.
void addPosition(MLint x, MLint y, MLint z)
Implement comparison operator for ClusterInfo used by std::sort.