Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkOoCVolume Class Reference

mitkOoCVolume - a concrete data object to represent a out-of-core multi-dimensional medical image dataset More...

#include <mitkOoCVolume.h>

Inherits mitkVolume.

Inheritance diagram for mitkOoCVolume:

Inheritance graph
[legend]
Collaboration diagram for mitkOoCVolume:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void PrintSelf (ostream &os)
 mitkOoCVolume ()
virtual int GetDataObjectType () const
virtual void const * GetData () const
virtual void * GetData ()
virtual void FreezeSlice (int sliceIdx)
virtual void UnFreezeSlice (int sliceIdx)
virtual void const * GetSliceForRead (int sliceIdx)
virtual void * GetSliceForWrite (int sliceIdx)
virtual void * GetSliceForReadWrite (int sliceIdx)
virtual bool ReadSliceData (int sliceIdx, void *dst)
virtual bool ReadYZSliceData (int xIdx, void *dst)
virtual bool ReadXZSliceData (int yIdx, void *dst)
virtual bool GetArbitrarySlice (int w, int h, double o[3], double ux[3], double uy[3], void *dst)
virtual bool WriteSliceData (int sliceIdx, void const *src)
virtual bool ReadSubVolume (int x, int y, int z, int w, int h, int d, int &tw, int &th, int &td, void *dst)
virtual bool WriteSubVolume (int x, int y, int z, int w, int h, int d, int &tw, int &th, int &td, void const *src)
virtual bool Allocate ()
virtual unsigned long long GetActualMemorySize () const
virtual void Initialize ()
virtual void ShallowCopy (mitkDataObject *src)
virtual void DeepCopy (mitkDataObject *src)
void SetSliceDataModified (int sliceIdx, bool modified=true)
void SetMemoryBufferSize (size_type s)
void SetBufferedSliceNum (unsigned int n)
unsigned int GetBufferedSliceNum ()
void SetPathOfDiskBuffer (char const *path)
char const * GetPathOfDiskBuffer ()
void SetNamePrefix (char const *prefix)
char const * GetNamePrefix ()
void SetKeepCacheFiles (bool keep=true)

Detailed Description

mitkOoCVolume - a concrete data object to represent a out-of-core multi-dimensional medical image dataset

mitkOoCVolume is a concrete data object to represent a out-of-core multi-dimensional medical image dataset.


Constructor & Destructor Documentation

mitkOoCVolume::mitkOoCVolume  ) 
 

Default constructor.


Member Function Documentation

virtual bool mitkOoCVolume::Allocate  )  [virtual]
 

Generate the buffer for the volume data on disk and allocate necessary space in memory for holding the buffered image data. The previous allocated data will be deleted if exists.

Returns:
Return true if successful, otherwise return false.

Implements mitkVolume.

virtual void mitkOoCVolume::DeepCopy mitkDataObject src  )  [virtual]
 

Warning:
Don't call this function directly.

Reimplemented from mitkVolume.

virtual void mitkOoCVolume::FreezeSlice int  sliceIdx  )  [virtual]
 

Lock the physical memory containing sliceIdx'th slice data. (only useful for out-of-core volume data (mitkOoCVolume) to avoid swapping some slice data from memory buffer to disk buffer, i.e. to keep the returned pointer of some 'Get' functions, such as GetSliceData(), GetSliceForRead() and so on, always be valid until call UnFreezeSlice().

Parameters:
sliceIdx the index of the slice to freeze.

Reimplemented from mitkVolume.

virtual unsigned long long mitkOoCVolume::GetActualMemorySize  )  const [virtual]
 

Return the actual memory size occupied by the buffered volume data. The unit is BYTE.

Returns:
Return the actual memory size occupied by this volume. The unit is BYTE.

Implements mitkDataObject.

virtual bool mitkOoCVolume::GetArbitrarySlice int  w,
int  h,
double  o[3],
double  ux[3],
double  uy[3],
void *  dst
[virtual]
 

Get arbitrary directional slice from the volume to a specified memory buffer (i.e. re-slicing).

Parameters:
w width of the new slice (in pixels)
h height of the new slice (in pixels)
o start position (left-bottom) of the new slice in the volume space
ux the step (in pixels) vector of moving to the next pixel along the x-direction of the new slice in the volume space
uy the step (in pixels) vector of moving to the next pixel along the y-direction of the new slice in the volume space
dst the pointer to the destination memory buffer
Returns:
Return true if successful, otherwise return false.
Note:
The size of destination memory buffer should be w * h * GetChannelNum() * GetDataTypeSize().

Implements mitkVolume.

unsigned int mitkOoCVolume::GetBufferedSliceNum  )  [inline]
 

Get the number of buffered slice in memory.

Returns:
Return the number of buffered slice.

virtual void* mitkOoCVolume::GetData  )  [inline, virtual]
 

You can not get a permanent pointer to the entire volume data since it can not be loaded to the main memory all together, so do not call this function when using a mitkOoCVolume object, and it will always return NULL.

