Linderdaum Engine: VolumeSlicer Class Reference
Updated: Mon May 14 2012 05:02:41
VolumeSlicer Class Reference

#include <VolumeLib.h>

List of all members.

Public Member Functions

 VolumeSlicer (int W, int H, int D, int bpp)
void SetInStream (InStream *is)
VolumeSliceGetZSlicePtr (int Z)
int GetBPP () const
int GetWidth () const
int GetHeight () const
int GetDepth () const
virtual ~VolumeSlicer ()

Private Member Functions

VolumeSliceGetSliceByCoord (int Z)

Private Attributes

InStreaminput
 input stream, if needed
int Width
 parameters of the source array
int Depth
int Height
int BPP
VolumeSliceZeroSlice
 empty slice used to prevent boundary checking in inner cycles
int sliceCoords [10]
VolumeSlice slices [10]
int currentSliceInCache
 index of the currently used slice in cache

Detailed Description

Abstract interface for volume reading At the moment only linear (slice-byt-slice) volume layout is supported. Later the fundamental GetSlicePtr() routing can hide any possible layout from the end-user


Constructor & Destructor Documentation

VolumeSlicer::VolumeSlicer ( int  W,
int  H,
int  D,
int  bpp 
) [inline]

Default iterator's constructor Assigns volume parameters and allocates space for slice cache

VolumeSlicer::~VolumeSlicer ( ) [virtual]

Deletes slice cache and proxy zero slice


Member Function Documentation

int VolumeSlicer::GetBPP ( ) const [inline]

Get source volume bytes per pixel

int VolumeSlicer::GetDepth ( ) const [inline]

Get source volume depth

int VolumeSlicer::GetHeight ( ) const [inline]

Get source volume height

VolumeSlice * VolumeSlicer::GetSliceByCoord ( int  Z) [private]

Direct access to the data, unsafe and used internally Z should be in [0..D-1] range This function copies/read the data from actual source to slice cache

int VolumeSlicer::GetWidth ( ) const [inline]

Get source volume width

VolumeSlice * VolumeSlicer::GetZSlicePtr ( int  Z)

Fundamental operation wich hides the global layout of the volume providing user a simple interface to access each slice

This method also checks if Z is out of [0..D-1] range. If Z is out of volume then the 'proxy' zero-filled slice is returned

Also it maintains the cache of accessed slices to avoid unneccessary extraction of data If the Z value was used it is found in the sliceCoords[] array and SlicePtr is extracted from slices[] array. The cache is a fixe array of size MAX_SLICES_IN_ITERATION (currently 10, so no filter with z-size of the kernel more than 10 is possible)

Using the 'proxy' zero slice helps to avoid boundary checking in inner cycles

void VolumeSlicer::SetInStream ( InStream is) [inline]

Assigns input stream If the volume is stored in multiple files then this method might not be used


Member Data Documentation

index of the currently used slice in cache

input stream, if needed

parameters of the source array

empty slice used to prevent boundary checking in inner cycles


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