13#ifndef ML_SELECTED_CLUSTERS_H
14#define ML_SELECTED_CLUSTERS_H
101 void clearSelectionStates();
102 void initializeSelectionStates(
MLuint numClusters);
103 void copyInputSelection(SelectedClusters* selectedClusters);
104 bool isInsideImage(
const ImageVector& position);
105 void invertSelection();
107 std::vector<char> _isSelected;
114 bool _invertSelection;
116 bool _hasInputSelection;
117 std::vector<char> _isInputSelected;
119 bool isEligibleForSelection(
const ClusterInfo& cInfo,
MLuint& rank);
120 bool isEligibleForSelection(
const ClusterInfo& cInfo,
MLdouble& volume,
MLuint& rank);
#define MLCLUSTERALGORITHM_EXPORT
Structure computes and holds all cluster information. For internal use.
RefCountedBase()
Constructor.
MLuint getNumSelectedClusters() const
Returns the number of selected clusters.
MLuint getMaxRankOfSelectedClusters() const
Returns the maximum rank of selected clusters, 0 if no cluster is selected.
SelectedClusters(Clusters *clusters)
void setSelected(MLuint clusterRank, bool selectionState=true)
void setLargestClusterSelected()
Vector3 getBoundingBoxMaxOfSelectedClusters() const
Returns the max bounding box of the selected clusters, (-1,-1,-1) if no cluster is selected.
void setMaxClusterSize(MLdouble maxSize)
SelectedClusters(SelectedClusters *selectedClusters)
Vector3 getBoundingBoxMinOfSelectedClusters() const
Returns the min bounding box of the selected clusters, (-1,-1,-1) if no cluster is selected.
Vector3 getBoundingBoxMinOfClusterWithRank(MLuint rank) const
Returns the min bounding box of a cluster with the given rank.
void selectAllClusters()
Selects all clusters.
void runSelectionByClusterSizes()
Runs the selection by cluster sizes.
Clusters * clusters()
Returns a pointer to the internal clusters.
bool isSelected(MLint x, MLint y, MLint z) const
Returns whether a cluster at the position in the cluster volume is selected.
bool setLargestClusterOnEachSliceSelected()
void setMinClusterSize(MLdouble minSize)
Sets the minimum cluster size under consideration of the volume factor.
MLuint getMinRankOfSelectedClusters() const
Returns the minimum rank of selected clusters, 0 if no cluster is selected.
bool isSelectionInverted() const
Returns whether the selection should be inverted.
void deselectAllClusters()
Deselects all clusters.
Vector3 getBoundingBoxMaxOfClusterWithRank(MLuint rank) const
Returns the max bounding box of a cluster with the given rank.
void setVolumeFactor(MLdouble volumeFactor)
Sets a volume factor for a single voxel for filtering by cluster size.
void setSelectedByRank(MLuint rank)
Sets the cluster with the given rank selected.
void setSelectedAtVoxelPositions(const std::vector< ImageVector > &voxelPositions)
Sets the clusters at the given voxel positions selected.
void setInvertSelection(bool shouldInvert)
bool isSelected(MLuint clusterRank) const
Returns whether a cluster with the given rank is selected.
#define ML_REFCOUNTED_PTR(CLASSNAME)
Macro that defines convenience Ptr/ConstPtr typedefs to be used instead of intrusive_ptr templates.
#define ML_CLASS_HEADER(className)
Tvec3< MLdouble > Vector3
A vector with three components of type double.