zxhproj v 2.2
zxhproj

zxhImageDataT< PixelType > Class Template Reference

: interface for the zxhImageDataT class 4D image zxhImageDataT include datavalue stored in signed short [] can not read image from file default pixel valut type is short when reading real image float/struct type image only used in interpolate spline ffd Do not have origin and orientation matrix YET More...

#include <zxhImageData.h>

List of all members.

Public Member Functions

 zxhImageDataT ()
 constract
virtual bool NewImage (int idim, const int size[], const float spacing[], const zxhImageInfo *pImageInfo)
 new a image with data store
virtual void SetDataType (zxhushort i)
virtual zxhushort GetDataType ()
virtual ~zxhImageDataT ()
virtual zxhImageDataT
< PixelType > * 
Clone (zxhImageDataT< PixelType > *&pRet)
 new an image and clone
virtual bool SetPixelByGreyscale (int x, int y, int z, int t, PixelType val)
 only for 2D/3D/4D--- without --- boundary check
virtual PixelType GetPixelGreyscaleClosest (int x, int y, int z, int t)
virtual PixelType GetPixelGreyscaleMirror (int x, int y, int z, int t)
virtual PixelType GetPixelGreyscale (int x, int y)
 only for 2D respectively in order to accelerate image,-- without --- boundary check
virtual PixelType GetPixelGreyscale (int x, int y, int z)
 only for 3D respectively in order to accelerate image,-- without --- boundary check
virtual PixelType GetPixelGreyscale (int x, int y, int z, int t)
 only for 4D respectively in order to accelerate image,-- without --- boundary check
virtual PixelType GetPixelGreyscale (float x, float y=0, float z=0, float t=0)
 only for 4D respectively in order to accelerate image,-- without --- boundary check
virtual PixelType GetPixelGreyscale (int iVector[ImageDimensionMax])
void MemCopyImageDataFrom (zxhImageDataT< PixelType > *src)
 copy image data, assuming same NumberOfPixels
virtual PixelType GetImageData (int index)
 index < number of pixels
virtual const PixelType * GetImageData ()
 only used to check whether have data
virtual void SetImageData (int index, PixelType v)
 index < number of pixels
virtual PixelType GetPixelGreyscaleMax ()
virtual PixelType GetPixelGreyscaleMin ()
virtual int GetDimension () const
 dimension
virtual void SetDimension (int i)
virtual void GetImageSize (int &sx, int &sy, int &sz, int &st)
 get image info different from 4D: size
const int * GetImageSize ()
virtual long int GetNumberOfPixels ()
virtual void GetImageSpacing (float &dx, float &dy, float &dz, float &dt)
 get image info different from 4D:spacing
const float * GetImageSpacing ()
virtual void GetImageExtent (float e[]) const
 shearing in imagetoworld matrix is ignored
virtual void GetImageExtent (float worldfrom[], float worldto[]) const
 return the start and end of extent in world coordinates
virtual void ReleaseMem ()
 Release memory of m_pImageData.
virtual void ImageGridToWorldCoordinate (float fv[ImageDimensionMax])
 change image grid in to world coordinate
virtual void WorldCoordinateToImageGrid (float fv[ImageDimensionMax])
 change world coordinate in to image grid
virtual void ImageToWorld (float fv[ImageDimensionMax]) const
 change image grid in to world coordinate
virtual void ImageToWorld (float &fx, float &fy, float &fz, float &ft) const
virtual void WorldToImage (float fv[ImageDimensionMax]) const
 change world coordinate in to image grid
virtual void WorldToImage (float &fx, float &fy, float &fz, float &ft) const
virtual void ExtentToImageSize (const float e[ImageDimensionMax], int s[ImageDimensionMax]) const
 change extent to image size for storage in memory
virtual void GetImageSizeUsingExtent (const float e[ImageDimensionMax], int s[ImageDimensionMax]) const
virtual void GetImageSizeUsingSpacing (const float sp[ImageDimensionMax], int sz[ImageDimensionMax]) const
 get new size if change to different spacing
virtual bool InsideImage (float fx, float fy, float fz, float ft)
virtual bool InsideImage (int fx, int fy, int fz, int ft)
virtual bool InsideImage (float *fgrid) const
virtual bool InsideImageWorld (const float fx, const float fy, const float fz, const float ft) const
virtual bool InsideImageWorld (const float *f) const
virtual bool ComputeGreyCentre (bool forcecompute=true)
virtual void GetGreyCentre (float &gcx, float &gcy, float &gcz, float &gct)
 image grid coordinate
