#include <ImageRegion.h>
Public Member Functions | |
int | BeginT () const |
Get start of image region to iterate over in t dimension. | |
int | BeginX () const |
Get start of image region to iterate over in x dimension. | |
int | BeginY () const |
Get start of image region to iterate over in y dimension. | |
int | BeginZ () const |
Get start of image region to iterate over in z dimension. | |
int | ColumnStride () const |
Get stride between columns in number of voxels. | |
int | EndT () const |
Get end of image region to iterate over in t dimension. | |
int | EndX () const |
Get end of image region to iterate over in x dimension. | |
int | EndY () const |
Get end of image region to iterate over in y dimension. | |
int | EndZ () const |
Get end of image region to iterate over in z dimension. | |
int | FrameStride () const |
Get stride between frames in number of voxels. | |
template<class VoxelType > | |
const VoxelType * | GetPointerToBegin (const BaseImage &) const |
Get raw image pointer to first voxel of of region. | |
template<class VoxelType > | |
const VoxelType * | GetPointerToBegin (const BaseImage *) const |
Get raw image pointer to first voxel of of region. | |
template<class VoxelType > | |
const VoxelType * | GetPointerToBegin (const GenericImage< VoxelType > &) const |
Get raw image pointer to first voxel of of region. | |
template<class VoxelType > | |
VoxelType * | GetPointerToBegin (GenericImage< VoxelType > &) const |
Get raw image pointer to first voxel of of region. | |
template<class VoxelType > | |
const VoxelType * | GetPointerToBegin (const GenericImage< VoxelType > *) const |
Get raw image pointer to first voxel of of region. | |
template<class VoxelType > | |
VoxelType * | GetPointerToBegin (GenericImage< VoxelType > *) const |
Get raw image pointer to first voxel of of region. | |
template<class VoxelType > | |
const VoxelType * | GetPointerToEnd (const BaseImage &) const |
Get raw image pointer to last voxel image of region. | |
template<class VoxelType > | |
const VoxelType * | GetPointerToEnd (const BaseImage *) const |
Get raw image pointer to last voxel image of region. | |
template<class VoxelType > | |
const VoxelType * | GetPointerToEnd (const GenericImage< VoxelType > &) const |
Get raw image pointer to last voxel image of region. | |
template<class VoxelType > | |
VoxelType * | GetPointerToEnd (GenericImage< VoxelType > &) const |
Get raw image pointer to last voxel image of region. | |
template<class VoxelType > | |
const VoxelType * | GetPointerToEnd (const GenericImage< VoxelType > *) const |
Get raw image pointer to last voxel image of region. | |
template<class VoxelType > | |
VoxelType * | GetPointerToEnd (GenericImage< VoxelType > *) const |
Get raw image pointer to last voxel image of region. | |
ImageRegion (const ImageAttributes &) | |
Constructor. | |
ImageRegion (const ImageAttributes &, const blocked_range2d< int > &) | |
Constructor. | |
ImageRegion (const ImageAttributes &, const blocked_range3d< int > &) | |
Constructor. | |
ImageRegion (const BaseImage &) | |
Constructor. | |
ImageRegion (const BaseImage &, const blocked_range2d< int > &) | |
Constructor. | |
ImageRegion (const BaseImage &, const blocked_range3d< int > &) | |
Constructor. | |
ImageRegion (const BaseImage *) | |
Constructor. | |
ImageRegion (const BaseImage *, const blocked_range2d< int > &) | |
Constructor. | |
ImageRegion (const BaseImage *, const blocked_range3d< int > &) | |
Constructor. | |
ImageRegion (const ImageRegion &) | |
Copy constructor. | |
void | Initialize () |
bool | IsImageSequence () const |
bool | IsScalar () const |
bool | IsScalarImage () const |
bool | IsSequence () const |
int | LineStride () const |
Get stride between rows/lines in number of voxels. | |
int | MaxNumberOfChannels () const |
Get number of channels in set image region. | |
int | MaxNumberOfComponents () const |
Get number of vector components in set image region. | |
int | MaxNumberOfFrames () const |
Get number of frames in set image region. | |
int | MaxNumberOfVoxels () const |
Number of voxels in set image region. | |
int | NumberOfChannels () const |
Get number of channels in overlap of set image region and image domain. | |
int | NumberOfComponents () const |
Get number of vector components in overlap of set image region and image domain. | |
int | NumberOfFrames () const |
Get number of frames in overlap of set image region and image domain. | |
int | NumberOfImageChannels () const |
int | NumberOfImageVoxels () const |
Number of voxels in the entire image. | |
int | NumberOfSequenceFrames () const |
int | NumberOfVectorComponents () const |
int | NumberOfVoxels () const |
Number of voxels in overlap of set image region and image domain. | |
ImageRegion & | operator= (const ImageRegion &) |
Assignment operator. | |
void | SetCenter (int, int, int=0, int=-1) |
Set center of image region. | |
void | SetChannel (int) |
Set temporal region. | |
void | SetChannel (int, int) |
Set temporal region. | |
void | SetChannel (const blocked_range< int > &) |
Set temporal region. | |
void | SetComponent (int) |
Set temporal region. | |
void | SetComponent (int, int) |
Set temporal region. | |
void | SetComponent (const blocked_range< int > &) |
Set temporal region. | |
void | SetFrame (int) |
Set temporal region. | |
void | SetFrame (int, int) |
Set temporal region. | |
void | SetFrame (const blocked_range< int > &) |
Set temporal region. | |
void | SetNeighborhood (int, int, int, int) |
Set 2D neighborhood. | |
void | SetNeighborhood (int, int, int, int, int, int) |
Set 3D neighborhood. | |
void | SetNeighborhood (int, int, int, int, int, int, int, int) |
Set 4D neighborhood. | |
void | SetRadius (int) |
Set radius of image region. | |
void | SetRadius (int, int, int=0, int=0) |
Set radius of image region. | |
void | SetRegion (int, int, int, int) |
Set 2D image region. | |
void | SetRegion (const blocked_range2d< int > &) |
Set 2D image region. | |
void | SetRegion (int, int, int, int, int, int) |
Set 3D image region. | |
void | SetRegion (const blocked_range3d< int > &) |
Set 3D image region. | |
void | SetRegion (int, int, int, int, int, int, int, int) |
Set 4D image region. | |
void | SetSize (int) |
Set size of image region. | |
void | SetSize (int, int, int=1, int=1) |
Set size of image region. | |
void | SetStart (int, int, int=0, int=-1) |
Set start of image region. | |
int | SliceStride () const |
Get stride between slices in number of voxels. | |
~ImageRegion () | |
Destructor. | |
Protected Attributes | |
Vector4D< int > | _Begin |
First index of actual image region. | |
Vector4D< int > | _DataSize |
Size of the entire image. | |
Vector4D< int > | _End |
Last index of actual image region. | |
int | _FrameStride |
Increment at end of frame in number of voxels. | |
Vector4D< int > | _Index |
Start of set image region. | |
bool | _IsImageSequence |
Whether the image is a sequence. | |
int | _LineStride |
Increment at end of line in number of voxels. | |
Vector4D< int > | _Size |
Size of set image region. | |
int | _SliceStride |
Increment at end of slice in number of voxels. | |
Helper for iterating over an image region using raw image pointers
This class makes it convenient to set a specific image region using one or more of the many available setter methods and calculates the start and end index of the first and last voxel in the region. Moreover, it computes how many voxels have to be skipped when moving from one line of the image to another, from one slice to another, or from one frame of an image sequence to another. It therefore helps to iterate over the set image region using a pointer to the image data. This makes the low-level iteration of an image using such fast image pointers more convenient to implement.
An instance of this class does not keep track of the current position of the image pointer. It can therefore not tell when it reached the end of a line, slice, or image frame/channel. This lies yet in the responsibility of the user.
Note that a single instance can (and for the sake of speed should be) used to move pointers to more than one image if needed. Herefore, all images must have the same size, however. Otherwise, use different instances.
The following example demonstrates how to iterate over a 5x5x3 neighborhood of a 3D image centered at voxel (128, 128, 64).
Definition at line 180 of file ImageRegion.h.
|
inline |
Initialize iteration range and calculate strides
This method determines the begin and end indices of the image region and reduces the size of the region in each dimension individually if it is outside the image domain. Use IsOutside to check if the resulting image region is completely outside the image domain and NumberOfVoxels to get the actual number of voxels that are within the overlap of the set image region and the image domain.
The Initialize method is called by GetPointerToBegin or GetPointerToEnd when necessary, i.e., when the image region has been modified. If the image pointer is initialized otherwise, the Initialize method has to be called explicitly after the region has been specified. Note that the constructor initializes the iterator already. Thus, if the region is not adjusted after construction of the iterator, there is no need to re-initialize it.
Definition at line 526 of file ImageRegion.h.
|
inline |
Whether the image is a 3D+t image sequence (i.e., number of voxels in t dimension > 1 and dt > 0)
Definition at line 554 of file ImageRegion.h.
|
inline |
Whether the image region is scalar (i.e., number of voxels in t dimension is 1)
Definition at line 600 of file ImageRegion.h.
|
inline |
Whether the image is a scalar image (i.e., number of voxels in t dimension is 1)
Definition at line 560 of file ImageRegion.h.
|
inline |
Whether the image region is a 3D+t image sequence (i.e., number of voxels in t dimension > 1 and dt > 0)
Definition at line 594 of file ImageRegion.h.
|
inline |
Get number of image channels (i.e., number of voxels in t dimension if dt <= 0 or 1 otherwise)
Definition at line 572 of file ImageRegion.h.
|
inline |
Get number of iterated frames (i.e., number of voxels in t dimension if dt > 0 or 1 otherwise)
Definition at line 584 of file ImageRegion.h.
|
inline |
Get number of vector components (i.e., number of voxels in t dimension if dt <= 0 or 1 otherwise)
Definition at line 578 of file ImageRegion.h.