MeVisLab Toolbox Reference
ml::SelectedClusters Class Reference

#include <mlSelectedClusters.h>

Inheritance diagram for ml::SelectedClusters:
ml::RefCountedBase ml::EventSource ml::Base

Public Member Functions

 SelectedClusters (Clusters *clusters)
 SelectedClusters (SelectedClusters *selectedClusters)
void runSelectionByClusterSizes ()
 Runs the selection by cluster sizes.
void setSelectedAtVoxelPositions (const std::vector< ImageVector > &voxelPositions)
 Sets the clusters at the given voxel positions selected.
void setSelectedByRank (MLuint rank)
 Sets the cluster with the given rank selected.
void setLargestClusterSelected ()
bool setLargestClusterOnEachSliceSelected ()
MLuint getNumSelectedClusters () const
 Returns the number of selected clusters.
bool isSelected (MLint x, MLint y, MLint z) const
 Returns whether a cluster at the position in the cluster volume is selected.
bool isSelected (MLuint clusterRank) const
 Returns whether a cluster with the given rank is selected.
void deselectAllClusters ()
 Deselects all clusters.
void selectAllClusters ()
 Selects all clusters.
void setVolumeFactor (MLdouble volumeFactor)
 Sets a volume factor for a single voxel for filtering by cluster size.
void setMinClusterSize (MLdouble minSize)
 Sets the minimum cluster size under consideration of the volume factor.
void setMaxClusterSize (MLdouble maxSize)
void setInvertSelection (bool shouldInvert)
bool isSelectionInverted () const
 Returns whether the selection should be inverted.
void setSelected (MLuint clusterRank, bool selectionState=true)
MLuint getMinRankOfSelectedClusters () const
 Returns the minimum rank of selected clusters, 0 if no cluster is selected.
MLuint getMaxRankOfSelectedClusters () const
 Returns the maximum rank of selected clusters, 0 if no cluster is selected.
Vector3 getBoundingBoxMinOfSelectedClusters () const
 Returns the min bounding box of the selected clusters, (-1,-1,-1) if no cluster is selected.
Vector3 getBoundingBoxMaxOfSelectedClusters () const
 Returns the max 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.
Vector3 getBoundingBoxMaxOfClusterWithRank (MLuint rank) const
 Returns the max bounding box of a cluster with the given rank.
Clustersclusters ()
 Returns a pointer to the internal clusters.
Public Member Functions inherited from ml::RefCountedBase
 RefCountedBase ()
 Constructor.
 RefCountedBase (const RefCountedBase &)
 Explicit copy constructor.
virtual void incRefCount () const
 Increases the reference count.
virtual void decRefCount () const
 Decreases the reference count (object will be deleted if the reference count is decremented to 0).
bool isRefCountedBase () const override
 Returns whether the instance is derived from RefCountedBase.
Public Member Functions inherited from ml::EventSource
 EventSource ()
 EventSource (const EventSource &evSource)
 ~EventSource () override
void addEventListener (BaseEventCallback *cb, void *userData)
void removeEventListener (BaseEventCallback *cb, void *userData)
bool hasEventListeners () const
Public Member Functions inherited from ml::Base
 Base ()
 Constructor.
virtual ~Base ()
 Destructor.
virtual BasedeepCopy () const
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
virtual std::string detailString () const
virtual bool implementsPersistence (PersistenceInterface) const
virtual std::string persistentState () const
 Returns a string describing the object's internal state.
virtual void setPersistentState (const std::string &state)
virtual void addStateToTree (TreeNode *) const
 Attaches the object state as children of the given parent node.
virtual void readStateFromTree (TreeNode *)
 Reads the object state from the children of the given parent node.
virtual void writeTo (AbstractPersistenceOutputStream *) const
virtual void readFrom (AbstractPersistenceInputStream *, int)

Additional Inherited Members

Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
Static Public Member Functions inherited from ml::RefCountedBase
static void updateReferenceCountingIfSupported (Base *oldValue, Base *newValue, bool &isRefCountedBase)
Protected Member Functions inherited from ml::RefCountedBase
 ~RefCountedBase () override
 Destructor.
Protected Member Functions inherited from ml::EventSource
void sendEvent (BaseEvent *event, void *skipListener=nullptr)
Protected Attributes inherited from ml::RefCountedBase
std::atomic_int_least32_t _refCount
 Reference count.

Detailed Description

Class for filtering/selection clusters. Contains a pointer to the computed clusters and selection information. The actual clusters are not copied, so there can be successive filtering without wasting memory.

Definition at line 26 of file mlSelectedClusters.h.

Constructor & Destructor Documentation

◆ SelectedClusters() [1/2]

ml::SelectedClusters::SelectedClusters ( Clusters * clusters)

References clusters().

Referenced by SelectedClusters().

◆ SelectedClusters() [2/2]

ml::SelectedClusters::SelectedClusters ( SelectedClusters * selectedClusters)

