ImFusion SDK 4.3
AnatomicalStructureCollection Class Referenceabstract

#include <AnatomyPlugin/include/ImFusion/AnatomyPlugin/AnatomicalStructureCollection.h>

Interface for managing collections of anatomical structures For a concrete implementation of this class, see GenericASC. More...

+ Inheritance diagram for AnatomicalStructureCollection:

Detailed Description

Interface for managing collections of anatomical structures For a concrete implementation of this class, see GenericASC.

Public Member Functions

 AnatomicalStructureCollection (bool is2D=false)
 
virtual int numAnatomicalStructures () const =0
 
 AnatomicalStructureCollection (const AnatomicalStructureCollection &)=delete
 
AnatomicalStructureCollectionoperator= (const AnatomicalStructureCollection &)=delete
 
virtual const AnatomicalStructureanatomicalStructure (int index) const =0
 Returns the anatomical structure at index index.
 
virtual AnatomicalStructureanatomicalStructure (int index)=0
 Returns the anatomical structure at index index.
 
AnatomicalStructureanatomicalStructureByIdentifier (const std::string &identifier)
 
const AnatomicalStructureanatomicalStructureByIdentifier (const std::string &identifier) const
 
virtual std::vector< const AnatomicalStructure * > anatomicalStructures () const
 Returns a vector of pointers to all anatomical structures.
 
virtual std::vector< AnatomicalStructure * > anatomicalStructures ()
 
Pose::TransformationConvention matrixConvention () const final override
 Defines whether the internally stored matrices in derived classes map from or to the world coordinate system.
 
Geometry::AlignedBox bounds () const override
 Returns the axis-aligned bounding box of this data in world space.
 
DataList children () const override
 Returns the list of direct children of this group.
 
bool enableChildren ()
 
void setEnableChildren (bool enableChildren)
 
virtual int anatomicalStructureIndex (const AnatomicalStructure *anatomicalStructure) const
 Return the index corresponding to a given anatomical structure.
 
virtual bool addAnatomicalStructure (std::unique_ptr< AnatomicalStructure > toAdd)
 Add an anatomical structure to this collection.
 
virtual std::unique_ptr< AnatomicalStructuretakeAnatomicalStructure (AnatomicalStructure *a)
 Take an anatomical structure from this collection.
 
int size () const override
 
bool empty () const override
 Retuns true if all members are empty, i.e. this structure has no associated information.
 
void merge (const AnatomicalStructureCollection &other, bool checkIdentifier=true)
 Merges the collection other into the current collection by adding all anatomical structures from other.
 
void clear () override
 Clear all data contained in this structure.
 
ASCSetparent () const
 If the AnatomicalStructureCollection is part of an ASCSet, the parent ASCSet of the anatomical structure.
 
void setParent (ASCSet *parent)
 Sets the parent ASCSet of the anatomical structure.
 
mat4 matrixToWorld () const
 Get matrix mapping from the data coordinate system to the world coordinate system.
 
virtual void setMatrixToWorld (const mat4 &m, bool synchronizeWorld=true)
 Set the local to world matrix of this object.
 
- Public Member Functions inherited from AnatomicalStructure
 AnatomicalStructure (bool is2D=false)
 
 AnatomicalStructure (AnatomicalStructure &other)
 
 AnatomicalStructure (AnatomicalStructure &&other)
 
virtual std::string describe () const
 A (human-readable) description of this anatomy.
 
virtual std::string identifier () const =0
 A (machine-readable) name of the anatomy.
 
virtual std::string serializationID () const =0
 String differentiating the type of Anatomical Structure For imfusion types, these strings should start with "imfusion." Used for (de)serialization.
 
mat4 matrixToWorld () const
 
virtual Geometry::AlignedBox bounds (const mat4 &orientation=mat4::Identity(), const std::vector< ContentType > &toConsider={ContentType::Keypoints, ContentType::PointClouds, ContentType::Meshes, ContentType::Splines, ContentType::Graphs}) const
 
Propertiesattributes ()
 
Properties const & attributes () const
 
template<typename Derived>
std::unique_ptr< Derived > clone () const
 Helper function for calling cloneImpl() and casting to a specific type.
 
void configure (const Properties *p) override
 Configure attributes and parameters.
 
void configuration (Properties *p) const override
 Retrieve configuration of attributes and parameters.
 
bool is2D () const
 Returns true if the AnatomicalStructure is 2D or false if it is 3D.
 
virtual std::unique_ptr< AnatomicalStructureconstruct () const =0
 
KeyValueStore< vec3 > & keypoints ()
 Getters for non-Data key/value stores.
 
const KeyValueStore< vec3 > & keypoints () const
 
KeyValueStore< vec4 > & planes ()
 
const KeyValueStore< vec4 > & planes () const
 
KeyValueStore< std::unique_ptr< Spline > > & splines ()
 
const KeyValueStore< std::unique_ptr< Spline > > & splines () const
 
KeyValueStore< std::unique_ptr< SharedImageSet > > & images ()
 Getters for Data key/value stores.
 
const KeyValueStore< std::unique_ptr< SharedImageSet > > & images () const
 
KeyValueStore< std::unique_ptr< Mesh > > & meshes ()
 
const KeyValueStore< std::unique_ptr< Mesh > > & meshes () const
 
KeyValueStore< std::unique_ptr< PointCloud > > & pointclouds ()
 
const KeyValueStore< std::unique_ptr< PointCloud > > & pointclouds () const
 
KeyValueStore< std::unique_ptr< Graph > > & graphs ()
 
const KeyValueStore< std::unique_ptr< Graph > > & graphs () const
 
KeyValueStore< AnatomicalStructureDeformation > & deformations ()
 
const KeyValueStore< AnatomicalStructureDeformation > & deformations () const
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 
- Public Member Functions inherited from Data
 Data (const std::string &name="")
 
 Data (const Data &other)
 
Dataoperator= (const Data &other)
 
virtual ~Data ()
 Mandatory virtual destructor.
 
virtual Kind kind () const =0
 Return the kind of this data.
 
virtual Modality modality () const
 Return the modality of this data.
 
const std::stringname () const
 Return the name of this data.
 
void setName (const std::string &name)
 Sets the name of this data.
 
virtual bool isAnnotationType () const
 Return whether this data type is visualized through an annotation (e.g. mesh)
 
const DataComponentListcomponents () const
 Returns the list of DataComponents for this data.
 
DataComponentListcomponents ()
 
virtual std::string describe () const
 Human readable description of the data for showing in the info bar.
 
virtual void setMatrixFromWorld (const mat4 &m)
 Set matrix mapping from the world coordinate system to the data coordinate system.
 
virtual void setMatrixToWorld (const mat4 &m)
 Set matrix mapping from the data coordinate system to the world coordinate system.
 
virtual mat4 matrixFromWorld () const
 Get matrix mapping from the world coordinate system to the data coordinate system.
 
virtual mat4 matrix () const
 Return the transformation matrix.
 
virtual void setMatrix (const mat4 &m)
 Set the transformation matrix.
 
- 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 Member Functions inherited from Selectable
 Selectable (const Selectable &)
 
 Selectable (Selectable &&)
 
Selectableoperator= (const Selectable &)
 
Selectableoperator= (Selectable &&)
 
virtual Selection selection () const
 
virtual int focus () const
 
virtual void setSelection (const Selection &sel)
 Set the underlying selection.
 
virtual void setFocus (int index)
 Set focus of the selection.
 

Public Attributes

Signal< AnatomicalStructure * > signalAnatomicalStructureToBeDeleted
 
Signal< AnatomicalStructure * > signalAnatomicalStructureAdded
 
Signal signalDataChanged
 This signal can be emitted after changing included anatomical structures or parameters owned by this object.
 
Signal signalMatrixChanged
 
- Public Attributes inherited from AnatomicalStructure
Signal signalMatrixChanged
 
Signal signalInDestructor
 This signal is called in the destructor. Classes that inherit from AnatomicalStructure may additionally emit this signal.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Public Attributes inherited from Data
Signal< const Data * > signalDeleted
 Signal emitted when this instance is deleted.
 
Signal< const Data * > signalMatrixChanged
 Signal emitted when the transformation of this Data has changed.
 
Signal< std::stringsignalNameChanged
 Signal emitted when the name changed.
 
- Public Attributes inherited from CompoundData
Signal< Data * > signalChildAdded
 Signal emitted when a new Data instance has been added to children()
 
