ML Reference
ml::TImageVector< CompIntType > Class Template Reference

ImageVector is the 6D TVector specialization used by the ML for all image indexing. More...

#include <mlImageVector.h>

Inheritance diagram for ml::TImageVector< CompIntType >:
ml::TVector< TVector6DBase< CompIntType > > ml::TVector6DBase< CompIntType >

List of all members.

Public Types

typedef TVector< TVector6DBase
< CompIntType > > 
ParentClass
 Parent class of this class.
typedef ParentClass::ComponentType ComponentType
 Integer type used by this vector.

Public Member Functions

 TImageVector ()
 Constructor. All components are initialized to 0.
 TImageVector (const ParentClass &v)
 Copy constructor from Base class.
 TImageVector (const ComponentType i)
 Constructor which initializes all components to i.
template<typename T2IntType >
 TImageVector (const TImageVector< T2IntType > &v2)
 Copy constructor from another TVector of same or other integer type, values are cast.
 TImageVector (const ComponentType xp, const TImageVector< ComponentType > &p)
 Constructor which assigns X to x and copies other elements from p.
void set (const ComponentType v=0)
 Set all components to v or - if v is not specified - to 0.
void set (const ParentClass &v)
 Like assignment operator.
 TImageVector (const MLint num, const ComponentType *const arr, const ComponentType deflt)
 Constructor which initializes the vector components by copying them from arr[0] ,..., arr[num-1].
 TImageVector (const ComponentType xp, const ComponentType yp, const ComponentType zp, const ComponentType cp, const ComponentType tp, const ComponentType up)
 Constructor which initializes all components with the values x, y, z, c, t and u.
 TImageVector (const Vector6 &v6)
 Copy the six double components of v6 into x, ..., u, respectively.
void set (const ComponentType vx, const ComponentType vy, const ComponentType vz=0, const ComponentType vc=0, const ComponentType vt=0, const ComponentType vu=0)
 Set vector to (vx, vy, vz, vc, vt, vu). Not passed components are set to 0.
void get (ComponentType *const xp=NULL, ComponentType *const yp=NULL, ComponentType *const zp=NULL, ComponentType *const cp=NULL, ComponentType *const tp=NULL, ComponentType *const up=NULL) const
 Return the subset of those Vector components whose corresponding pointers are not NULL.
bool iterate (const TImageVector< ComponentType > &ext)
 Coordinate incrementation/iterator function inside ext.
Vector6 toVector6 () const
 Get vector contents as Vector6.
Deprecated
Vector6 getVec6 () const

Static Public Member Functions

Properties of an image of the ML.
static MLint dim ()
 Returns dimension the ML calculates with.

Detailed Description

template<typename CompIntType = MLint>
class ml::TImageVector< CompIntType >

ImageVector is the 6D TVector specialization used by the ML for all image indexing.

It uses MLint as default for CompIntType and TVector6DBase<CompIntType> as container type for specialized access to array member with x,y,z,c,t, and u.

In contrast to the base class TVector the members are specialized to MLMaxImageDimension dimensions to implement dedicated functionality for ML images. This class can also be instantiated with arguments or other CompIntType arguments to compile with an arbitrary integer base type.

Example for vector initialization:

       ImageVector p;
       p.x=1; p.y=2; p.z=3; p.c=4; p.t=5; p.u=6;
      // or
       ImageVector p;
       p[0]=3; p[1]=5; p[2]=7; p[3]=9; p[4]=11; p[5]=13;
      // or
       ImageVector p;
       p.set(3, 5, 7, 9, 11, 13);
      // or
       ImageVector q(4, p);
      // or
       p = ImageVector(1,2,3,4,5,6);
      // or
       ImageVector p(1,2,3,4,5,6);

Notes:

  • operator= can safely be used although not implemented explicitly.
  • This class is used to describe points, coordinates and subimage regions easily, in a uniform manner and independent of the exact number of supported dimensions.
  • All coordinate components are explicitly public and may used so without limitation of class functionality.
  • Even method parameters are implemented as "const" to give compilers maximum information to optimize.
  • In most methods this class is not traced nor ML_TRY/CATCH mechanisms are used, because:
  • it is heavily used in time critical positions for all image processing aspects in ML modules.
  • it should be possible to detect/debug errors easily on next higher function which then should be traced/try/caught.

Definition at line 132 of file mlImageVector.h.


Member Typedef Documentation

template<typename CompIntType = MLint>
typedef ParentClass::ComponentType ml::TImageVector< CompIntType >::ComponentType

Integer type used by this vector.

Reimplemented from ml::TVector< TVector6DBase< CompIntType > >.

Definition at line 139 of file mlImageVector.h.

template<typename CompIntType = MLint>
typedef TVector<TVector6DBase<CompIntType> > ml::TImageVector< CompIntType >::ParentClass

Parent class of this class.

Reimplemented from ml::TVector< TVector6DBase< CompIntType > >.

Definition at line 136 of file mlImageVector.h.


Constructor & Destructor Documentation

template<typename CompIntType = MLint>
ml::TImageVector< CompIntType >::TImageVector ( ) [inline]

Constructor. All components are initialized to 0.