virtual void SetImageOrientationInfo (const zxhImageInfo *pSource)
 copy the image orientation image and set to corresponding
virtual void GetImageOrientationInfo (zxhImageInfo &ret)
 get image info object for getting or setting info
virtual bool ImageNvoxelDimensionSame (const zxhImageDataT< PixelType > *pTest)
 only test spacing and image size, and dimension
virtual void SetExtensionFlag (int i)
virtual int GetExtensionFlag (void)
virtual short int GetImageOrient ()
virtual void SetImageOrient (short int c)
bool Is2DSlice ()
bool ExtendRoi (const int afrom[], const int ato[], bool bFillBg, PixelType vBg, float twoD2threeDsp)
 bFillBg==false, closest ; bFillBg==true, vbg;
virtual void SetImageFilename (std::string filename)
virtual std::string GetImageFilename ()
const zxhImageInfoGetImageInfo () const
virtual void GetImageInfo (zxhImageInfo *p)
 clone the image info to p (pointer to an object, not null)
virtual void SetImageInfo (zxhImageInfo *p)
virtual void SetImageTimeSpacing (float f)

Protected Attributes

PixelType * m_pImageData
 pointer to image data array
unsigned long m_iResolution
 Assistant info of the image for access acceleration, 2D slice.
unsigned long m_iVolume
 3D volume
float m_afGreyLevelCentre [ImageDimensionMax]
 grey level Centre
zxhImageInfo m_ImageInfo
short int m_iImageOrient
 for gipl
int m_iExtensionFlag
 four bytes

Detailed Description

template<class PixelType = PixelTypeDefault>
class zxhImageDataT< PixelType >

: interface for the zxhImageDataT class 4D image zxhImageDataT include datavalue stored in signed short [] can not read image from file default pixel valut type is short when reading real image float/struct type image only used in interpolate spline ffd Do not have origin and orientation matrix YET


Constructor & Destructor Documentation

template<class PixelType >
zxhImageDataT< PixelType >::~zxhImageDataT ( ) [virtual]
Returns:

Member Function Documentation

template<class PixelType >
bool zxhImageDataT< PixelType >::ComputeGreyCentre ( bool  forcecompute = true) [virtual]
Returns:
whether computing grey level Centre on image grid
template<class PixelType = PixelTypeDefault>
virtual zxhushort zxhImageDataT< PixelType >::GetDataType ( ) [inline, virtual]
Returns:
template<class PixelType = PixelTypeDefault>
virtual bool zxhImageDataT< PixelType >::InsideImage ( float  fx,
float  fy,
float  fz,
float  ft 
) [inline, virtual]
Returns:
whether the image grid coordinate is inside the image
template<class PixelType = PixelTypeDefault>
virtual bool zxhImageDataT< PixelType >::InsideImage ( int  fx,
int  fy,
int  fz,
int  ft 
) [inline, virtual]
Returns:
whether the image grid coordinate is inside the image
template<class PixelType = PixelTypeDefault>
virtual bool zxhImageDataT< PixelType >::InsideImage ( float *  fgrid) const [inline, virtual]
Returns:
whether the image grid coordinate is inside the image
template<class PixelType = PixelTypeDefault>
virtual bool zxhImageDataT< PixelType >::InsideImageWorld ( const float  fx,
const float  fy,
const float  fz,
const float  ft 
) const [inline, virtual]
Returns:
whether the physical coordinate is inside the image
template<class PixelType >
bool zxhImageDataT< PixelType >::NewImage ( int  idim,
const int  size[],
const float  spacing[],
const zxhImageInfo pImageInfo 
) [virtual]

new a image with data store

new a image with data store, and update the matrices using quatern parameters

template<class PixelType = PixelTypeDefault>
virtual void zxhImageDataT< PixelType >::SetDataType ( zxhushort  i) [inline, virtual]
Returns:
template<class PixelType = PixelTypeDefault>
virtual void zxhImageDataT< PixelType >::SetImageInfo ( zxhImageInfo p) [inline, virtual]

will clone the imageinfo -- be careful if only to set the orientation, please use Get/SetImageOrientationInfo


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs