kn::Image3D< T > Class Template Reference

Container for images 3D This class represent any generic image 3D for any size, and basic type and any nb of channels. More...

#include <Image3D.hpp>

Collaboration diagram for kn::Image3D< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Image3D ()
 Constructor to build a 0 size image 3D.
 Image3D (const size_t width, const size_t height, const size_t depth, const size_t nbChannel, T *buffer=0)
 Constructor to build an allocated empty image 3D or an image 3D from a raw data buffer.
 Image3D (const Image3D< T > &i)
 Copy Constructor.
virtual ~Image3D ()
 dealoccates image 3D data
virtual T * begin () const
 getting the raw data of the image
virtual T * end () const
 getting the end of raw data of the image
virtual size_t width () const
 getting the width of the image
virtual size_t height () const
 getting the height of the image
virtual size_t depth () const
 getting the depth of the image
virtual size_t nbChannel () const
 getting the nb of channel of the image
virtual size_t size () const
 getting the total size of the image
virtual T * operator() (const unsigned int x, const unsigned int y, const unsigned int z) const
 get pointer on the asked pixel
virtual T * at (const unsigned int x, const unsigned int y, const unsigned int z) const
 get pointer on the asked pixel (with bounds checking).
virtual T & operator() (const unsigned int x, const unsigned int y, const unsigned int z, const unsigned int channel)
 get component value of the asked pixel
virtual T & at (const unsigned int x, const unsigned int y, const unsigned int z, const unsigned int channel)
 get component value of the asked pixel (with bounds checking).
virtual const T & operator() (const unsigned int x, const unsigned int y, const unsigned int z, const unsigned int channel) const
 get component value of the asked pixel
virtual const T & at (const unsigned int x, const unsigned int y, const unsigned int z, const unsigned int channel) const
 get component value of the asked pixel (with bounds checking) This function behaves the same than the operator() but checks if indices are valid respect to the size of
virtual Image3D< T > & operator= (const Image3D &i)
 copy on this image the content of another if they have the same resolution and nb channel; if the calling image have width = height = depth = 0, this function create the adequat memory, else throws an exception.
void fill (const T &value)
 fill all the voxels component to the parameter value
void setFrame (unsigned int index, Image< T > &frame)
 fill all the voxels of a given frame with the values of a given image
void getFrame (unsigned int index, Image< T > &frame)
 fill an image with the values of a given frame

Protected Member Functions

void initRowsAndFrames ()
 allocate and initialize the rows array

Protected Attributes

T * data
 raw data of the image 3D
T ** frames
 pointers on each frame of the image 3D on the raw date
T *** rows
 pointers on each row of the image 3D on the raw date
T * begin_
 pointer on the begining of raw data
T * end_
 pointer on the end of raw data
size_t imageWidth
 width of the image
size_t imageHeight
 height of the image
size_t imageDepth
 depth of the image
size_t imageNbChannel
 nb of channel of the image
size_t imageSize
 Total size of the image (w*h*d).


Detailed Description

template<typename T>
class kn::Image3D< T >

Container for images 3D This class represent any generic image 3D for any size, and basic type and any nb of channels.

The data of the image 3D is represented as a unidimensionnal array of the basic typename. Moreover, we store the position of any row and any frame allowing a fast acces to any voxel of the image. The first row is the top row and each row is stored from left to right.

Definition at line 63 of file Image3D.hpp.


Constructor & Destructor Documentation

template<typename T >
kn::Image3D< T >::Image3D (  )  [inline]

Constructor to build a 0 size image 3D.

Definition at line 337 of file Image3D.hpp.

template<typename T >
kn::Image3D< T >::Image3D ( const size_t  width,
const size_t  height,
const size_t  depth,
const size_t  nbChannel,
T *  buffer = 0 
) [inline]

Constructor to build an allocated empty image 3D or an image 3D from a raw data buffer.