Definition at line 151 of file mlImageVector.h.

template<typename CompIntType = MLint>
ml::TImageVector< CompIntType >::TImageVector ( const ParentClass v) [inline]

Copy constructor from Base class.

This allows the usage of the ParentClass objects of the same ComponentType in operators using the TImageVector.

Definition at line 155 of file mlImageVector.h.

template<typename CompIntType = MLint>
ml::TImageVector< CompIntType >::TImageVector ( const ComponentType  i) [inline, explicit]

Constructor which initializes all components to i.

Definition at line 158 of file mlImageVector.h.

template<typename CompIntType = MLint>
template<typename T2IntType >
ml::TImageVector< CompIntType >::TImageVector ( const TImageVector< T2IntType > &  v2) [inline, explicit]

Copy constructor from another TVector of same or other integer type, values are cast.

Only valid elements are copied if vectors have different lengths.

Definition at line 163 of file mlImageVector.h.

template<typename CompIntType = MLint>
ml::TImageVector< CompIntType >::TImageVector ( const ComponentType  xp,
const TImageVector< ComponentType > &  p 
) [inline]

Constructor which assigns X to x and copies other elements from p.

Definition at line 166 of file mlImageVector.h.

template<typename CompIntType = MLint>
ml::TImageVector< CompIntType >::TImageVector ( const MLint  num,
const ComponentType *const  arr,
const ComponentType  deflt 
) [inline]

Constructor which initializes the vector components by copying them from arr[0] ,..., arr[num-1].

All other elements are initialized to the value deflt. arr must have at least num elements.

Definition at line 177 of file mlImageVector.h.

template<typename CompIntType = MLint>
ml::TImageVector< CompIntType >::TImageVector ( const ComponentType  xp,
const ComponentType  yp,
const ComponentType  zp,
const ComponentType  cp,
const ComponentType  tp,
const ComponentType  up 
) [inline]

Constructor which initializes all components with the values x, y, z, c, t and u.

Definition at line 182 of file mlImageVector.h.

template<typename CompIntType = MLint>
ml::TImageVector< CompIntType >::TImageVector ( const Vector6 v6) [inline, explicit]

Copy the six double components of v6 into x, ..., u, respectively.

A simple cast is performed to convert the doubles to the ComponentType type.

Definition at line 196 of file mlImageVector.h.


Member Function Documentation

template<typename CompIntType = MLint>
static MLint ml::TImageVector< CompIntType >::dim ( ) [inline, static]

Returns dimension the ML calculates with.

Definition at line 146 of file mlImageVector.h.

template<typename CompIntType = MLint>
void ml::TImageVector< CompIntType >::get ( ComponentType *const  xp = NULL,
ComponentType *const  yp = NULL,
ComponentType *const  zp = NULL,
ComponentType *const  cp = NULL,
ComponentType *const  tp = NULL,
ComponentType *const  up = NULL 
) const [inline]

Return the subset of those Vector components whose corresponding pointers are not NULL.

Definition at line 221 of file mlImageVector.h.

template<typename CompIntType = MLint>
Vector6 ml::TImageVector< CompIntType >::getVec6 ( ) const [inline]
Deprecated:
Use toVector6 instead.

Definition at line 287 of file mlImageVector.h.

template<typename CompIntType = MLint>
bool ml::TImageVector< CompIntType >::iterate ( const TImageVector< ComponentType > &  ext) [inline]

Coordinate incrementation/iterator function inside ext.

Increment x by 1 until it overflows in x (limited by ext). On overflow x is set to 0 and y is incremented by 1 etc. If *this == ext is reached after incrementation then the vector is reset to (0,0,0,0,0,0) and true is returned, otherwise false. Note: Function works sensible only if *this is inside [(0,0,0,0,0,0), (ext.x, ... ,ext.u)[ and if &ext if != this.

Definition at line 244 of file mlImageVector.h.

template<typename CompIntType = MLint>
void ml::TImageVector< CompIntType >::set ( const ComponentType  v = 0) [inline]

Set all components to v or - if v is not specified - to 0.

Reimplemented from ml::TVector< TVector6DBase< CompIntType > >.

Definition at line 169 of file mlImageVector.h.

Referenced by ml::TSubImage< DATATYPE >::calculateMinMax().

template<typename CompIntType = MLint>
void ml::TImageVector< CompIntType >::set ( const ComponentType  vx,
const ComponentType  vy,
const ComponentType  vz = 0,
const ComponentType  vc = 0,
const ComponentType  vt = 0,
const ComponentType  vu = 0 
) [inline]

Set vector to (vx, vy, vz, vc, vt, vu). Not passed components are set to 0.

Definition at line 208 of file mlImageVector.h.

template<typename CompIntType = MLint>
void ml::TImageVector< CompIntType >::set ( const ParentClass v) [inline]

Like assignment operator.

Definition at line 172 of file mlImageVector.h.

template<typename CompIntType = MLint>
Vector6 ml::TImageVector< CompIntType >::toVector6 ( ) const [inline]

Get vector contents as Vector6.

Definition at line 270 of file mlImageVector.h.


The documentation for this class was generated from the following file: