MeVisLab Toolbox Reference
ml::SelectedClusters Class Reference

Class for filtering/selection clusters. More...

#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. More...
 
void setSelectedAtVoxelPositions (const std::vector< ImageVector > &voxelPositions)
 Sets the clusters at the given voxel positions selected. More...
 
void setSelectedByRank (MLuint rank)
 Sets the cluster with the given rank selected. More...
 
void setLargestClusterSelected ()
 Sets only the largest cluster to be selected. More...
 
bool setLargestClusterOnEachSliceSelected ()
 Sets the largest cluster on each slice to be selected. More...
 
MLuint getNumSelectedClusters () const
 Returns the number of selected clusters. More...
 
bool isSelected (MLint x, MLint y, MLint z) const
 Returns whether a cluster at the position in the cluster volume is selected. More...
 
bool isSelected (MLuint clusterRank) const
 Returns whether a cluster with the given rank is selected. More...
 
void deselectAllClusters ()
 Deselects all clusters. More...
 
void selectAllClusters ()
 Selects all clusters. More...
 
void setVolumeFactor (MLdouble volumeFactor)
 Sets a volume factor for a single voxel for filtering by cluster size. More...
 
void setMinClusterSize (MLdouble minSize)
 Sets the minimum cluster size under consideration of the volume factor. More...
 
void setMaxClusterSize (MLdouble maxSize)
 Sets the maximum cluster size under consideration of the volume factor. More...
 
void setInvertSelection (bool shouldInvert)
 Sets whether the whole selection should be inverted. More...
 
bool isSelectionInverted () const
 Returns whether the selection should be inverted. More...
 
void setSelected (MLuint clusterRank, bool selectionState=true)
 Sets the selection state of the cluster at the given rank. More...
 
MLuint getMinRankOfSelectedClusters () const
 Returns the minimum rank of selected clusters, 0 if no cluster is selected. More...
 
MLuint getMaxRankOfSelectedClusters () const
 Returns the maximum rank of selected clusters, 0 if no cluster is selected. More...
 
Vector3 getBoundingBoxMinOfSelectedClusters () const
 Returns the min bounding box of the selected clusters, (-1,-1,-1) if no cluster is selected. More...
 
Vector3 getBoundingBoxMaxOfSelectedClusters () const
 Returns the max bounding box of the selected clusters, (-1,-1,-1) if no cluster is selected. More...
 
Vector3 getBoundingBoxMinOfClusterWithRank (MLuint rank) const
 Returns the min bounding box of a cluster with the given rank. More...
 
Vector3 getBoundingBoxMaxOfClusterWithRank (MLuint rank) const
 Returns the max bounding box of a cluster with the given rank. More...
 
Clustersclusters ()
 Returns a pointer to the internal clusters. More...
 
- Public Member Functions inherited from ml::RefCountedBase
 RefCountedBase ()
 Constructor. More...
 
 RefCountedBase (const RefCountedBase &)
 Explicit copy constructor. More...
 
virtual void incRefCount () const
 Increase reference count. More...
 
virtual void decRefCount () const
 Decrease ref count (object will be deleted if ref count is decremented to 0) More...
 
bool isRefCountedBase () const override
 Returns if the instance is derived from RefCountedBase. More...
 
- Public Member Functions inherited from ml::EventSource
 EventSource ()
 
 EventSource (const EventSource &evSource)
 
 ~EventSource () override
 
void addEventListener (BaseEventCallback *cb, void *userData)
 add event listener callback to this Base object - the userData will be the first argument when the callback is called More...
 
void removeEventListener (BaseEventCallback *cb, void *userData)
 remove event listener callback from this Base object - arguments must be the same as for the addEventListener call More...
 
bool hasEventListeners () const
 check if any event listeners have been added to this Base object; this can be used to skip the sendEvent call (and the potentially expensive building of the event object) altogether More...
 
- Public Member Functions inherited from ml::Base
 Base ()
 Constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
virtual BasedeepCopy () const
 Set addStateToTree version number that can be accessed via getAddStateVersion() More...
 
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
 Check if this object's type is equal to or derived from one of the types given in the argument. More...
 
virtual std::string detailString () const
 Return a string describing this object. More...
 
virtual bool implementsPersistence (PersistenceInterface) const
 Override this method to declare which persistence interfaces are implemented by your derived class. More...
 
virtual std::string persistentState () const
 Returns a string describing the object's internal state. More...
 
virtual void setPersistentState (const std::string &state)
 Restores the object's internal state from a string that had been previously generated using persistentState(). More...
 
virtual void addStateToTree (TreeNode *) const
 Attaches the object state as children of the given parent node. More...
 
virtual void readStateFromTree (TreeNode *)
 Reads the object state from the children of the given parent node. More...
 
virtual void writeTo (AbstractPersistenceOutputStream *) const
 Write the objects state to the data stream object. More...
 
virtual void readFrom (AbstractPersistenceInputStream *, int)
 Read the objects state from the data stream object. More...
 

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)
 Helper method that handles inc/dec of ref count if base instances support it. More...
 
- Protected Member Functions inherited from ml::RefCountedBase
 ~RefCountedBase () override
 Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h. More...
 
- Protected Member Functions inherited from ml::EventSource
void sendEvent (BaseEvent *event, void *skipListener=nullptr)
 Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h. More...
 
- Protected Member Functions inherited from ml::Base
virtual char * getPersistentState () const
 Returns a C string describing the object's internal state. More...
 
virtual void setPersistentState (const char *)
 Restores the object's internal state from a string that had been previously generated using getPersistentState(). More...
 
virtual void clearPersistentState (char *) const
 Disposes a string previously allocated by getPersistentState(). More...
 
- Protected Attributes inherited from ml::RefCountedBase
MLint32 _refCount
 Reference count. More...
 

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)

◆ SelectedClusters() [2/2]

ml::SelectedClusters::SelectedClusters ( SelectedClusters 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.

◆ 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: