ImFusion SDK 4.3
Data Class Referenceabstract

#include <ImFusion/Base/Data.h>

Virtual base class for representing data from which all concrete data class such as images need to derive. More...

+ Inheritance diagram for Data:

Detailed Description

Virtual base class for representing data from which all concrete data class such as images need to derive.

Public Types

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...
 

Public Member Functions

 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)
 
virtual Geometry::AlignedBox bounds () const =0
 Returns the axis-aligned bounding box of this data in world space.
 
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.
 

Static Public Member Functions

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.
 

Public Attributes

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.
 

Protected Member Functions

void swapWith (Data &other)
 Swaps the data and emits a matrix and name changed signal for both.
 

Protected Attributes

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.
 

Image matrix access

virtual Pose::TransformationConvention matrixConvention () const =0
 Defines whether the internally stored matrices in derived classes map from or to the world coordinate system.
 
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 matrixToWorld () const
 Get matrix mapping from the data coordinate system to the world coordinate system.
 
virtual mat4 matrix () const
 Return the transformation matrix.
 
virtual void setMatrix (const mat4 &m)
 Set the transformation matrix.
 

Member Enumeration Documentation

◆ Kind

enum Kind

Kind of data.

Enumerator
UNKNOWN 

Unknown or unspecified.

IMAGE 

2D image

VOLUME 

3D volume

IMAGESET 

Set of 2D images.

VOLUMESET 

Set of 3D volumes, i.e. 3D+t or 4D data.

IMAGESTREAM 

Stream of 2D images.

VOLUMESTREAM 

Stream of 3D volumes.

POINTSET 

Set of points.

SURFACE 

Surface / mesh data.

TRACKINGSTREAM 

Stream of tracking data.

TRACKINGDATA 

Instance of TrackingSequence class.

TREE 

Instance of Tree class.

TENSOR 

An arbitrary-dimensional array of floating point data.

POLYDATASTREAM 

Stream of point clouds or meshes.

STEREOIMAGESET 

Set of paired stereo images.

STEREOIMAGESTREAM 

Stream of paired stereo images.

VOLUMETRICMESH 

Volumetric unstructured grid / tetrahedral mesh.

◆ Modality

enum Modality

Image modality of the data.

Enumerator
NA 

Not applicable.

XRAY 

2D X-Ray based data

CT 

X-Ray Computed Tomography.

MRI 

Magnetic Resonance Imaging (MRI)

ULTRASOUND 

Ultrasound image data.

VIDEO 

Video / optical image data.

NM 

Nuclear Medicine (SPECT or PET)

OCT 

Optical Coherence Tomography.

LABEL 

Labeling data/label map.

DISTANCE 

Distance map.

Member Function Documentation

◆ kind()

◆ modality()

virtual Modality modality ( ) const
virtual

Return the modality of this data.

The default implementation will always return NA, sub classes may override this method.

Reimplemented in Graph, ImageStream, RobotStateStream, SharedImageSet, and UltrasoundSweep.

◆ setName()

void setName ( const std::string & name)

Sets the name of this data.

Be aware that if the Data is part of a DataModel, the name might change to something else if it is not unique (usually a number is appended).

◆ matrixConvention()

virtual Pose::TransformationConvention matrixConvention ( ) const
pure virtual

◆ setMatrixFromWorld()

virtual void setMatrixFromWorld ( const mat4 & m)
virtual

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

Note
Depending on how matrices are internally stored in concrete derived classes, m might be inverted before it is saved. The default implementation checks matrixConvention and accordingly calls setMatrix with either m or its inverse.

Reimplemented in SharedImageSet.

◆ setMatrixToWorld()

virtual void setMatrixToWorld ( const mat4 & m)
virtual

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

Note
Depending on how matrices are internally stored in concrete derived classes, m might be inverted before it is saved. The default implementation checks matrixConvention and accordingly calls setMatrix with either m or its inverse.

Reimplemented in SharedImageSet, and SpineData.

◆ matrixFromWorld()

virtual mat4 matrixFromWorld ( ) const
virtual

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

Inverse of matrixToWorld.

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 in SharedImageSet.

◆ matrixToWorld()

virtual mat4 matrixToWorld ( ) const
virtual

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 in AnatomicalStructureCollection, SharedImageSet, and SpineData.

◆ matrix()

virtual mat4 matrix ( ) const
virtual

Return the transformation matrix.

Note
Depending on the concrete derived class implementation, this transformation might be mapping either to or from the world coordinate system. Only use if convention is explicitly known. Use methods matrixToWorld or matrixFromWorld to avoid inconsistencies. The default implementation returns m_matrix.

Reimplemented in RGBDPlayback, SharedImageSet, TrackedSharedImageSet, and TrackingSequence.

◆ setMatrix()

virtual void setMatrix ( const mat4 & m)
virtual

Set the transformation matrix.

Note
The matrix convention expected for 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 in DataGroup, GenericASC, Mesh, DataItem, PointCloud, RGBDPlayback, SharedImageSet, SpineData, TrackedSharedImageSet, and TrackingSequence.

◆ isAnnotationType()

virtual bool isAnnotationType ( ) const
virtual

Return whether this data type is visualized through an annotation (e.g. mesh)

Reimplemented in Mesh, PointCloud, TrackingSequence, and Tree.

◆ bounds()

virtual Geometry::AlignedBox bounds ( ) const
pure virtual

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.

Implemented in AnatomicalStructureCollection, ASCSet, DataGroup, GenericASC, Graph, Mesh, BoundingBoxSet, DataItem, KeypointSet, TensorSet, PointCloud, SharedImageSet, SpineData, StereoSharedImageSet, Stream, TensorBase, TrackedSharedImageSet, TrackingSequence, Tree, and UltrasoundSweep.

◆ describe()

Member Data Documentation

◆ signalDeleted

Signal<const Data*> signalDeleted

Signal emitted when this instance is deleted.

Note
This method is called from a Data instance in the destructor of the very base class, therefore no type information for dynamic casts or other class attributes are available anymore.
Warning
Use with caution, only pointer comparison is allowed!

◆ m_matrix

mat4 m_matrix
protected

Transformation matrix.

Derived class responsible for defining convention (mapping from or to world coordinate system), see matrix. Derived classes must lock matrix mutex before accessing the matrix.


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