References SelectedClusters().

Member Function Documentation

◆ clusters()

Clusters * ml::SelectedClusters::clusters ( )
inline

Returns a pointer to the internal clusters.

Definition at line 93 of file mlSelectedClusters.h.

Referenced by SelectedClusters().

◆ deselectAllClusters()

void ml::SelectedClusters::deselectAllClusters ( )

Deselects all clusters.

◆ getBoundingBoxMaxOfClusterWithRank()

Vector3 ml::SelectedClusters::getBoundingBoxMaxOfClusterWithRank ( MLuint rank) const

Returns the max bounding box of a cluster with the given rank.

◆ getBoundingBoxMaxOfSelectedClusters()

Vector3 ml::SelectedClusters::getBoundingBoxMaxOfSelectedClusters ( ) const

Returns the max bounding box of the selected clusters, (-1,-1,-1) if no cluster is selected.

◆ getBoundingBoxMinOfClusterWithRank()

Vector3 ml::SelectedClusters::getBoundingBoxMinOfClusterWithRank ( MLuint rank) const

Returns the min bounding box of a cluster with the given rank.

◆ getBoundingBoxMinOfSelectedClusters()

Vector3 ml::SelectedClusters::getBoundingBoxMinOfSelectedClusters ( ) const

Returns the min bounding box of the selected clusters, (-1,-1,-1) if no cluster is selected.

◆ getMaxRankOfSelectedClusters()

MLuint ml::SelectedClusters::getMaxRankOfSelectedClusters ( ) const

Returns the maximum rank of selected clusters, 0 if no cluster is selected.

◆ getMinRankOfSelectedClusters()

MLuint ml::SelectedClusters::getMinRankOfSelectedClusters ( ) const

Returns the minimum rank of selected clusters, 0 if no cluster is selected.

◆ getNumSelectedClusters()

MLuint ml::SelectedClusters::getNumSelectedClusters ( ) const

Returns the number of selected clusters.

◆ isSelected() [1/2]

bool ml::SelectedClusters::isSelected ( MLint x,
MLint y,
MLint z ) const

Returns whether a cluster at the position in the cluster volume is selected.

◆ isSelected() [2/2]

bool ml::SelectedClusters::isSelected ( MLuint clusterRank) const

Returns whether a cluster with the given rank is selected.

◆ isSelectionInverted()

bool ml::SelectedClusters::isSelectionInverted ( ) const
inline

Returns whether the selection should be inverted.

Definition at line 72 of file mlSelectedClusters.h.

◆ runSelectionByClusterSizes()

void ml::SelectedClusters::runSelectionByClusterSizes ( )

Runs the selection by cluster sizes.

◆ selectAllClusters()

void ml::SelectedClusters::selectAllClusters ( )

Selects all clusters.

◆ setInvertSelection()

void ml::SelectedClusters::setInvertSelection ( bool shouldInvert)
inline

Sets whether the whole selection should be inverted. Note that the background cluster is never inverted.

Definition at line 70 of file mlSelectedClusters.h.

◆ setLargestClusterOnEachSliceSelected()

bool ml::SelectedClusters::setLargestClusterOnEachSliceSelected ( )

Sets the largest cluster on each slice to be selected. It is only searched within [minClusterSize..maxClusterSize]. This only works if the cluster algorithm was using a 2D neighborhood, returns whether the operation was successful.

◆ setLargestClusterSelected()

void ml::SelectedClusters::setLargestClusterSelected ( )

Sets only the largest cluster to be selected. It is only searched within [minClusterSize..maxClusterSize].

◆ setMaxClusterSize()

void ml::SelectedClusters::setMaxClusterSize ( MLdouble maxSize)
inline

Sets the maximum cluster size under consideration of the volume factor. A value of -1 means no restriction.

Definition at line 66 of file mlSelectedClusters.h.

◆ setMinClusterSize()

void ml::SelectedClusters::setMinClusterSize ( MLdouble minSize)
inline

Sets the minimum cluster size under consideration of the volume factor.

Definition at line 63 of file mlSelectedClusters.h.

◆ setSelected()

void ml::SelectedClusters::setSelected ( MLuint clusterRank,
bool selectionState = true )

Sets the selection state of the cluster at the given rank. Note that the background cluster cannot be selected.

◆ setSelectedAtVoxelPositions()

void ml::SelectedClusters::setSelectedAtVoxelPositions ( const std::vector< ImageVector > & voxelPositions)

Sets the clusters at the given voxel positions selected.

◆ setSelectedByRank()

void ml::SelectedClusters::setSelectedByRank ( MLuint rank)

Sets the cluster with the given rank selected.

◆ setVolumeFactor()

void ml::SelectedClusters::setVolumeFactor ( MLdouble volumeFactor)
inline

Sets a volume factor for a single voxel for filtering by cluster size.

Definition at line 61 of file mlSelectedClusters.h.


The documentation for this class was generated from the following file: