| Linderdaum Engine: VolumeSlicer Class Reference | ![]() |
#include <VolumeLib.h>
Public Member Functions | |
| VolumeSlicer (int W, int H, int D, int bpp) | |
| void | SetInStream (InStream *is) |
| VolumeSlice * | GetZSlicePtr (int Z) |
| int | GetBPP () const |
| int | GetWidth () const |
| int | GetHeight () const |
| int | GetDepth () const |
| virtual | ~VolumeSlicer () |
Private Member Functions | |
| VolumeSlice * | GetSliceByCoord (int Z) |
Private Attributes | |
| InStream * | input |
| input stream, if needed | |
| int | Width |
| parameters of the source array | |
| int | Depth |
| int | Height |
| int | BPP |
| VolumeSlice * | ZeroSlice |
| 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 | |
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
Default iterator's constructor Assigns volume parameters and allocates space for slice cache
| VolumeSlicer::~VolumeSlicer | ( | ) | [virtual] |
Deletes slice cache and proxy zero slice
| 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
int VolumeSlicer::BPP [private] |
int VolumeSlicer::currentSliceInCache [private] |
index of the currently used slice in cache
int VolumeSlicer::Depth [private] |
int VolumeSlicer::Height [private] |
InStream* VolumeSlicer::input [private] |
input stream, if needed
int VolumeSlicer::sliceCoords[10] [private] |
VolumeSlice VolumeSlicer::slices[10] [private] |
int VolumeSlicer::Width [private] |
parameters of the source array
VolumeSlice* VolumeSlicer::ZeroSlice [private] |
empty slice used to prevent boundary checking in inner cycles