Parameters:
width width of the image 3D
height height of the image 3D
depth depth of the image 3D
nbChannel nb of channel of the image 3D
buffer optional data buffer WHICH IS NOT COPYIED

Definition at line 352 of file Image3D.hpp.

template<typename T >
kn::Image3D< T >::Image3D ( const Image3D< T > &  i  )  [inline]

Copy Constructor.

Parameters:
i Image 3D to clone

Definition at line 375 of file Image3D.hpp.

template<typename T >
kn::Image3D< T >::~Image3D (  )  [inline, virtual]

dealoccates image 3D data

Definition at line 394 of file Image3D.hpp.


Member Function Documentation

template<typename T>
virtual const T& kn::Image3D< T >::at ( const unsigned int  x,
const unsigned int  y,
const unsigned int  z,
const unsigned int  channel 
) const [inline, virtual]

get component value of the asked pixel (with bounds checking) This function behaves the same than the operator() but checks if indices are valid respect to the size of

Parameters:
x width position of the pixel
y height position of the pixel
z depth position of the pixel
channel component number
Returns:
a value of the component

Definition at line 245 of file Image3D.hpp.

template<typename T>
virtual T& kn::Image3D< T >::at ( const unsigned int  x,
const unsigned int  y,
const unsigned int  z,
const unsigned int  channel 
) [inline, virtual]

get component value of the asked pixel (with bounds checking).

Parameters:
x width position of the pixel
y height position of the pixel
z depth position of the pixel
channel component number
Returns:
a value of the component

Definition at line 217 of file Image3D.hpp.

template<typename T>
virtual T* kn::Image3D< T >::at ( const unsigned int  x,
const unsigned int  y,
const unsigned int  z 
) const [inline, virtual]

get pointer on the asked pixel (with bounds checking).

This function is the same than the operator() but checks if indices are valid.

Parameters:
x width position of the pixel
y height position of the pixel
Returns:
a buffer with the pixel

Definition at line 191 of file Image3D.hpp.

template<typename T>
virtual T* kn::Image3D< T >::begin (  )  const [inline, virtual]

getting the raw data of the image

Returns:
raw data of the image

Definition at line 123 of file Image3D.hpp.

template<typename T>
virtual size_t kn::Image3D< T >::depth (  )  const [inline, virtual]

getting the depth of the image

Returns:
the depth of the image

Definition at line 164 of file Image3D.hpp.

template<typename T>
virtual T* kn::Image3D< T >::end (  )  const [inline, virtual]

getting the end of raw data of the image

Returns:
end of raw data of the image

Definition at line 128 of file Image3D.hpp.

template<typename T>
void kn::Image3D< T >::fill ( const T &  value  )  [inline]

fill all the voxels component to the parameter value

Parameters:
value : value used to fill the image

Definition at line 262 of file Image3D.hpp.

template<typename T>
void kn::Image3D< T >::getFrame ( unsigned int  index,
Image< T > &  frame 
) [inline]

fill an image with the values of a given frame

Parameters:
index : index of the frame
frame : image which will be filled
Exceptions:
ImageException : invalid frame dimensions
ImageException : index out of bound

Definition at line 286 of file Image3D.hpp.

template<typename T>
virtual size_t kn::Image3D< T >::height (  )  const [inline, virtual]

getting the height of the image

Returns:
the height of the image

Definition at line 159 of file Image3D.hpp.

template<typename T >
void kn::Image3D< T >::initRowsAndFrames (  )  [inline, protected]

allocate and initialize the rows array

Definition at line 399 of file Image3D.hpp.

template<typename T>
virtual size_t kn::Image3D< T >::nbChannel (  )  const [inline, virtual]

getting the nb of channel of the image

Returns:
the nb of channel of the image

Definition at line 169 of file Image3D.hpp.

template<typename T>
virtual const T& kn::Image3D< T >::operator() ( const unsigned int  x,
const unsigned int  y,
const unsigned int  z,
const unsigned int  channel 
) const [inline, virtual]

