![]() |
ImFusion SDK 4.3
|
#include <SpinePlugin/include/ImFusion/Spine/SpineData.h>
Container for set of vertebrae and other spine-related metadata The SpineData class is the main Data type of the ImFusion SpinePlugin. More...
Inheritance diagram for SpineData:Container for set of vertebrae and other spine-related metadata The SpineData class is the main Data type of the ImFusion SpinePlugin.
The main functionality of the SpineData class is managing a vector of OrientedVertebra objects The SpineData class can also hold a single Sacrum and Ilium object
Public Member Functions | |
| SpineData (bool is2D=false) | |
| std::unique_ptr< SpineData > | clone () const |
| std::unique_ptr< AnatomicalStructure > | construct () const override |
| std::unique_ptr< AnatomicalStructure > | cloneImpl () const override |
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. | |
| std::string | identifier () const override |
| A (machine-readable) name of the anatomy. | |
| std::string | serializationID () const override |
| String differentiating the type of Anatomical Structure For imfusion types, these strings should start with "imfusion." Used for (de)serialization. | |
| Kind | kind () const override |
| Return the kind of this data. | |
| Geometry::AlignedBox | bounds () const override |
| Returns the axis-aligned bounding box of this data in world space. | |
| std::string | describe () const override |
| A (human-readable) description of this anatomy. | |
| void | setMatrix (const mat4 &other) override |
| Set the transformation matrix. | |
| void | setMatrix (const mat4 &other, bool syncWorld) |
| void | setMatrixToWorld (const mat4 &m, bool synchronize) override |
| Set the local to world matrix of this object. | |
| Properties const & | properties () const |
| Properties & | properties () |
| virtual mat4 | matrixToWorld () const |
| Get matrix mapping from the data coordinate system to the world coordinate system. | |
| virtual void | setMatrixToWorld (const mat4 &m) |
| Set matrix mapping from the data coordinate system to the world coordinate system. | |
Public Member Functions inherited from AnatomicalStructureCollection | |
| AnatomicalStructureCollection (bool is2D=false) | |
| AnatomicalStructureCollection (const AnatomicalStructureCollection &)=delete | |
| AnatomicalStructureCollection & | operator= (const AnatomicalStructureCollection &)=delete |
| AnatomicalStructure * | anatomicalStructureByIdentifier (const std::string &identifier) |
| const AnatomicalStructure * | anatomicalStructureByIdentifier (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. | |
| DataList | children () const override |
| Returns the list of direct children of this group. | |
| bool | enableChildren () |
| void | setEnableChildren (bool enableChildren) |
| 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. | |
| ASCSet * | parent () 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. | |
Public Member Functions inherited from AnatomicalStructure | |
| AnatomicalStructure (bool is2D=false) | |
| AnatomicalStructure (AnatomicalStructure &other) | |
| AnatomicalStructure (AnatomicalStructure &&other) | |
| 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 |
| Properties & | attributes () |
| 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. | |
| 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 | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Public Member Functions inherited from Data | |
| Data (const std::string &name="") | |
| Data (const Data &other) | |
| Data & | operator= (const Data &other) |
| virtual | ~Data () |
| Mandatory virtual destructor. | |
| virtual Modality | modality () const |
| Return the modality of this data. | |
| const std::string & | name () 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 DataComponentList & | components () const |
| Returns the list of DataComponents for this data. | |
| DataComponentList & | components () |
| virtual void | setMatrixFromWorld (const mat4 &m) |
| Set matrix mapping from the world coordinate system to the data 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. | |
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. | |
| SignalReceiver & | operator= (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 &&) | |
| Selectable & | operator= (const Selectable &) |
| Selectable & | operator= (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< const Data * > | signalMatrixChanged |
| Signal emitted when the transformation of this Data has changed. | |
Public Attributes inherited from AnatomicalStructureCollection | |
| 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::string > | signalNameChanged |
| 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. | |
Signals | |
| Signal< OrientedVertebra * > | signalVertebraToBeDeleted |
| This signal is emitted with the previous value of a vertebra if the vertebra is being deleted. | |
| Signal< Sacrum * > | signalSacrumToBeDeleted |
| Signal< Ilium * > | signalIliumToBeDeleted |
| Signal< OrientedVertebra * > | signalVertebraAdded |
| Signal< Sacrum * > | signalSacrumAdded |
| Signal< Ilium * > | signalIliumAdded |
Functions implementing the AnatomicalStructureCollection interface for accessing stored AnatomicalStructure objects. | |
These are OrientedVertebra, Sacrum, and Ilium | |
| int | numAnatomicalStructures () const override |
| const AnatomicalStructure & | anatomicalStructure (int index) const override |
Returns the anatomical structure at index index. | |
| AnatomicalStructure & | anatomicalStructure (int index) override |
Returns the anatomical structure at index index. | |
| int | anatomicalStructureIndex (const AnatomicalStructure *anatomicalStructure) const override |
| Returns -1 if the structure is not included in this SpineData object. | |
| bool | addAnatomicalStructure (std::unique_ptr< AnatomicalStructure > as) override |
| Add an anatomical structure to this collection. | |
| std::unique_ptr< AnatomicalStructure > | takeAnatomicalStructure (AnatomicalStructure *as) override |
| Take an anatomical structure from this collection. | |
Functions for accessing and modifying stored OrientedVertebra objects | |
| const std::vector< std::unique_ptr< OrientedVertebra > > & | vertebrae () const |
| The entire vector of vertebrae. | |
| std::vector< std::unique_ptr< OrientedVertebra > > & | vertebrae () |
| OrientedVertebra & | vertebra (int index) |
| Convenience function for accessing a single vertebra. | |
| const OrientedVertebra & | vertebra (int index) const |
| IntervertebralDisc & | disc (int index) |
| const IntervertebralDisc & | disc (int index) const |
| size_t | numVertebrae () const |
| Convenience function to get number of stored vertebrae. | |
| size_t | numDiscs () const |
| int | vertebraIndex (const OrientedVertebra *v) const |
| Convenience function for finding vertebrae. | |
| OrientedVertebra * | vertebraByName (const std::string &name) |
| void | addVertebra (std::unique_ptr< OrientedVertebra > v) |
| Push back a vertebra onto the list of owned vertebrae. | |
| void | addDisc (std::unique_ptr< IntervertebralDisc > disc) |
| std::unique_ptr< Sacrum > | replaceSacrum (std::unique_ptr< Sacrum > sacrum) |
Replace Sacrum, and sets this as "parent" of sacrum. Returns the old sacrum. | |
| std::unique_ptr< Ilium > | replaceIlium (std::unique_ptr< Ilium > ilium) |
| Set Ilium. Returns the old ilium. | |
| Sacrum & | sacrum () |
| Getter for the Sacrum. | |
| const Sacrum & | sacrum () const |
| Ilium & | ilium () |
| Getter for the Ilium. | |
| const Ilium & | ilium () const |
| std::unique_ptr< OrientedVertebra > | removeVertebra (OrientedVertebra *v) |
Remove the vertebra equal to v | |
| std::unique_ptr< IntervertebralDisc > | removeDisc (IntervertebralDisc *disc) |
| void | sortVertebrae (const std::function< bool(const OrientedVertebra &, const OrientedVertebra &)> &cmp) |
| Sort vertebrae using comparison function cmp. | |
| void | sortVertebraeNN () |
| Sort vertebrae by identifying vertebra with highest z-coordinate, then iteratively selecting the closest vertebra. | |
| bool | sortVertebraeSpline (int numSamplePoints=100, int numIterationsRANSAC=10000, double epsRANSAC=0.15, int sampleSizeRANSAC=4) |
| Sort vertebrae by fitting a spline using RANSAC, then order them sequentially along the computed spline. | |
| void | clearVertebrae () |
| Remove all vertebrae. | |
| void | clearDiscs () |
| void | clear () override |
| Clear all data contained in this structure. | |
| static bool | saveSpineData (SpineData *spineData, std::ostream &out) |
| static std::unique_ptr< SpineData > | loadSpineData (std::istream &in) |
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 NotCopyable | |
| NotCopyable (NotCopyable &&) noexcept=default | |
| NotCopyable & | operator= (NotCopyable &&) noexcept=default |
| NotCopyable (const NotCopyable &)=delete | |
| NotCopyable & | operator= (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< AnatomicalStructureDeformation > | m_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< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
Protected Attributes inherited from Data | |
| mat4 | m_matrix |
| Transformation matrix. | |
| std::recursive_mutex * | m_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 |
|
overridevirtual |
Implements AnatomicalStructure.
|
overridevirtual |
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.
This is done using the (virtual) construct function (see below).
Reimplemented from AnatomicalStructure.
|
overridevirtual |
A (machine-readable) name of the anatomy.
Implements AnatomicalStructure.
|
overridevirtual |
String differentiating the type of Anatomical Structure For imfusion types, these strings should start with "imfusion." Used for (de)serialization.
Implements AnatomicalStructure.
|
overridevirtual |
Returns the axis-aligned bounding box of this data in world space.
Reimplemented from AnatomicalStructureCollection.
|
overridevirtual |
A (human-readable) description of this anatomy.
Reimplemented from AnatomicalStructure.
|
overridevirtual |
Set the transformation matrix.
m depends on the concrete derived class implementation, with either a matrix mapping to or from the world coordinate system being expected. Only use if convention is explicitly known. Use methods setMatrixFromWorld or setMatrixToWorld to avoid inconsistencies. The default implementation sets m_matrix. Reimplemented from Data.
|
overridevirtual |
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,
Reimplemented from AnatomicalStructureCollection.
|
overridevirtual |
Implements AnatomicalStructureCollection.
|
overridevirtual |
Returns the anatomical structure at index index.
Implements AnatomicalStructureCollection.
|
overridevirtual |
Returns the anatomical structure at index index.
Implements AnatomicalStructureCollection.
|
overridevirtual |
Returns -1 if the structure is not included in this SpineData object.
Reimplemented from AnatomicalStructureCollection.
|
overridevirtual |
Add an anatomical structure to this collection.
Returns false if the anatomical structure that is being added is not supported
Reimplemented from AnatomicalStructureCollection.
|
overridevirtual |
Take an anatomical structure from this collection.
Reimplemented from AnatomicalStructureCollection.
|
inline |
The entire vector of vertebrae.
No element in the returned vector may be nullptr. This vector is not guaranteed to be sorted in any way.
| Sacrum & sacrum | ( | ) |
|
overridevirtual |
Clear all data contained in this structure.
Reimplemented from AnatomicalStructureCollection.
|
virtual |
Get matrix mapping from the data coordinate system to the world coordinate system.
Inverse of matrixFromWorld.
Reimplemented from AnatomicalStructureCollection.
|
virtual |
Set matrix mapping from the data coordinate system to the world coordinate system.
m might be inverted before it is saved. The default implementation checks matrixConvention and accordingly calls setMatrix with either m or its inverse. Reimplemented from Data.
| Signal<OrientedVertebra*> signalVertebraToBeDeleted |
This signal is emitted with the previous value of a vertebra if the vertebra is being deleted.
The object being pointed to still exists, but is no longer part of vertebrae()