Basic data strctures and functions

Basic data structures for data and meta-data handling. More...

Data Structures

class  C2DFVectorfield
 a 2D field of floating point single accuracy 2D vectors More...
 
class  C2DImage
 This is the base class for 2D images that can hold generic pixel data. More...
 
class  C3DCriticalPoint
 A class to hold a critical point. This class holds a critical point in a 3D vector field It consists of a localtion \( x_0 \in \mathbb{R}^3 \), Matrix \( A \in \mathbb{R}^{3 \times 3} \), and a magnitude \( \gamma \in \mathbb{R} \). It is used only as an intermidiate storage. More...
 
class  C3DCriticalPointEigen
 A class to hold a criticalpoint with eigenvalues and eigenvectors. More...
 
class  C3DFVectorfield
 a 3D field of floating point single accuracy 3D vectors More...
 
class  C3DImage
 The generic base type of a 3D image. More...
 
class  C3DLandmark
 a named 3D landmark More...
 
class  C3DLandmarklist
 A list of named landmarks. More...
 
class  C3DValueAttribute< T >
 a 3D vector value used in attributes More...
 
class  C3DValueAttributeTranslator< T >
 a translater for 3D vectors to and from a std::string More...
 
class  CAttribute
 The class of all attributes of data that is considered to ve meta-data. More...
 
class  CAttributedData
 A collection of attributes. More...
 
class  CAttrTranslator
 A class to translate an attribute from a string. More...
 
class  CFFT1D_R2C
 a class to real-to-complex 1D FFTs More...
 
class  CHistory
 This class holds the complete history list of a data set. More...
 
class  CMinimizer
 A class for generalized minimization problems. More...
 
class  CNoiseGenerator
 Base class for the noise generators. More...
 
class  CStringAttrTranslatorMap
 A singelton class to translate strings to attributes based on keys. More...
 
class  CTriangleMesh
 A class to deine a triangle mesh with some attributes. More...
 
class  range3d_iterator< I >
 a 3D iterator that knows its position in the 3D grid ans supports iterating over sub-ranges More...
 
class  range3d_iterator_with_boundary_flag< I >
 a 3D iterator that knows its position in the 3D grid, has a flag indicating whether it is on a boundary, and supports iterating over sub-ranges More...
 
class  T2DDatafield< T >
 A class to hold data on a regular 2D grid. More...
 
class  T2DImage< T >
 This is the template version of a 2D image that is used for holding real data. More...
 
class  T2DVector< T >
 a 2D vector More...
 
class  T2DVectorfield< T >
 2D Vector field More...
 
class  T3DDatafield< T >
 A templated class of a 3D data field. More...
 
class  T3DImage< T >
 Specific type of the 3D images that hold real pixel data. More...
 
class  T3DMatrix< T >
 a simple 3x3 matrix More...
 
class  T3DVector< T >
 A simple 3D vector type. More...
 
class  T3DVectorfield< T >
 a 3D vector field More...
 
class  TAttribute< T >
 Class of an attribute that holds data of type T. More...
 
class  TShape< T, M >
 a generic class for morphological shapes More...
 
class  TTranslator< T >
 Generic string vs. attribute translator singleton. More...
 

Typedefs

typedef T3DVectorfield< C3DDVectorC3DDVectorfield
 a 3D field of floating point double accuracy 3D vectors More...
 
typedef TAttribute< E3DImageOrientationC3DImageOrientation
 attribute for 3D image orientation More...
 
typedef C3DValueAttribute< int > C3DIntAttribute
 a 3D integer vector More...
 
typedef C3DValueAttributeTranslator< int > C3DIntAttributeTranslator
 attribute translator for a 3D integer vector More...
 
typedef TAttribute< CAttributeMapCAttributeList
 providing the possibility to nest attribute lists More...
 
typedef std::map< std::string, PAttributeCAttributeMap
 A name:attribute map. More...
 
typedef TAttribute< double > CDoubleAttribute
 a double attribute More...
 
typedef TAttribute< float > CFloatAttribute
 a float attribute More...
 
typedef TAttribute< int > CIntAttribute
 an integer attribute More...
 
typedef TTranslator< E3DImageOrientationCOrientationTranslator
 translator for 3D image orientations to and from strings More...
 
typedef TAttribute< E3DPatientPositioningCPatientPositionAttribute
 attribute for the patient position More...
 
typedef TTranslator< E3DPatientPositioningCPatientPositionTranslator
 translator for the patient position More...
 
typedef TAttribute< std::string > CStringAttribute
 a string attribute More...
 
typedef TAttribute< std::vector< double > > CVDoubleAttribute
 a vector of doubles attribute More...
 
typedef TAttribute< std::vector< float > > CVFloatAttribute
 
typedef TAttribute< std::vector< int > > CVIntAttribute
 a vector of integers attribute More...
 
typedef C3DValueAttribute< float > CVoxelAttribute
 a 3D floating point vector used for the voxel size attribute More...
 
typedef C3DValueAttributeTranslator< float > CVoxelAttributeTranslator
 attribute translator for a 3D floating point vector used for the voxel size More...
 
typedef TAttribute< std::vector< std::string > > CVStringAttribute
 a vector of strings attribute More...
 
typedef std::shared_ptr< C3DFVectorfieldP3DFVectorfield
 pointer type for a 3D vector field More...
 
typedef std::shared_ptr< CAttributeMapPAttributeMap
 another pointer-usage easy maker More...
 

Enumerations

enum  E3DImageOrientation {
  ior_undefined = 0, ior_default = 1, ior_xyz = 1, ior_xyz_flipped = 2,
  ior_yxz = 3, ior_yxz_flipped = 4, ior_xzy = 5, ior_xzy_flipped = 6,
  ior_zxy = 7, ior_zxy_flipped = 8, ior_yzx = 9, ior_yzx_flipped =10,
  ior_zyx =11, ior_zyx_flipped =12, ior_axial = 1, ior_axial_flipped = 2,
  ior_coronal = 5, ior_coronal_flipped = 6, ior_saggital = 9, ior_saggital_flipped =10,
  ior_unknown = 13
}
 
enum  E3DPatientPositioning {
  ipp_undefined = 0, ipp_hfp, ipp_hfs, ipp_hfdr,
  ipp_hfdl, ipp_ffp, ipp_ffs, ipp_ffdr,
  ipp_ffdl, ipp_lastindex
}
 

Functions

template<typename T >
void EXPORT_CORE add_attribute (CAttributeMap &attributes, const std::string &key, T value)
 
template<typename T >
T EXPORT_CORE get_attribute_as (const CAttribute &attr)
 
EXPORT_3D C3DFVectorfield get_gradient (const C3DImage &image)
 
EXPORT_3D C3DFVectorfieldoperator+= (C3DFVectorfield &lhs, const C3DFVectorfield &rhs)
 
EXPORT_3D std::ostream & operator<< (std::ostream &os, E3DImageOrientation orient)
 Stream operator to write orientation orient to stream os. More...
 
std::ostream & operator<< (std::ostream &os, const C3DOrientationAndPosition &orient)
 Stream operator to write orientation+position to stream os. More...
 
EXPORT_3D std::ostream & operator<< (std::ostream &os, E3DPatientPositioning pp)
 Stream operator to write patient position orient to stream os. More...
 
EXPORT_CORE std::ostream & operator<< (std::ostream &os, const CAttributeMap &data)
 Facility to write an attribute map to a stream. More...
 
EXPORT_CORE bool operator== (const CAttributeMap &am, const CAttributeMap &bm)
 Compare two attribute data instances a and b. More...
 
EXPORT_3D std::istream & operator>> (std::istream &is, E3DImageOrientation &orient)
 Stream operator to read orientation orient from stream is. More...
 
EXPORT_3D std::istream & operator>> (std::istream &is, C3DOrientationAndPosition &orient)
 Stream operator to read orientation+position from stream is. More...
 
EXPORT_3D std::istream & operator>> (std::istream &is, E3DPatientPositioning &pp)
 Stream operator to read patient position orient from stream is. More...
 

Detailed Description

Basic data structures for data and meta-data handling.

Typedef Documentation

◆ C3DDVectorfield

a 3D field of floating point double accuracy 3D vectors

Definition at line 133 of file 3d/vectorfield.hh.

◆ C3DImageOrientation

attribute for 3D image orientation

Definition at line 242 of file orientation.hh.

◆ C3DIntAttribute

a 3D integer vector

Definition at line 101 of file valueattributetranslator.hh.

◆ C3DIntAttributeTranslator

attribute translator for a 3D integer vector

Definition at line 107 of file valueattributetranslator.hh.

◆ CAttributeList

providing the possibility to nest attribute lists

Definition at line 229 of file attributes.hh.

◆ CAttributeMap

typedef std::map<std::string, PAttribute> CAttributeMap

A name:attribute map.

Definition at line 217 of file attributes.hh.

◆ CDoubleAttribute

typedef TAttribute<double> CDoubleAttribute

a double attribute

Definition at line 192 of file attributes.hh.

◆ CFloatAttribute

typedef TAttribute<float> CFloatAttribute

a float attribute

Definition at line 180 of file attributes.hh.

◆ CIntAttribute

typedef TAttribute<int> CIntAttribute

an integer attribute

Definition at line 168 of file attributes.hh.

◆ COrientationTranslator

translator for 3D image orientations to and from strings

Definition at line 249 of file orientation.hh.

◆ CPatientPositionAttribute

attribute for the patient position

Definition at line 257 of file orientation.hh.

◆ CPatientPositionTranslator

translator for the patient position

Definition at line 270 of file orientation.hh.

◆ CStringAttribute

typedef TAttribute<std::string> CStringAttribute

a string attribute

Definition at line 205 of file attributes.hh.

◆ CVDoubleAttribute

typedef TAttribute<std::vector<double> > CVDoubleAttribute

a vector of doubles attribute

Definition at line 198 of file attributes.hh.

◆ CVFloatAttribute

typedef TAttribute<std::vector<float> > CVFloatAttribute

brief a vector of floats attribute

Definition at line 186 of file attributes.hh.

◆ CVIntAttribute

typedef TAttribute<std::vector<int> > CVIntAttribute

a vector of integers attribute

Definition at line 174 of file attributes.hh.

◆ CVoxelAttribute

a 3D floating point vector used for the voxel size attribute

Definition at line 89 of file valueattributetranslator.hh.

◆ CVoxelAttributeTranslator

attribute translator for a 3D floating point vector used for the voxel size

Definition at line 95 of file valueattributetranslator.hh.

◆ CVStringAttribute

typedef TAttribute<std::vector<std::string> > CVStringAttribute

a vector of strings attribute

Definition at line 211 of file attributes.hh.

◆ P3DFVectorfield

typedef std::shared_ptr<C3DFVectorfield > P3DFVectorfield

pointer type for a 3D vector field

Definition at line 36 of file multireg.hh.

◆ PAttributeMap

typedef std::shared_ptr<CAttributeMap > PAttributeMap

another pointer-usage easy maker

Definition at line 235 of file attributes.hh.

Enumeration Type Documentation

◆ E3DImageOrientation

Basic image orientations based on viewing direction

Enumerator
ior_undefined 
ior_default 

undefined image orientation look from above or below at the head

ior_xyz 

transversal head first

ior_xyz_flipped 

transversal feet first

ior_yxz 

transversal head first xy transposed

ior_yxz_flipped 

transversal feet first xy transposed

ior_xzy 

coronal face first

ior_xzy_flipped 

coronal back first

ior_zxy 

coronal face first xz transposed

ior_zxy_flipped 

coronal back first xz transposed

ior_yzx 

saggital left first

ior_yzx_flipped 

saggital right first

ior_zyx 

saggital left first zy transposed

ior_zyx_flipped 

saggital right first zy transposed

ior_axial 

standard axial/transversal orientation

ior_axial_flipped 

standard axial/transversal orientation

ior_coronal 

standard coronal orientation

ior_coronal_flipped 

standard coronal orientation

ior_saggital 

standard saggital orientation

ior_saggital_flipped 

standard saggital orientation

ior_unknown 

stopper index

Definition at line 40 of file orientation.hh.

◆ E3DPatientPositioning

The Patient Position (DICOM 7.3.1.1 specifies the position of the patient relative to the imaging equipment space. This attribute is intended for annotation purposes only. It does not provide an exact mathematical relationship of the patient to the imaging equipment.

When facing the front of the imaging equipment, Head First is defined as the patient’s head being positioned toward the front of the imaging equipment. Feet First is defined as the patient’s feet being positioned toward the front of the imaging equipment. Prone is defined as the patient’s face being positioned in a downward (gravity) direction. Supine is defined as the patient’s face being in an upward direction. Decubitus Right is defined as the patient’s right side being in a downward direction. Decubitus Left is defined as the patient’s left side being in a downward direction.

Enumerator
ipp_undefined 

undefined patient position

ipp_hfp 

head first prone

ipp_hfs 

head first supine

ipp_hfdr 

head first Decubitus Right

ipp_hfdl 

head first Decubitus Left

ipp_ffp 

feet first prone

ipp_ffs 

feet first supine

ipp_ffdr 

feet first Decubitus Right

ipp_ffdl 

feet first Decubitus Left

ipp_lastindex 

Definition at line 162 of file orientation.hh.

Function Documentation

◆ add_attribute()

template<typename T >
void EXPORT_CORE add_attribute ( CAttributeMap attributes,
const std::string &  key,
value 
)

convenience function to set an attribute in an attribute map:

Remarks
review its use
Template Parameters
typeof the attribute value to be added
Parameters
attributesmap to set the value in
key
value

Definition at line 481 of file attributes.hh.

References cvdebug().

Referenced by CAttributedData::set_attribute().

◆ get_attribute_as()

template<typename T >
T EXPORT_CORE get_attribute_as ( const CAttribute attr)

Helper function to get the value of an attribute. Thr function throws a bad_cast exception, if the attribute doesn't hold a value of the requested type T

Template Parameters
Ttarget type
Parameters
attrattribute to be read

Definition at line 159 of file attributes.hh.

◆ get_gradient()

EXPORT_3D C3DFVectorfield get_gradient ( const C3DImage image)

Stand alone function to evaluate the gradient of an image using finite differences. The gradient at the boundaries is set to zero.

Parameters
image
Returns
a 3D vector field holding the gradient of the input image

◆ operator+=()

EXPORT_3D C3DFVectorfield& operator+= ( C3DFVectorfield lhs,
const C3DFVectorfield rhs 
)

Concat two vector fields assuming these define transformations A(x) = x - a(x) and B(x) = x - b(x), hence c(x) = a(x-b(x)) + b(x)

Parameters
[in,out]lhsleft input vector field and output
[in]rhsright input vector field and output
Returns
lhs after processing

◆ operator<<() [1/4]

EXPORT_3D std::ostream& operator<< ( std::ostream &  os,
E3DImageOrientation  orient 
)

Stream operator to write orientation orient to stream os.

Parameters
os
orient
Returns
os

Referenced by operator<<().

◆ operator<<() [2/4]

std::ostream& operator<< ( std::ostream &  os,
const C3DOrientationAndPosition orient 
)
inline

Stream operator to write orientation+position to stream os.

Parameters
os
orient
Returns
os

Definition at line 204 of file orientation.hh.

References EXPORT_3D, operator<<(), operator>>(), and C3DOrientationAndPosition::print().

◆ operator<<() [3/4]

EXPORT_3D std::ostream& operator<< ( std::ostream &  os,
E3DPatientPositioning  pp 
)

Stream operator to write patient position orient to stream os.

Parameters
os
pp
Returns
os

◆ operator<<() [4/4]

EXPORT_CORE std::ostream& operator<< ( std::ostream &  os,
const CAttributeMap data 
)

Facility to write an attribute map to a stream.

Parameters
osoutput stream
datamap of values
Returns
a reference to the output stream

◆ operator==()

EXPORT_CORE bool operator== ( const CAttributeMap am,
const CAttributeMap bm 
)

Compare two attribute data instances a and b.

Returns
true, if a and b hold the same set of attributes with the same values, false otherwise

◆ operator>>() [1/3]

EXPORT_3D std::istream& operator>> ( std::istream &  is,
E3DImageOrientation orient 
)

Stream operator to read orientation orient from stream is.

Parameters
is
[out]orient
Returns
is

Referenced by operator<<().

◆ operator>>() [2/3]

EXPORT_3D std::istream& operator>> ( std::istream &  is,
C3DOrientationAndPosition orient 
)

Stream operator to read orientation+position from stream is.

Parameters
is
[out]orient
Returns
is

◆ operator>>() [3/3]

EXPORT_3D std::istream& operator>> ( std::istream &  is,
E3DPatientPositioning pp 
)

Stream operator to read patient position orient from stream is.

Parameters
is
[out]pp
Returns
is