13#ifndef ML_CLUSTER_INFO_H
14#define ML_CLUSTER_INFO_H
27 useImageValueAsUserData =
false;
28 voxelSizeInMilliliters = 0.001;
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); }
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); }
Holds basic information about a cluster.
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()
Default destructor.
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
Returns the rank of the cluster size compared to the other clusters; default is 0.
#define ML_FORCE_INLINE
Forcing the use of 'inline' for methods.
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...
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
void addPosition(MLint x, MLint y, MLint z)
Cluster user data parameters.
MLdouble voxelSizeInMilliliters
bool useImageValueAsUserData
ClusterUserDataParameters()
Implement comparison operator for ClusterInfo used by std::sort.