Returns:
Return NULL.
Warning:
Do not call this function to get volume data. Use GetSliceData() or ReadSliceData() instead.

Implements mitkVolume.

virtual void const* mitkOoCVolume::GetData  )  const [inline, virtual]
 

You can not get a permanent pointer to the entire volume data since it can not be loaded to the main memory all together, so do not call this function when using a mitkOoCVolume object, and it will always return NULL.

Returns:
Return NULL.
Warning:
Do not call this function to get volume data. Use GetSliceData() or ReadSliceData() instead.

Implements mitkVolume.

virtual int mitkOoCVolume::GetDataObjectType  )  const [inline, virtual]
 

Return the data object type.

Returns:
Always return MITK_OUT_OF_CORE_VOLUME

Reimplemented from mitkVolume.

char const* mitkOoCVolume::GetNamePrefix  ) 
 

Get the name prefix of the volume cache files. For quick restore of an out-of-core volume.

Returns:
Return the name prefix

char const* mitkOoCVolume::GetPathOfDiskBuffer  ) 
 

Get the full path of the disk buffer which contains all the slices of the volume.

Returns:
Return the full path of the disk buffer.

virtual void const* mitkOoCVolume::GetSliceForRead int  sliceIdx  )  [virtual]
 

Get data pointer of a specified slice in the volume (for read only).

Parameters:
sliceIdx the index of the slice to get (in [0, GetImageNum()-1])
Returns:
Return a const void pointer to data.
Note:
The returned type is void const *, it must be converted to some useful data type according to the return value of GetDataType().
Warning:
The memory is deleted by destructor automatically, so clients shouldn't delete the pointer returned by this function. The returned value is not a permanently valid pointer. After the next call of this function, the previous returned pointer could be invalid or point to another slice. Use this function carefully.

Implements mitkVolume.

virtual void* mitkOoCVolume::GetSliceForReadWrite int  sliceIdx  )  [virtual]
 

Get data pointer of a specified slice in the volume (for read & write).

Parameters:
sliceIdx the index of the slice to get (in [0, GetImageNum()-1])
Returns:
Return a const void pointer to data.
Note:
The returned type is void *, it must be converted to some useful data type according to the return value of GetDataType().
Warning:
The memory is deleted by destructor automatically, so clients shouldn't delete the pointer returned by this function. The returned value is not a permanently valid pointer. After the next call of this function, the previous returned pointer could be invalid or point to another slice. Use this function carefully.

Implements mitkVolume.

virtual void* mitkOoCVolume::GetSliceForWrite int  sliceIdx  )  [virtual]
 

Get data pointer of a specified slice in the volume (for write only).

Parameters:
sliceIdx the index of the slice to get (in [0, GetImageNum()-1])
Returns:
Return a const void pointer to data.
Note:
The returned type is void *, it should be converted to some useful data type according to the return value of GetDataType(). This function returns an empty buffer for writing the specified slice at FIRST time, and it will not load any data from the disk buffer even if the specified slice has already contained data in the disk buffer, so don't use it if you really want GetSliceForReadWrite().
Warning:
The memory is deleted by destructor automatically, so clients shouldn't delete the pointer returned by this function. The returned value is not a permanently valid pointer. After the next call of this function, the previous returned pointer could be invalid or point to another slice. Use this function carefully.

Implements mitkVolume.

virtual void mitkOoCVolume::Initialize  )  [virtual]
 

Delete the allocated memory (if any) and initialize to default status.

Reimplemented from mitkVolume.

virtual void mitkOoCVolume::PrintSelf ostream &  os  )  [virtual]
 

Print the necessary information about this object for the debugging purpose.

Parameters:
os The specified ostream to output information.

Reimplemented from mitkVolume.

virtual bool mitkOoCVolume::ReadSliceData int  sliceIdx,
void *  dst
[virtual]
 

Copy slice data from the volume to a specified memory buffer.

Parameters:
sliceIdx the index of the slice to read (in [0, GetImageNum()-1])
dst the pointer to the destination memory buffer
Returns:
Return true if successful, otherwise return false.
Note:
The size of destination memory buffer should be GetWidth() * GetHeight() * GetChannelNum() * GetDataTypeSize().

Implements mitkVolume.

virtual bool mitkOoCVolume::ReadSubVolume int  x,
int  y,
int  z,
int  w,
int  h,
int  d,
int &  tw,
int &  th,
int &  td,
void *  dst
[virtual]
 

Copy a sub-volume (start position = (x, y, z), size = w * h * d) from the volume to a specified memory buffer.

Parameters:
x the x-coordinate of the start point
y the y-coordinate of the start point
z the z-coordinate of the start point
w the width of the sub-volume
h the height of the sub-volume
d the depth of the sub-volume
tw return the true width of the sub-volume copied (in case that x+w > GetWidth())
th return the true height of the sub-volume copied (in case that y+h > GetHeight())
td return the true depth of the sub-volume copied (in case that z+d > GetSliceNum())
dst the pointer to the destination memory buffer
Returns:
Return true if successful, otherwise return false.
Note:
The size of destination memory buffer should be w * h * d * GetChannelNum() * GetDataTypeSize().