get component value of the asked pixel

Parameters:
x width position of the pixel
y height position of the pixel
z depth position of the pixel
channel component number
Returns:
a value of the component

Definition at line 232 of file Image3D.hpp.

template<typename T>
virtual T& kn::Image3D< T >::operator() ( const unsigned int  x,
const unsigned int  y,
const unsigned int  z,
const unsigned int  channel 
) [inline, virtual]

get component value of the asked pixel

Parameters:
x width position of the pixel
y height position of the pixel
z depth position of the pixel
channel component number
Returns:
a value of the component

Definition at line 206 of file Image3D.hpp.

template<typename T>
virtual T* kn::Image3D< T >::operator() ( const unsigned int  x,
const unsigned int  y,
const unsigned int  z 
) const [inline, virtual]

get pointer on the asked pixel

Parameters:
x width position of the pixel
y height position of the pixel
Returns:
a buffer with the pixel

Definition at line 181 of file Image3D.hpp.

template<typename T >
Image3D< T > & kn::Image3D< T >::operator= ( const Image3D< T > &  i  )  [inline, virtual]

copy on this image the content of another if they have the same resolution and nb channel; if the calling image have width = height = depth = 0, this function create the adequat memory, else throws an exception.

Parameters:
i : source image
Exceptions:
ImageException : incompatible image size
Returns:
a reference to the destination image

Definition at line 500 of file Image3D.hpp.

template<typename T>
void kn::Image3D< T >::setFrame ( unsigned int  index,
Image< T > &  frame 
) [inline]

fill all the voxels of a given frame with the values of a given image

Parameters:
index : index of the frame
frame : image which will be used for filling
Exceptions:
ImageException : invalid frame dimensions
ImageException : index out of bound

Definition at line 272 of file Image3D.hpp.

template<typename T>
virtual size_t kn::Image3D< T >::size (  )  const [inline, virtual]

getting the total size of the image

Returns:
the total of the image

Definition at line 174 of file Image3D.hpp.

template<typename T>
virtual size_t kn::Image3D< T >::width (  )  const [inline, virtual]

getting the width of the image

Returns:
the width of the image

Definition at line 154 of file Image3D.hpp.


Member Data Documentation

template<typename T>
T* kn::Image3D< T >::begin_ [protected]

pointer on the begining of raw data

Definition at line 113 of file Image3D.hpp.

template<typename T>
T* kn::Image3D< T >::data [protected]

raw data of the image 3D

Definition at line 95 of file Image3D.hpp.

template<typename T>
T* kn::Image3D< T >::end_ [protected]

pointer on the end of raw data

Definition at line 117 of file Image3D.hpp.

template<typename T>
T** kn::Image3D< T >::frames [protected]

pointers on each frame of the image 3D on the raw date

Definition at line 100 of file Image3D.hpp.

template<typename T>
size_t kn::Image3D< T >::imageDepth [protected]

depth of the image

Definition at line 141 of file Image3D.hpp.

template<typename T>
size_t kn::Image3D< T >::imageHeight [protected]

height of the image

Definition at line 137 of file Image3D.hpp.

template<typename T>
size_t kn::Image3D< T >::imageNbChannel [protected]

nb of channel of the image

Definition at line 145 of file Image3D.hpp.

template<typename T>
size_t kn::Image3D< T >::imageSize [protected]

Total size of the image (w*h*d).

Definition at line 149 of file Image3D.hpp.

template<typename T>
size_t kn::Image3D< T >::imageWidth [protected]

width of the image

Definition at line 133 of file Image3D.hpp.

template<typename T>
T*** kn::Image3D< T >::rows [protected]

pointers on each row of the image 3D on the raw date

Definition at line 104 of file Image3D.hpp.


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

Generated on Thu Nov 12 16:06:36 2009 for OpenKraken-image by  doxygen 1.5.8