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< C3DDVector > | C3DDVectorfield
| a 3D field of floating point double accuracy 3D vectors
typedef TAttribute< E3DImageOrientation > | C3DImageOrientation
| attribute for 3D image orientation
typedef C3DValueAttribute< int > | C3DIntAttribute
| a 3D integer vector
typedef C3DValueAttributeTranslator< int > | C3DIntAttributeTranslator
| attribute translator for a 3D integer vector
typedef TAttribute< CAttributeMap > | CAttributeList
| providing the possibility to nest attribute lists
typedef std::map< std::string, PAttribute > | CAttributeMap
| A name:attribute map.
typedef TAttribute< double > | CDoubleAttribute
| a double attribute
typedef TAttribute< float > | CFloatAttribute
| a float attribute
typedef TAttribute< int > | CIntAttribute
| an integer attribute
typedef TTranslator< E3DImageOrientation > | COrientationTranslator
| translator for 3D image orientations to and from strings
typedef TAttribute< E3DPatientPositioning > | CPatientPositionAttribute
| attribute for the patient position
typedef TTranslator< E3DPatientPositioning > | CPatientPositionTranslator
| translator for the patient position
typedef TAttribute< std::string > | CStringAttribute
| a string attribute
typedef TAttribute< std::vector< double > > | CVDoubleAttribute
| a vector of doubles attribute
typedef TAttribute< std::vector< float > > | CVFloatAttribute
typedef TAttribute< std::vector< int > > | CVIntAttribute
| a vector of integers attribute
typedef C3DValueAttribute< float > | CVoxelAttribute
| a 3D floating point vector used for the voxel size attribute
typedef C3DValueAttributeTranslator< float > | CVoxelAttributeTranslator
| attribute translator for a 3D floating point vector used for the voxel size
typedef TAttribute< std::vector< std::string > > | CVStringAttribute
| a vector of strings attribute
typedef std::shared_ptr< CAttributeMap > | PAttributeMap
| another pointer-usage easy maker

## 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 C3DFVectorfield & | operator+= (C3DFVectorfield &lhs, const C3DFVectorfield &rhs)
std::ostream & | operator<< (std::ostream &os, const C3DOrientationAndPosition &orient)
| Stream operator to write orientation+position to stream os.
EXPORT_CORE std::ostream & | operator<< (std::ostream &os, const CAttributeMap &data)
| Facility to write an attribute map to a stream.
EXPORT_3D std::ostream & | operator<< (std::ostream &os, E3DImageOrientation orient)
| Stream operator to write orientation orient to stream os.
EXPORT_3D std::ostream & | operator<< (std::ostream &os, E3DPatientPositioning pp)
| Stream operator to write patient position orient to stream os.
EXPORT_CORE bool | operator== (const CAttributeMap &am, const CAttributeMap &bm)
| Compare two attribute data instances a and b.
EXPORT_3D std::istream & | operator>> (std::istream &is, C3DOrientationAndPosition &orient)
| Stream operator to read orientation+position from stream is.
EXPORT_3D std::istream & | operator>> (std::istream &is, E3DImageOrientation &orient)
| Stream operator to read orientation orient from stream is.
EXPORT_3D std::istream & | operator>> (std::istream &is, E3DPatientPositioning &pp)
| Stream operator to read patient position orient from stream is.

## Variables

NS_MIA_BEGIN typedef std::shared_ptr< C3DFVectorfield > | P3DFVectorfield
| pointer type for a 3D vector field

## Detailed Description

Basic data structures for data and meta-data handling.

## Typedef Documentation

## C3DDVectorfield

typedef T3DVectorfield<C3DDVector> C3DDVectorfield

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

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

## C3DImageOrientation

typedef TAttribute<E3DImageOrientation> C3DImageOrientation

attribute for 3D image orientation

Definition at line 243 of file orientation.hh.

## C3DIntAttribute

typedef C3DValueAttribute<int> C3DIntAttribute

a 3D integer vector

Definition at line 105 of file valueattributetranslator.hh.

## C3DIntAttributeTranslator

typedef C3DValueAttributeTranslator<int> C3DIntAttributeTranslator

attribute translator for a 3D integer vector

Definition at line 111 of file valueattributetranslator.hh.

## CAttributeList

typedef TAttribute<CAttributeMap> CAttributeList

providing the possibility to nest attribute lists

Definition at line 233 of file attributes.hh.

## CAttributeMap

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

A name:attribute map.

Definition at line 221 of file attributes.hh.

## CDoubleAttribute

typedef TAttribute<double> CDoubleAttribute

a double attribute

Definition at line 196 of file attributes.hh.

## CFloatAttribute

typedef TAttribute<float> CFloatAttribute

a float attribute

Definition at line 184 of file attributes.hh.

## CIntAttribute

typedef TAttribute<int> CIntAttribute

an integer attribute

Definition at line 172 of file attributes.hh.

## COrientationTranslator

typedef TTranslator<E3DImageOrientation> COrientationTranslator

translator for 3D image orientations to and from strings

Definition at line 250 of file orientation.hh.

## CPatientPositionAttribute

typedef TAttribute<E3DPatientPositioning> CPatientPositionAttribute

attribute for the patient position

Definition at line 258 of file orientation.hh.

## CPatientPositionTranslator

typedef TTranslator<E3DPatientPositioning> CPatientPositionTranslator

translator for the patient position

Definition at line 271 of file orientation.hh.

## CStringAttribute

typedef TAttribute<std::string> CStringAttribute

a string attribute

Definition at line 209 of file attributes.hh.

## CVDoubleAttribute

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

a vector of doubles attribute

Definition at line 202 of file attributes.hh.

## CVFloatAttribute

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

brief a vector of floats attribute

Definition at line 190 of file attributes.hh.

## CVIntAttribute

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

a vector of integers attribute

Definition at line 178 of file attributes.hh.

## CVoxelAttribute

typedef C3DValueAttribute<float> CVoxelAttribute

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

Definition at line 93 of file valueattributetranslator.hh.

## CVoxelAttributeTranslator

typedef C3DValueAttributeTranslator<float> CVoxelAttributeTranslator

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

Definition at line 99 of file valueattributetranslator.hh.

## CVStringAttribute

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

a vector of strings attribute

Definition at line 215 of file attributes.hh.

## PAttributeMap

typedef std::shared_ptr<CAttributeMap > PAttributeMap

another pointer-usage easy maker

Definition at line 239 of file attributes.hh.

## Enumeration Type Documentation

## E3DImageOrientation

enum 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

enum 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 163 of file orientation.hh.

## Function Documentation

## add_attribute()

template<typename T>

void EXPORT_CORE add_attribute | ( | CAttributeMap & | attributes,
|  | const std::string & | key,
|  | T | value )

convenience function to set an attribute in an attribute map:

Remarks
  review its use

Template Parameters

  type | of the attribute value to be added

Parameters

  attributes | map to set the value in
  key |
  value |

Definition at line 489 of file attributes.hh.

References cvdebug(), and EXPORT_CORE.

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

  T | target type

Parameters

  attr | attribute to be read

Definition at line 162 of file attributes.hh.

References EXPORT_CORE.

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

References EXPORT_3D.

## 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] | lhs | left input vector field and output
  [in] | rhs | right input vector field and output

Returns
  lhs after processing

References EXPORT_3D.

## operator<<() [1/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 205 of file orientation.hh.

References C3DOrientationAndPosition::print().

## operator<<() [2/4]

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

Facility to write an attribute map to a stream.

Parameters

  os | output stream
  data | map of values

Returns
  a reference to the output stream

References EXPORT_CORE.

## operator<<() [3/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

References EXPORT_3D.

## operator<<() [4/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

References EXPORT_3D.

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

References EXPORT_CORE.

## operator>>() [1/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

References EXPORT_3D.

## operator>>() [2/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

References EXPORT_3D.

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

References EXPORT_3D.

## Variable Documentation

## P3DFVectorfield

NS_MIA_BEGIN typedef std::shared_ptr<C3DFVectorfield > P3DFVectorfield

pointer type for a 3D vector field

Definition at line 36 of file multireg.hh.