![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/Tensor.h>
Abstract base class for Tensors. More...
Abstract base class for Tensors.
Does not implement any functionality, just provides an interface. Both dimension and data type are arbitrary at this point.
Classes | |
struct | bool_pack |
Public Types | |
template<bool... bs> | |
using | all_true = std::is_same<bool_pack<bs..., true>, bool_pack<true, bs...>> |
template<class R, class... Ts> | |
using | are_all_convertible = all_true<std::is_convertible<Ts, R>::value...> |
![]() | |
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 | |
virtual int | order () const =0 |
Rank of the tensor. | |
virtual size_t | bufferLength () const =0 |
Returns the number of elements in this tensor's storage buffer. | |
virtual size_t | bufferSize () const =0 |
Returns the number of bytes in this tensor's storage buffer. | |
virtual std::vector< size_t > | size () const =0 |
Returns the size of the tensor. | |
Kind | kind () const override |
Return the kind of this data. | |
Pose::TransformationConvention | matrixConvention () const 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. | |
std::string | filename () const |
void | setFilename (const std::string &name) |
virtual bool | serialize (std::ostream &out) const =0 |
Writes the tensor content into the given stream. Includes the tensor size, but not rank or data type. | |
virtual bool | deserialize (std::istream &in)=0 |
Clears the tensor and reads new content from the given stream. This can change the size of the tensor, but not its rank or type. | |
void | requestPostProcessing (bool val) |
Controls whether adding this object to the data model should trigger an automatic plot. Has no effect afterwards. | |
bool | needsPostProcessing () const |
![]() | |
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 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 | 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. | |
Public Attributes | |
Signal< const Data * > | signalContentChanged |
![]() | |
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. | |
Protected Member Functions | |
TensorBase & | operator= (const TensorBase &other) |
![]() | |
void | swapWith (Data &other) |
Swaps the data and emits a matrix and name changed signal for both. | |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
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. | |
|
pure virtual |
Rank of the tensor.
Implemented in Tensor< Order >, and Tensor< 1 >.
|
pure virtual |
Returns the number of elements in this tensor's storage buffer.
Implemented in Tensor< Order >, and Tensor< 1 >.
|
pure virtual |
Returns the number of bytes in this tensor's storage buffer.
Implemented in Tensor< Order >, and Tensor< 1 >.
|
pure virtual |
Returns the size of the tensor.
Implemented in Tensor< Order >, and Tensor< 1 >.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Returns the axis-aligned bounding box of this data in world space.
Implements Data.
|
pure virtual |
Writes the tensor content into the given stream. Includes the tensor size, but not rank or data type.
Implemented in Tensor< Order >, and Tensor< 1 >.
|
pure virtual |
Clears the tensor and reads new content from the given stream. This can change the size of the tensor, but not its rank or type.
Implemented in Tensor< Order >, and Tensor< 1 >.