ImFusion SDK 4.3
StructuresView Class Reference

#include <ImFusion/Seg/StructuresView.h>

The StructuresView provides a flattened view onto a given set of label maps. More...

+ Inheritance diagram for StructuresView:

Detailed Description

The StructuresView provides a flattened view onto a given set of label maps.

It provides a list of Structures, each representing one label configuration of the underlying label maps. Furthermore, it provides a couple of convenience functions to manage their settings and lifetime, as well as a set of signals to notify potential listeners when structures change. You can use the StructuresViewRenderer to automatically visualize the structures in a DisplayWidget.

Note
Apart from some internal bookkeeping information, StructuresView does not store any data. Instead the structure configuration is stored in the label maps and their LabelDataComponents. Therefore, it is good practice to remove a label map from this StructuresView before deleting it.
See also
Structure, StructuresViewRenderer, LabelDataComponent

Classes

struct  LabelMapInfo
 Bookkeeping information to easily map between label maps and their structures. More...
 

Public Types

enum class  StructureSelection { All , OnlyVisible }
 

Public Member Functions

 StructuresView (const std::vector< SharedImageSet * > &labelMaps)
 
std::vector< Structure * > structures ()
 Returns the all Structures of all underlying label maps.
 
std::vector< const Structure * > structures () const
 
std::vector< Structure * > structuresOf (const SharedImageSet *labelMap)
 Returns the all Structures of the given label map.
 
std::vector< const Structure * > structuresOf (const SharedImageSet *labelMap) const
 
void setLabelMaps (const std::vector< SharedImageSet * > &labelMaps)
 Sets the list of label maps that are currently represented by this StructuresView.
 
std::vector< SharedImageSet * > labelMaps ()
 Returns the list of label maps that are currently represented by this StructuresView.
 
std::vector< const SharedImageSet * > labelMaps () const
 
void addLabelMap (SharedImageSet *labelMap)
 Adds the given label.
 
void removeLabelMap (const SharedImageSet *labelMap)
 Adds the given label map to the list of label maps that are currently represented by this StructuresView.
 
std::unique_ptr< SharedImagecomputeOtherLabelsMask (const Structure &s, StructureSelection selection) const
 Returns a binary mask image of all other active labels in the reference grid of the given Structure.
 
std::unique_ptr< SharedImagecomputeOtherLabelsMask (const Structure &s, const std::vector< const Structure * > &structuresToMask) const
 Returns a binary mask image of all other active labels in the reference grid of the given Structure.
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Public Attributes

Signal< Structure * > signalStructureAdded
 Signal emitted every time when a new Structure has been added.
 
Signal< Structure * > signalStructureChanged
 Signal emitted every time a Structure of this StructuresView has changed.
 
Signal< Structure * > signalStructureDeleted
 Signal emitted every time when a Structure has been removed and any corresponding pointer has become invalid.
 

Protected Member Functions

void onLabelDataComponentChanged (LabelDataComponent *ldc)
 
StructureaddStructure (SharedImageSet &labelMap, int labelIndex)
 
void removeStructure (Structure *structure)
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

Protected Attributes

std::vector< std::unique_ptr< Structure > > m_structures
 
std::unordered_map< SharedImageSet *, LabelMapInfom_labelMapInfos
 

Member Function Documentation

◆ setLabelMaps()

void setLabelMaps ( const std::vector< SharedImageSet * > & labelMaps)

Sets the list of label maps that are currently represented by this StructuresView.

This function will first remove all current label maps and then add the new ones. Use addLabelMap()/removeLabelMap() instead if some label maps remain the same.

◆ computeOtherLabelsMask() [1/2]

std::unique_ptr< SharedImage > computeOtherLabelsMask ( const Structure & s,
StructureSelection selection ) const

Returns a binary mask image of all other active labels in the reference grid of the given Structure.

Parameters
sReference structure for which to compute all other labels
selectionEnumeration whether to consider all other structures or only the currently visible ones.

◆ computeOtherLabelsMask() [2/2]

std::unique_ptr< SharedImage > computeOtherLabelsMask ( const Structure & s,
const std::vector< const Structure * > & structuresToMask ) const

Returns a binary mask image of all other active labels in the reference grid of the given Structure.

Parameters
sReference structure for which to compute all other labels
selectionEnumeration whether to consider all other structures or only the currently visible ones.

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close