Fraxinus  17.12-rc3
An IGT application
MetaImage< T > Class Template Reference

#include <metaimage.hpp>

Public Member Functions

 MetaImage ()
 
 ~MetaImage ()
 
int getXSize () const
 
int getYSize () const
 
double getXSpacing () const
 
double getYSpacing () const
 
int makehash (const int x, const int y) const
 
T * getPixelPointer ()
 
const T * getPixelPointer () const
 
void toImgCoords (double &x, double &y, const double p[3]) const
 
Matrix4 getTransform ()
 
const Matrix4getTransform () const
 
template<typename Dt >
void regionGrow (vector< Dt > &ret, int imgx, int imgy) const
 
void setIdx (int i)
 
int getIdx () const
 
bool inImage (double img_x, double img_y) const
 

Static Public Member Functions

static vector< MetaImage > * readImages (const string &prefix)
 

Detailed Description

template<typename T>
class MetaImage< T >

A class to represent a MetaImage. This includes reading it and knowing its position in space. Region growing is also done by this class

Definition at line 15 of file metaimage.hpp.

Constructor & Destructor Documentation

template<typename T>
MetaImage< T >::MetaImage ( )
inline

Constructor. Initialize everything to zero

Definition at line 20 of file metaimage.hpp.

template<typename T>
MetaImage< T >::~MetaImage ( )
inline

Definition at line 31 of file metaimage.hpp.

Member Function Documentation

template<typename T>
int MetaImage< T >::getIdx ( ) const
inline

Get the index of this image

Returns
the index of this image

Definition at line 243 of file metaimage.hpp.

template<typename T>
T* MetaImage< T >::getPixelPointer ( )
inline
Returns
the pointer to the pixel data

Definition at line 84 of file metaimage.hpp.

template<typename T>
const T* MetaImage< T >::getPixelPointer ( ) const
inline
Returns
the pointer to the pixel data

Definition at line 93 of file metaimage.hpp.

template<typename T>
Matrix4 MetaImage< T >::getTransform ( )
inline

Get the transformation matrix for this image

Returns
the transformation matrix
See also
setTransform

Definition at line 147 of file metaimage.hpp.

template<typename T>
const Matrix4& MetaImage< T >::getTransform ( ) const
inline

Get the transformation matrix for this image

Returns
the transformation matrix
See also
setTransform

Definition at line 158 of file metaimage.hpp.

template<typename T>
int MetaImage< T >::getXSize ( ) const
inline
Returns
the xsize in pixels

Definition at line 40 of file metaimage.hpp.

template<typename T>
double MetaImage< T >::getXSpacing ( ) const
inline
Returns
the pixel spacing in x direction

Definition at line 57 of file metaimage.hpp.

template<typename T>
int MetaImage< T >::getYSize ( ) const
inline
Returns
the ysize in pixels

Definition at line 48 of file metaimage.hpp.

template<typename T>
double MetaImage< T >::getYSpacing ( ) const
inline
Returns
the pixel spacing in y direction

Definition at line 65 of file metaimage.hpp.

template<typename T>
bool MetaImage< T >::inImage ( double  img_x,
double  img_y 
) const
inline

Test if a point is inside this image

Parameters
img_xx coordinate (pixel space)
img_yy coordinate (pixel space)
Returns
true if point is inside the image, false otherwise

Definition at line 363 of file metaimage.hpp.

template<typename T>
int MetaImage< T >::makehash ( const int  x,
const int  y 
) const
inline

Map a pixel position to an integer

Returns
an unique integer for the position x,y

Definition at line 74 of file metaimage.hpp.

template<typename T>
static vector<MetaImage>* MetaImage< T >::readImages ( const string &  prefix)
inlinestatic

Factory function to get a bunch of images by reading them from disk.

Parameters
prefixThe prefix of the file name. File names are assumed to be of the format prefix$NUMBER.mhd
Returns
a vector containing the retrieved images

Definition at line 254 of file metaimage.hpp.

template<typename T>
template<typename Dt >
void MetaImage< T >::regionGrow ( vector< Dt > &  ret,
int  imgx,
int  imgy 
) const
inline

Perform region growing on this image The Dt parameter specifies the data type of the return data (typically double)

Parameters
retThe vector in which to store the points found
imgxThe seed point (in pixel coordinates), X coordinate
imgyThe seed point (in pixel coordinates), Y coordinate

Definition at line 171 of file metaimage.hpp.

template<typename T>
void MetaImage< T >::setIdx ( int  i)
inline

Set the index of this image

Parameters
iIndex to set

Definition at line 233 of file metaimage.hpp.

template<typename T>
void MetaImage< T >::toImgCoords ( double &  x,
double &  y,
const double  p[3] 
) const
inline

Transform a point to from world coordinates to pixel coordinates

Parameters
xThe x coordinate is returned here
yThe y coordinate is returned here
pThe point to transform

Definition at line 105 of file metaimage.hpp.


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