Signal< Data * > signalChildMoved
 Signal emitted when a Data instance has changed its position in children()
 
Signal< Data * > signalChildAboutToBeRemoved
 Signal emitted when a Data instance is about to be removed or taken from children()
 
- Public Attributes inherited from Selectable
ProtectedSignal signalSelectionChanged
 Signals that the selection or size might have changed.
 

Additional Inherited Members

- Public Types inherited from AnatomicalStructure
using ContentType = AnatomyPlugin::ContentType
 
- Public Types inherited from Data
enum  Kind {
  UNKNOWN = 0 , IMAGE = 1 , VOLUME = 2 , IMAGESET = 3 ,
  VOLUMESET = 4 , IMAGESTREAM = 5 , VOLUMESTREAM = 6 , POINTSET = 7 ,
  SURFACE = 8 , TRACKINGSTREAM = 9 , LIVETRACKINGSTREAM = TRACKINGSTREAM , TRACKINGDATA = 10 ,
  TREE = 11 , TENSOR = 12 , POLYDATASTREAM = 13 , STEREOIMAGESET = 14 ,
  STEREOIMAGESTREAM = 15 , VOLUMETRICMESH = 16
}
 Kind of data. More...
 
enum  Modality {
  NA = 0 , XRAY = 1 , CT = 2 , MRI = 3 ,
  ULTRASOUND = 4 , VIDEO = 5 , NM = 6 , OCT = 7 ,
  LABEL = 8 , DISTANCE = 9
}
 Image modality of the data. More...
 
- Static Public Member Functions inherited from Data
static std::string modalityString (Data::Modality m)
 Return the name of an image modality.
 
static Data::Modality stringToModality (const std::string &s)
 Returns the modality corresponding to a modality string or NA if nothing matches.
 
- Protected Member Functions inherited from AnatomicalStructure
virtual std::unique_ptr< AnatomicalStructurecloneImpl () const
 Derived classes may override this, but should call the base class cloneImpl to obtain a (unique-ptr) which they may assume to point to an object of the derived class.
 
- Protected Member Functions inherited from NotCopyable
 NotCopyable (NotCopyable &&) noexcept=default
 
NotCopyableoperator= (NotCopyable &&) noexcept=default
 
 NotCopyable (const NotCopyable &)=delete
 
NotCopyableoperator= (const NotCopyable &)=delete
 
- Protected Member Functions inherited from Data
void swapWith (Data &other)
 Swaps the data and emits a matrix and name changed signal for both.
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 
- Protected Attributes inherited from AnatomicalStructure
mat4 m_matrixToWorld = mat4::Identity()
 
KeyValueStore< vec3 > m_keypoints {m_matrixToWorld}
 
KeyValueStore< vec4 > m_planes {m_matrixToWorld}
 
KeyValueStore< std::unique_ptr< Spline > > m_splines {m_matrixToWorld}
 
KeyValueStore< std::unique_ptr< SharedImageSet > > m_images {m_matrixToWorld}
 
KeyValueStore< std::unique_ptr< Mesh > > m_meshes {m_matrixToWorld}
 
KeyValueStore< std::unique_ptr< PointCloud > > m_pointClouds {m_matrixToWorld}
 
KeyValueStore< std::unique_ptr< Graph > > m_graphs {m_matrixToWorld}
 
KeyValueStore< AnatomicalStructureDeformationm_deformations {m_matrixToWorld}
 
Properties m_attributes
 General properties object for the Anatomical Structure.
 
bool m_is2D
 Indicates if the AnatomicalStructure information is in 2D or, if false, in 3D.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 
- Protected Attributes inherited from Data
mat4 m_matrix
 Transformation matrix.
 
std::recursive_mutexm_matrixMutex
 Used to internally synchronize access to the matrix of data.
 
DataComponentList m_dataComponentList
 The list of DataComponents for this data.
 
- Protected Attributes inherited from Selectable
std::mutex m_selectionMutex
 Mutex protecting the selection.
 
Selection m_sel
 

Member Function Documentation

◆ numAnatomicalStructures()

virtual int numAnatomicalStructures ( ) const
pure virtual

Implemented in GenericASC.

◆ anatomicalStructure() [1/2]

virtual const AnatomicalStructure & anatomicalStructure ( int index) const
pure virtual

Returns the anatomical structure at index index.

Warning
the index must be non-negative and smaller than the result of numAnatomicalStructures

Implemented in GenericASC, and SpineData.

◆ anatomicalStructure() [2/2]

virtual AnatomicalStructure & anatomicalStructure ( int index)
pure virtual

Returns the anatomical structure at index index.

Warning
the index must be non-negative and smaller than the result of numAnatomicalStructures

Implemented in GenericASC, and SpineData.

◆ matrixConvention()

Pose::TransformationConvention matrixConvention ( ) const
inlinefinaloverridevirtual

Defines whether the internally stored matrices in derived classes map from or to the world coordinate system.

Changes the behavior of the default implementations of matrixToWorld and matrixFromWorld.

Implements Data.

◆ bounds()

Geometry::AlignedBox bounds ( ) const
overridevirtual

Returns the axis-aligned bounding box of this data in world space.

Warning
Depending on the underlying data type this calling function may be computationally expensive! Do not call this method more often than needed, unless it is known that the caching behavior is implemented.

Implements Data.

Reimplemented in GenericASC, and SpineData.

◆ children()

DataList children ( ) const
overridevirtual

Returns the list of direct children of this group.

Implements CompoundData.

◆ anatomicalStructureIndex()

virtual int anatomicalStructureIndex ( const AnatomicalStructure * anatomicalStructure) const
virtual

Return the index corresponding to a given anatomical structure.

If the anatomical structure is not included in this AnatomicalStructureCollection object, -1 is returned.

Reimplemented in GenericASC, and SpineData.

◆ addAnatomicalStructure()

virtual bool addAnatomicalStructure ( std::unique_ptr< AnatomicalStructure > toAdd)
inlinevirtual

Add an anatomical structure to this collection.

Returns false if the anatomical structure that is being added is not supported

Reimplemented in GenericASC, and SpineData.

◆ takeAnatomicalStructure()

virtual std::unique_ptr< AnatomicalStructure > takeAnatomicalStructure ( AnatomicalStructure * a)
inlinevirtual

Take an anatomical structure from this collection.

Reimplemented in GenericASC, and SpineData.

◆ size()

int size ( ) const
overridevirtual
Returns
Total number of elements.

Implements Selectable.

◆ empty()

bool empty ( ) const
overridevirtual

Retuns true if all members are empty, i.e. this structure has no associated information.

Reimplemented from AnatomicalStructure.

◆ merge()

void merge ( const AnatomicalStructureCollection & other,
bool checkIdentifier = true )

Merges the collection other into the current collection by adding all anatomical structures from other.

If an anatomical structure with the same identifier exists in both collections, the current one is kept. The identifier check can be disabled by setting checkIdentifier to false.

◆ clear()

void clear ( )
overridevirtual

Clear all data contained in this structure.

Reimplemented from AnatomicalStructure.

Reimplemented in SpineData.

◆ parent()

ASCSet * parent ( ) const
inline

If the AnatomicalStructureCollection is part of an ASCSet, the parent ASCSet of the anatomical structure.

Warning
Users should never rely on an AnatomicalStructureCollection to have a parent. This coupling is only intended for display synchronization and may be removed in future versions of this plugin.

◆ setParent()

void setParent ( ASCSet * parent)
inline

Sets the parent ASCSet of the anatomical structure.

See also
the documentation of the parent() method for some warnings on the usage of this method.

◆ matrixToWorld()

mat4 matrixToWorld ( ) const
inlinevirtual

Get matrix mapping from the data coordinate system to the world coordinate system.

Inverse of matrixFromWorld.

Note
Depending on how matrices are internally stored in concrete derived classes, a matrix inversion might be necessary to obtain this mapping. The default implementation checks matrixConvention and accordingly returns matrix or its inverse.

Reimplemented from Data.

Reimplemented in SpineData.

◆ setMatrixToWorld()

virtual void setMatrixToWorld ( const mat4 & m,
bool synchronizeWorld = true )
virtual

Set the local to world matrix of this object.

If synchronizeWorld is true, then the local representation of all objects owned by this class are used to update the "world" representations. If synchronizeWorld is false, then the local representations are updated based on the "world" representations,

See also
ImpliedImageCoordinates Derived classes should call the parent version.

Reimplemented from AnatomicalStructure.

Reimplemented in GenericASC, and SpineData.


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