Implements mitkVolume.

virtual bool mitkOoCVolume::ReadXZSliceData int  yIdx,
void *  dst
[virtual]
 

Copy y-directional slice from the volume to a specified memory buffer.

Parameters:
yIdx the position of the y-directional slice to read (in [0, GetHeight()-1])
dst the pointer to the destination memory buffer
Returns:
Return true if successful, otherwise return false.
Note:
The size of destination memory buffer should be GetWidth() * GetImageNum() * GetChannelNum() * GetDataTypeSize().

Implements mitkVolume.

virtual bool mitkOoCVolume::ReadYZSliceData int  xIdx,
void *  dst
[virtual]
 

Copy x-directional slice from the volume to a specified memory buffer.

Parameters:
xIdx the position of the x-directional slice to read (in [0, GetWidth()-1])
dst the pointer to the destination memory buffer
Returns:
Return true if successful, otherwise return false.
Note:
The size of destination memory buffer should be GetHeight() * GetImageNum() * GetChannelNum() * GetDataTypeSize().

Implements mitkVolume.

void mitkOoCVolume::SetBufferedSliceNum unsigned int  n  ) 
 

Set the number of buffered slice in memory.

Parameters:
n the number of buffered slice
Note:
When calling this function, the buffer size is also calculated by (slice size) * (slice number), so it is unnecessary to call SetMemoryBufferSize() again.

void mitkOoCVolume::SetKeepCacheFiles bool  keep = true  )  [inline]
 

Set whether or not to keep the cache files. To set it to true for quick restore of an out-of-core volume.

Parameters:
keep true for keep, false for delete

void mitkOoCVolume::SetMemoryBufferSize size_type  s  ) 
 

Set the size of the memory buffer for containing cached slices.

Parameters:
s the size of the buffer in bytes
Note:
When calling this function, the number of buffered slice is also calculated by (buffer size) / (slice size), so it is unnecessary to call SetBufferedSliceNum() again.

void mitkOoCVolume::SetNamePrefix char const *  prefix  ) 
 

Set the name prefix of the volume cache files. For quick restore of an out-of-core volume.

Parameters:
prefix the name prefix to be set

void mitkOoCVolume::SetPathOfDiskBuffer char const *  path  ) 
 

Set the full path of the disk buffer to contain all the slices of the volume.

Parameters:
path the full path of the disk buffer

void mitkOoCVolume::SetSliceDataModified int  sliceIdx,
bool  modified = true
 

Set the modified flag of the sliceIdx'th slice.

Parameters:
sliceIdx the index of the slice to set
modified whether the slice data is modified
Note:
Call this function to ensure the specified slice written back to disk, when you use GetSliceData() to get the pointer to a slice data and change its content subsequently.

virtual void mitkOoCVolume::ShallowCopy mitkDataObject src  )  [virtual]
 

Warning:
Don't call this function directly.

Reimplemented from mitkVolume.

virtual void mitkOoCVolume::UnFreezeSlice int  sliceIdx  )  [virtual]
 

Unlock the physical memory containing sliceIdx'th slice data.

Parameters:
sliceIdx the index of the slice to un-freeze.
See also:
FreezeSlice()

Reimplemented from mitkVolume.

virtual bool mitkOoCVolume::WriteSliceData int  sliceIdx,
void const *  src
[virtual]
 

Copy slice data from a specified memory buffer to the volume.

Parameters:
sliceIdx the index of the slice to write (in [0, GetImageNum()-1])
src the pointer to the source memory buffer
Returns:
Return true if successful, otherwise return false.
Note:
The size of source memory buffer should be GetWidth() * GetHeight() * GetChannelNum() * GetDataTypeSize().

Implements mitkVolume.

virtual bool mitkOoCVolume::WriteSubVolume int  x,
int  y,
int  z,
int  w,
int  h,
int  d,
int &  tw,
int &  th,
int &  td,
void const *  src
[virtual]
 

Copy a sub-volume (start position = (x, y, z), size = w * h * d) from a specified memory buffer to the volume.

Parameters:
x the x-coordinate of the start point
y the y-coordinate of the start point
z the z-coordinate of the start point
w the width of the sub-volume
h the height of the sub-volume
d the depth of the sub-volume
tw return the true width of the sub-volume copied (in case that x+w > GetWidth())
th return the true height of the sub-volume copied (in case that y+h > GetHeight())
td return the true depth of the sub-volume copied (in case that z+d > GetSliceNum())
src the pointer to the source memory buffer
Returns:
Return true if successful, otherwise return false.
Note:
The size of source memory buffer should be w * h * d * GetChannelNum() * GetDataTypeSize().

Implements mitkVolume.


The documentation for this class was generated from the following file:
Generated on Tue Feb 25 15:04:26 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3