ml::TSubImage< DATATYPE > Class Template Reference
[Reentrant ClassesImage Processing]

This template class manages/represents a rectangular 6d image region in memory which is organized linearly. More...

#include <mlTSubImage.h>

Inheritance diagram for ml::TSubImage< DATATYPE >:

ml::SubImage

List of all members.

Public Types

typedef TSubImageCursor< DATATYPE > Cursor
 A read/write cursor.
typedef ConstTSubImageCursor
< DATATYPE > 
ConstCursor
 A read-only cursor.

Public Member Functions

Constructors
 TSubImage (const SubImageBox &box, MLDataType dataType, void *data)
 Constructor for an image region with location/extent box, with data type dataType (must fit to DATATYPE!) and the memory address data which hold the image region.
 TSubImage ()
 Default constructor to build a typed subimage (with an empty box) from scratch.
 TSubImage (const SubImage &subImage)
 Constructor to build a typed subimage from an untyped subImage.
 TSubImage (const TSubImage< DATATYPE > &typedSubImage)
 Copy constructor to get an identical copy.
virtual ~TSubImage ()
 Virtual destructor to shut up compiler warnings.
TSubImageoperator= (const TSubImage< DATATYPE > &typedSubImage)
 Assignment operator to get an identical copy.
Properties of TSubImage
const DATATYPE * getData () const
 Returns memory address of image region (Overloads method from SubImage).
DATATYPE * getData ()
Calculation of memory addresses of image voxels
const DATATYPE * getSubImagePointer (const ImageVector &position) const
 Returns a pointer to voxel data of image voxel at the 6d position relative to the begin of the subimage region.
DATATYPE * getSubImagePointer (const ImageVector &position)
const DATATYPE * getSubImagePointer (MLint x, MLint y, MLint z) const
 Returns a pointer to voxel data of image voxel at 3d position p=(x, y, z) relative to the begin of the subimage region.
DATATYPE * getSubImagePointer (MLint x, MLint y, MLint z)
const DATATYPE * getImagePointer (const ImageVector &position) const
 Returns a pointer to voxel data of image voxel at 6d position position relative to the begin of the complete image region.
DATATYPE * getImagePointer (const ImageVector &position)
const DATATYPE * getImagePointer (MLint x, MLint y, MLint z) const
 Returns a pointer to voxel data of image voxel at 3d position p=(x, y, z) relative to the begin of the complete image region.
DATATYPE * getImagePointer (MLint x, MLint y, MLint z)
Calculate coordinates from pointers into image data(from memory positions)
ImageVector convertPointerToSubImagePosition (DATATYPE *pointer) const
 Returns 6d voxel coordinates corresponding to the memory address pointer.
void convertPointerToSubImagePosition (DATATYPE *pointer, MLint *x, MLint *y, MLint *z) const
 Returns 3d voxel coordinates corresponding to the memory address pointer.
ImageVector convertPointerToImagePosition (DATATYPE *pointer) const
 Returns 6d voxel coordinates corresponding to the memory address pointer.
void convertPointerToImagePosition (DATATYPE *pointer, MLint *x, MLint *y, MLint *z) const
 Returns 3d voxel coordinates corresponding to the memory address pointer.
Set/Get voxel data
const DATATYPE & operator[] (const ImageVector &position) const
 Constant reference access to voxel value at the given position.
DATATYPE & operator[] (const ImageVector &position)
 Reference access to voxel value at the given position.
void setSubImageValue (const ImageVector &position, DATATYPE value)
 Sets the voxel value at the given position to the given value where position is relative to the origin of the subimage region.
DATATYPE getSubImageValue (const ImageVector &position) const
 Returns voxel value at the given position where position is relative to the origin of the subimage region.
void setSubImageValue (MLint x, MLint y, DATATYPE value)
 Sets the voxel value at the given position(x, y) to the given value where the position is relative to the origin of the subimage region.
DATATYPE getSubImageValue (MLint x, MLint y) const
 Returns the voxel value at position (x, y) where the position is relative to the origin of the subimage region.
void setSubImageValue (MLint x, MLint y, MLint z, DATATYPE value)
 Sets the voxel value at the given position (x, y, z) to the given value where the positionis relative to the origin of the subimage region.
DATATYPE getSubImageValue (MLint x, MLint y, MLint z) const
 Returns the voxel value at the given position (x, y, z) where the position is relative to the origin of the subimage region.
void setImageValue (const ImageVector &position, DATATYPE value)
 Sets the 6d voxel at the given position to the given value.
DATATYPE getImageValue (const ImageVector &position) const
 Returns the 6d voxel value from the given position.
void setImageValue (MLint x, MLint y, DATATYPE value)
 Sets the 2d voxel at the given position (x, y) to the the given value.
DATATYPE getImageValue (MLint x, MLint y) const
 Returns the 2d voxel value from the given position (x, y).
void setImageValue (MLint x, MLint y, MLint z, DATATYPE value)
 Sets the 3d voxel at the given position (x, y, z) to the given value.
DATATYPE getImageValue (MLint x, MLint y, MLint z) const
 Returns the 3d voxel value from given position (x, y, z).
Return min/max values of subimage
MLint calculateMinMax (DATATYPE &minValue, DATATYPE &maxValue, const SubImageBox *const validBox=NULL) const
 Scans subimage and determines minimum and maximum values of the region which is part of subimage box and of validBox.
Special properties
bool isOneValued () const
 Returns true if all page voxels have the same value or if the page contains only 1 voxel.
Copying voxel from one subimage to another
void copySubImage (const SubImage &fromImage, const ScaleShiftData &scaleShiftData=ScaleShiftData())
 See SubImg::copySubImage(), declared here to avoid hiding via the overloads below.
template<typename FROM_DATATYPE >
void copySubImage (const TSubImage< FROM_DATATYPE > &typedFromImage)
 Implements special case for void copySubImage(const TSubImage<FROM_DATATYPE> &typedFromImg, const ScaleShiftData& scaleShiftData) where scaleShiftData is default.
template<typename FROM_DATATYPE >
void copySubImageReorderColorPlanesToInterleaved (const TSubImage< FROM_DATATYPE > &typedFromImage, const ScaleShiftData &scaleShiftData)
 Implements special case for void copySubImage(const TSubImage<FROM_DATATYPE> &typedFromImg, const ScaleShiftData& scaleShiftData) where color planes shall be interleaved instead of in planes.
template<typename FROM_DATATYPE >
void copySubImage (const TSubImage< FROM_DATATYPE > &typedFromImg, const ScaleShiftData &scaleShiftData)
 Copies image data from the subimage fromImg into the overlapping region of this subimage.
SUBIMAGE FILLING
void fill (DATATYPE value)
 Sets all voxel values in subimage to value.
void fillBordersWithValue (const SubImageBox &box, DATATYPE fillValue)
 Fills all regions with fillValue which are not covered by box.
template<typename FROM_DATATYPE >
void fillBordersWithInputValues (const SubImageBox &box, const TSubImage< FROM_DATATYPE > &inputSubImage)
 Fills all regions with values from inputSubImage which are not covered by box, however, only valid regions of inputSubImage are read.
void fillBordersWithBorderValues (const SubImageBox &box)
 Each voxel which is not inside box is filled with the nearest voxel which is inside box.
void fillInvalidRegionWithValue (DATATYPE value)
 Fills the invalid region (everything outside of getValidRegion()) with the given value.
void fillInvalidRegionWithBorderValues ()
 Fills the invalid region (everything outside of getValidRegion()) with the values on the borders of the valid region.
Deprecated
const DATATYPE * getSubImgPos (const ImageVector &p) const
DATATYPE * getSubImgPos (const ImageVector &p)
const DATATYPE * getSubImgPos (MLint x, MLint y, MLint z) const
DATATYPE * getSubImgPos (MLint x, MLint y, MLint z)
const DATATYPE * getImgPos (const ImageVector &p) const
DATATYPE * getImgPos (const ImageVector &p)
const DATATYPE * getImgPos (MLint x, MLint y, MLint z) const
DATATYPE * getImgPos (MLint x, MLint y, MLint z)
ImageVector getSubImgCoords (DATATYPE *pos) const
void getSubImgCoords (DATATYPE *pos, MLint *x, MLint *y, MLint *z) const
ImageVector getImgCoords (DATATYPE *pos) const
void getImgCoords (DATATYPE *pos, MLint *x, MLint *y, MLint *z) const
void setSubImgVal (const ImageVector &p, DATATYPE val)
DATATYPE getSubImgVal (const ImageVector &p) const
void setSubImgVal (MLint x, MLint y, DATATYPE val)
DATATYPE getSubImgVal (MLint x, MLint y) const
void setSubImgVal (MLint x, MLint y, MLint z, DATATYPE val)
DATATYPE getSubImgVal (MLint x, MLint y, MLint z) const
void setImgVal (const ImageVector &p, DATATYPE val)
DATATYPE getImgVal (const ImageVector &p) const
void setImgVal (MLint x, MLint y, DATATYPE val)
DATATYPE getImgVal (MLint x, MLint y) const
void setImgVal (MLint x, MLint y, MLint z, DATATYPE val)
DATATYPE getImgVal (MLint x, MLint y, MLint z) const
MLint calcMinMax (DATATYPE &minVal, DATATYPE &maxVal, const SubImageBox *const validBox=NULL) const
template<typename FROM_DATATYPE >
void copySubImg (const TSubImage< FROM_DATATYPE > &typedFromImg)
template<typename FROM_DATATYPE >
void copySubImg (const TSubImage< FROM_DATATYPE > &typedFromImg, const ScaleShiftData &scaleShiftData)
void fillSubImg (DATATYPE value)
void fillBordersWithClampedInputValues (const SubImageBox &box)
void fillBordersWithFillValue (const SubImageBox &box, DATATYPE value)

Protected Member Functions

void _calcFillAreaParams (const SubImageBox &box, const SubImageBox &maxValidInputRegion, ImageVector &boxV1, ImageVector &boxV2, ImageVector &outputTSubImageV1, ImageVector &outputTSubImageV2, MLint &fullLineLenX, MLint &fullLineLenXB, MLint &leftLineStartX, MLint &leftLineLenX, MLint &leftLineLenXB, MLint &rightLineStartX, MLint &rightLineLenX, MLint &rightLineLenXB)
 Helper method to calculate important parameters for page based border filling.


Detailed Description

template<typename DATATYPE>
class ml::TSubImage< DATATYPE >

This template class manages/represents a rectangular 6d image region in memory which is organized linearly.

It inherits the functionality of SubImage and adds data type specific access functions to that class. Apart from the direct data access methods, there are the TSubImage::Cursor and TSubImage::ConstCursor classes, which allow to work on the typed data with cursor positioning/movements.

A const TSubImage can be used to only allow const access to the underlying image data.

Thread-safety: This class is reentrant.

This template class owns

Notes: In the overloaded Module::calculateOutputSubImage, the Host passes untyped subimages (see SubImage). The image processing module usually needs to build typed wrappers around these untyped SubImages to have easy access to them. Then this class represents typed input tiles and output pages for image processing algorithms. Algorithms which have different typed input images can build easily template code to access the image data correctly. The methods to access image voxels are designed for image manipulation to be used by algorithm developers.

Definition at line 137 of file mlTSubImage.h.


Member Typedef Documentation

template<typename DATATYPE>
typedef ConstTSubImageCursor<DATATYPE> ml::TSubImage< DATATYPE >::ConstCursor

A read-only cursor.

Definition at line 145 of file mlTSubImage.h.

template<typename DATATYPE>
typedef TSubImageCursor<DATATYPE> ml::TSubImage< DATATYPE >::Cursor

A read/write cursor.

Definition at line 143 of file mlTSubImage.h.


Constructor & Destructor Documentation

template<typename DATATYPE>
ml::TSubImage< DATATYPE >::TSubImage ( const SubImageBox box,
MLDataType  dataType,
void *  data 
) [inline]

Constructor for an image region with location/extent box, with data type dataType (must fit to DATATYPE!) and the memory address data which hold the image region.

Note: The specification of dataType would usually not be necessary because it could be derived from DATATYPE. Anyway, one or two modules use differing DATATYPE and dataType for special purposes. Moreover, the derivation of dataType from template parameter DATATYPE is a little bit nasty, so we leave this constructor as it is. Note that this may be changed in future. Differing template data types and passed dataType enums will be handled as fatal error if real data is set.

Definition at line 162 of file mlTSubImage.h.

template<typename DATATYPE>
ml::TSubImage< DATATYPE >::TSubImage (  )  [inline]

Default constructor to build a typed subimage (with an empty box) from scratch.

Initial values will be an empty SubImageBox as box, the ML data type is derived from the template type, and data is initialized to NULL. See also the documentation of TSubImage(const SubImageBox& box, MLDataType dataType, void* data).

Definition at line 182 of file mlTSubImage.h.

template<typename DATATYPE>
ml::TSubImage< DATATYPE >::TSubImage ( const SubImage subImage  )  [inline]

Constructor to build a typed subimage from an untyped subImage.

See also the documentation of TSubImage(const SubImageBox& box, MLDataType dataType, void* data). NOTE: This does not take over the MemoryBlockHandle of the given subImage for performance reasons. You need to explicitly set the handle on the TSubImage if you want the TSubImage to reference count the data.

Definition at line 200 of file mlTSubImage.h.

template<typename DATATYPE>
ml::TSubImage< DATATYPE >::TSubImage ( const TSubImage< DATATYPE > &  typedSubImage  )  [inline]

Copy constructor to get an identical copy.

Note that only the pointer to the data is copied, and NOT the data itself.

Definition at line 228 of file mlTSubImage.h.

template<typename DATATYPE>
virtual ml::TSubImage< DATATYPE >::~TSubImage (  )  [inline, virtual]

Virtual destructor to shut up compiler warnings.

Definition at line 235 of file mlTSubImage.h.


Member Function Documentation

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::_calcFillAreaParams ( const SubImageBox box,
const SubImageBox maxValidInputRegion,
ImageVector boxV1,
ImageVector boxV2,
ImageVector outputTSubImageV1,
ImageVector outputTSubImageV2,
MLint fullLineLenX,
MLint fullLineLenXB,
MLint leftLineStartX,
MLint leftLineLenX,
MLint leftLineLenXB,
MLint rightLineStartX,
MLint rightLineLenX,
MLint rightLineLenXB 
) [inline, protected]

Helper method to calculate important parameters for page based border filling.

Input parameters: box specifies the box which shall not be filled. maxValidInputRegion is the region which is allowed to be read.

Return parameters: boxV1 and boxV2 are the corners of box. outputTSubImageV1 and outputTSubImageV2 are the corners of the box of this. fullLineLenX is the number of voxels in one row of this. fullLineLenXB is the number of bytes in one row of this. leftLineStartX is the first voxel left from box to be filled in x-rows. leftLineLenX is the number of voxels to be filled starting at voxel leftLineStartX. leftLineLenXB is the number of bytes to be filled starting at voxel leftLineStartX. rightLineStartX is the first voxel right from box to be filled in x-rows. rightLineLenX is the number of voxels to be filled starting at voxel rightLineStartX. rightLineLenXB is the number of bytes to be filled starting at voxel rightLineStartX.

Definition at line 1315 of file mlTSubImage.h.

Referenced by ml::TSubImage< DATATYPE >::fillBordersWithInputValues().

template<typename DATATYPE>
MLint ml::TSubImage< DATATYPE >::calcMinMax ( DATATYPE &  minVal,
DATATYPE &  maxVal,
const SubImageBox *const   validBox = NULL 
) const [inline]

Deprecated:
Use calculateMinMax() instead.

Definition at line 1456 of file mlTSubImage.h.

template<typename DATATYPE>
MLint ml::TSubImage< DATATYPE >::calculateMinMax ( DATATYPE &  minValue,
DATATYPE &  maxValue,
const SubImageBox *const   validBox = NULL 
) const [inline]

Scans subimage and determines minimum and maximum values of the region which is part of subimage box and of validBox.

If no validBox is passed (default), all voxels are checked. The return value is the number of scanned voxels. If subimage is empty, minValue and maxValue are set to 0 and return value is 0. Warning: If used in calculateOutputSubImage take in consideration that the page may also contain invalid data which is not part of the image. Pass image box as validBox to be sure to access only valid regions.

Definition at line 465 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::convertPointerToImagePosition ( DATATYPE *  pointer,
MLint x,
MLint y,
MLint z 
) const [inline]

Returns 3d voxel coordinates corresponding to the memory address pointer.

The returned coordinates are relative to the origin of the complete image region. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage. It is legal to pass x, y and/or z as NULL pointers; their values are only set if pointer is non NULL.

Definition at line 365 of file mlTSubImage.h.

template<typename DATATYPE>
ImageVector ml::TSubImage< DATATYPE >::convertPointerToImagePosition ( DATATYPE *  pointer  )  const [inline]

Returns 6d voxel coordinates corresponding to the memory address pointer.

The returned coordinates are relative to the origin of the complete image region. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage.

Definition at line 356 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::convertPointerToSubImagePosition ( DATATYPE *  pointer,
MLint x,
MLint y,
MLint z 
) const [inline]

Returns 3d voxel coordinates corresponding to the memory address pointer.

The returned coordinates are relative to the origin of the subimage region. I.e., the position (0,0,0,0,0,0) is considered the origin of the subimage. It is legal to pass x, y and/or z as NULL pointers; their values are only set if pointer is non NULL.

Definition at line 322 of file mlTSubImage.h.

template<typename DATATYPE>
ImageVector ml::TSubImage< DATATYPE >::convertPointerToSubImagePosition ( DATATYPE *  pointer  )  const [inline]

Returns 6d voxel coordinates corresponding to the memory address pointer.

The returned coordinates are relative to the origin of the subimage region. I.e., the position (0,0,0,0,0,0) is considered the origin of the subimage.

Definition at line 314 of file mlTSubImage.h.

template<typename DATATYPE>
template<typename FROM_DATATYPE >
void ml::TSubImage< DATATYPE >::copySubImage ( const TSubImage< FROM_DATATYPE > &  typedFromImg,
const ScaleShiftData scaleShiftData 
) [inline]

Copies image data from the subimage fromImg into the overlapping region of this subimage.

Grey values are transformed linearly according to the settings in scaleShiftData (see ScaleShiftData). Notes:

  • The copied data always has the data type of this subimage. If necessary it is cast.
  • By transforming voxel values linearly before copying them it is possible to avoid information loss due to type casting.
  • The default case of scaleShiftData defines scaleShiftData.getScale()==1 and scaleShiftData.getShift()==0. So voxel value transformation does not change anything and copying is implemented as special case which is therefore faster.

Definition at line 875 of file mlTSubImage.h.

template<typename DATATYPE>
template<typename FROM_DATATYPE >
void ml::TSubImage< DATATYPE >::copySubImage ( const TSubImage< FROM_DATATYPE > &  typedFromImage  )  [inline]

Implements special case for void copySubImage(const TSubImage<FROM_DATATYPE> &typedFromImg, const ScaleShiftData& scaleShiftData) where scaleShiftData is default.

Definition at line 624 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::copySubImage ( const SubImage fromImage,
const ScaleShiftData scaleShiftData = ScaleShiftData() 
) [inline]

See SubImg::copySubImage(), declared here to avoid hiding via the overloads below.

Reimplemented from ml::SubImage.

Definition at line 616 of file mlTSubImage.h.

template<typename DATATYPE>
template<typename FROM_DATATYPE >
void ml::TSubImage< DATATYPE >::copySubImageReorderColorPlanesToInterleaved ( const TSubImage< FROM_DATATYPE > &  typedFromImage,
const ScaleShiftData scaleShiftData 
) [inline]

Implements special case for void copySubImage(const TSubImage<FROM_DATATYPE> &typedFromImg, const ScaleShiftData& scaleShiftData) where color planes shall be interleaved instead of in planes.

Definition at line 765 of file mlTSubImage.h.

template<typename DATATYPE>
template<typename FROM_DATATYPE >
void ml::TSubImage< DATATYPE >::copySubImg ( const TSubImage< FROM_DATATYPE > &  typedFromImg,
const ScaleShiftData scaleShiftData 
) [inline]

Deprecated:
Use copySubImage() instead.

Definition at line 1464 of file mlTSubImage.h.

template<typename DATATYPE>
template<typename FROM_DATATYPE >
void ml::TSubImage< DATATYPE >::copySubImg ( const TSubImage< FROM_DATATYPE > &  typedFromImg  )  [inline]

Deprecated:
Use copySubImage() instead.

Definition at line 1460 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::fill ( DATATYPE  value  )  [inline]

Sets all voxel values in subimage to value.

Definition at line 1136 of file mlTSubImage.h.

Referenced by ml::RasterFunction::_fillRaster().

template<typename DATATYPE >
void ml::TSubImage< DATATYPE >::fillBordersWithBorderValues ( const SubImageBox box  )  [inline]

Each voxel which is not inside box is filled with the nearest voxel which is inside box.

Note that box must be specified in global image coordinates. box must overlap the box of the subImg at least in one voxel to guarantee correct operation since copying can be done only from box area. If no overlap exists then the routine returns without filling anything. The cursor position is left undefined.

Reimplemented from ml::SubImage.

Definition at line 1982 of file mlTSubImage.h.

References ml::TSubImageBox< intT >::clamp(), ml::TSubImageCursorBase< DATATYPE >::getValue(), ml::ImageVector, ml::TSubImageBox< intT >::isEmpty(), ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, MLTypeInfosPop(), MLTypeInfosPushAndSetBoth(), ml::TSubImageCursorBase< DATATYPE >::moveX(), ml::TSubImageCursorBase< DATATYPE >::setImagePosition(), ml::TSubImageCursor< DATATYPE >::setValue(), ml::TSubImageBox< intT >::v1, and ml::TSubImageBox< intT >::v2.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::fillBordersWithClampedInputValues ( const SubImageBox box  )  [inline]

Deprecated:
Use fillBordersWithBorderValues() instead.

Reimplemented from ml::SubImage.

Definition at line 1471 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::fillBordersWithFillValue ( const SubImageBox box,
DATATYPE  value 
) [inline]

Deprecated:
Use fillBordersWithValue() instead.

Definition at line 1475 of file mlTSubImage.h.

template<typename DATATYPE >
template<typename FROM_DATATYPE >
void ml::TSubImage< DATATYPE >::fillBordersWithInputValues ( const SubImageBox box,
const TSubImage< FROM_DATATYPE > &  inputSubImage 
) [inline]

Fills all regions with values from inputSubImage which are not covered by box, however, only valid regions of inputSubImage are read.

Unavailable regions from input are ignored and may lead to unchanged regions outside box if inputSubImage does not cover all regions outside box. Note that box must be specified in global image coordinates. So two subimages with different origins and same sizes are filled differently, dependent on their overlap with the box in global image coordinates. This method should be called only if this and inputSubImage differ. In both subimages the cursor position is left undefined. Note: The following function definition must be implemented in the class definition See BUG: LNK2001 on Member Function When Use Nested Class Template, Article ID: Q128789

Definition at line 1832 of file mlTSubImage.h.

References ml::TSubImage< DATATYPE >::_calcFillAreaParams(), ml::SubImage::getBox(), ml::SubImage::getDataType(), ml::ConstTSubImageCursor< DATATYPE >::getPointer(), ml::TSubImageCursor< DATATYPE >::getPointer(), ml::ImageVector, ML_CATCH_RETHROW, ML_TRACE_IN, ML_TRY, MLint16Type, MLint32Type, MLint64Type, MLint8Type, MLTTypeInfosPushAndSetBoth(), MLTypeInfosPop(), MLuint16Type, MLuint32Type, MLuint64Type, MLuint8Type, and ml::TSubImageCursorBase< DATATYPE >::setImagePosition().

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::fillBordersWithValue ( const SubImageBox box,
DATATYPE  fillValue 
) [inline]

Fills all regions with fillValue which are not covered by box.

Note that box must be specified in global image coordinates. So two subimages with different origins and same sizes are filled differently, dependent on their overlap with the box in global image coordinates. The cursor position is left undefined.

Definition at line 1164 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::fillInvalidRegionWithBorderValues (  )  [inline]

Fills the invalid region (everything outside of getValidRegion()) with the values on the borders of the valid region.

This is useful to initialize invalid regions of an output/input sub image.

Reimplemented from ml::SubImage.

Definition at line 1289 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::fillInvalidRegionWithValue ( DATATYPE  value  )  [inline]

Fills the invalid region (everything outside of getValidRegion()) with the given value.

This is useful to initialize invalid regions of an output/input sub image.

Definition at line 1282 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::fillSubImg ( DATATYPE  value  )  [inline]

Deprecated:
Use fill() instead.

Definition at line 1467 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE* ml::TSubImage< DATATYPE >::getData (  )  [inline]

Definition at line 258 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE* ml::TSubImage< DATATYPE >::getData (  )  const [inline]

Returns memory address of image region (Overloads method from SubImage).

Reimplemented from ml::SubImage.

Definition at line 257 of file mlTSubImage.h.

Referenced by ml::TSubImage< DATATYPE >::copySubImage(), ml::TSubImage< DATATYPE >::copySubImageReorderColorPlanesToInterleaved(), and ml::TSubImageCursorBase< DATATYPE >::TSubImageCursorBase().

template<typename DATATYPE>
DATATYPE* ml::TSubImage< DATATYPE >::getImagePointer ( MLint  x,
MLint  y,
MLint  z 
) [inline]

Definition at line 302 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE* ml::TSubImage< DATATYPE >::getImagePointer ( MLint  x,
MLint  y,
MLint  z 
) const [inline]

Returns a pointer to voxel data of image voxel at 3d position p=(x, y, z) relative to the begin of the complete image region.

The subimage is a part of the complete image. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage.

Reimplemented from ml::SubImage.

Definition at line 301 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE* ml::TSubImage< DATATYPE >::getImagePointer ( const ImageVector position  )  [inline]

Definition at line 294 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE* ml::TSubImage< DATATYPE >::getImagePointer ( const ImageVector position  )  const [inline]

Returns a pointer to voxel data of image voxel at 6d position position relative to the begin of the complete image region.

The subimage is a part of the complete image. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage.

Reimplemented from ml::SubImage.

Definition at line 293 of file mlTSubImage.h.

Referenced by ml::TVirtualVolume< DATATYPE >::copyMaskToSubImage(), ml::TSubImage< DATATYPE >::copySubImage(), and ml::TSubImage< DATATYPE >::copySubImageReorderColorPlanesToInterleaved().

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getImageValue ( MLint  x,
MLint  y,
MLint  z 
) const [inline]

Returns the 3d voxel value from given position (x, y, z).

The given position is relative to the origin of the complete image region. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage.

Definition at line 446 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getImageValue ( MLint  x,
MLint  y 
) const [inline]

Returns the 2d voxel value from the given position (x, y).

The given position is relative to the origin of the complete image region. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage.

Definition at line 437 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getImageValue ( const ImageVector position  )  const [inline]

Returns the 6d voxel value from the given position.

The position is relative to the origin of the complete image region. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage.

Definition at line 428 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::getImgCoords ( DATATYPE *  pos,
MLint x,
MLint y,
MLint z 
) const [inline]

Deprecated:
Use convertPointerToImagePosition() instead.

Definition at line 1417 of file mlTSubImage.h.

template<typename DATATYPE>
ImageVector ml::TSubImage< DATATYPE >::getImgCoords ( DATATYPE *  pos  )  const [inline]

Deprecated:
Use convertPointerToImagePosition() instead.

Definition at line 1414 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE* ml::TSubImage< DATATYPE >::getImgPos ( MLint  x,
MLint  y,
MLint  z 
) [inline]

Deprecated:
Use getImagePointer() instead.

Definition at line 1405 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE* ml::TSubImage< DATATYPE >::getImgPos ( MLint  x,
MLint  y,
MLint  z 
) const [inline]

Deprecated:
Use getImagePointer() instead.

Definition at line 1402 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE* ml::TSubImage< DATATYPE >::getImgPos ( const ImageVector p  )  [inline]

Deprecated:
Use getImagePointer() instead.

Definition at line 1399 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE* ml::TSubImage< DATATYPE >::getImgPos ( const ImageVector p  )  const [inline]

Deprecated:
Use getImagePointer() instead.

Definition at line 1396 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getImgVal ( MLint  x,
MLint  y,
MLint  z 
) const [inline]

Deprecated:
Use getImageValue() instead.

Definition at line 1453 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getImgVal ( MLint  x,
MLint  y 
) const [inline]

Deprecated:
Use getImageValue() instead.

Definition at line 1447 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getImgVal ( const ImageVector p  )  const [inline]

Deprecated:
Use getImageValue() instead.

Definition at line 1441 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE* ml::TSubImage< DATATYPE >::getSubImagePointer ( MLint  x,
MLint  y,
MLint  z 
) [inline]

Definition at line 286 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE* ml::TSubImage< DATATYPE >::getSubImagePointer ( MLint  x,
MLint  y,
MLint  z 
) const [inline]

Returns a pointer to voxel data of image voxel at 3d position p=(x, y, z) relative to the begin of the subimage region.

I.e., the position (0,0,0,0,0,0) is considered the origin of the subimage and higher coordinates c, t and u are taken as 0 values.

Reimplemented from ml::SubImage.

Definition at line 285 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE* ml::TSubImage< DATATYPE >::getSubImagePointer ( const ImageVector position  )  [inline]

Definition at line 274 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE* ml::TSubImage< DATATYPE >::getSubImagePointer ( const ImageVector position  )  const [inline]

Returns a pointer to voxel data of image voxel at the 6d position relative to the begin of the subimage region.

I.e., the position (0,0,0,0,0,0) is considered the origin of the subimage.

Reimplemented from ml::SubImage.

Definition at line 273 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getSubImageValue ( MLint  x,
MLint  y,
MLint  z 
) const [inline]

Returns the voxel value at the given position (x, y, z) where the position is relative to the origin of the subimage region.

I.e., the position (0,0,0) is considered the origin of the subimage.

Definition at line 419 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getSubImageValue ( MLint  x,
MLint  y 
) const [inline]

Returns the voxel value at position (x, y) where the position is relative to the origin of the subimage region.

I.e., the position (0,0) is considered the origin of the subimage.

Definition at line 410 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getSubImageValue ( const ImageVector position  )  const [inline]

Returns voxel value at the given position where position is relative to the origin of the subimage region.

I.e., the position (0,0,0,0,0,0) is considered the origin of the subimage.

Definition at line 401 of file mlTSubImage.h.

Referenced by ml::TVirtualVolume< DATATYPE >::copyFromSubImage().

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::getSubImgCoords ( DATATYPE *  pos,
MLint x,
MLint y,
MLint z 
) const [inline]

Deprecated:
Use convertPointerToSubImagePosition() instead.

Definition at line 1411 of file mlTSubImage.h.

template<typename DATATYPE>
ImageVector ml::TSubImage< DATATYPE >::getSubImgCoords ( DATATYPE *  pos  )  const [inline]

Deprecated:
Use convertPointerToSubImagePosition() instead.

Definition at line 1408 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE* ml::TSubImage< DATATYPE >::getSubImgPos ( MLint  x,
MLint  y,
MLint  z 
) [inline]

Deprecated:
Use getSubImagePointer() instead.

Definition at line 1393 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE* ml::TSubImage< DATATYPE >::getSubImgPos ( MLint  x,
MLint  y,
MLint  z 
) const [inline]

Deprecated:
Use getSubImagePointer() instead.

Definition at line 1390 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE* ml::TSubImage< DATATYPE >::getSubImgPos ( const ImageVector p  )  [inline]

Deprecated:
Use getSubImagePointer() instead.

Definition at line 1387 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE* ml::TSubImage< DATATYPE >::getSubImgPos ( const ImageVector p  )  const [inline]

Deprecated:
Use getSubImagePointer() instead.

Definition at line 1384 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getSubImgVal ( MLint  x,
MLint  y,
MLint  z 
) const [inline]

Deprecated:
Use getSubImageValue() instead.

Definition at line 1435 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getSubImgVal ( MLint  x,
MLint  y 
) const [inline]

Deprecated:
Use getSubImageValue() instead.

Definition at line 1429 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE ml::TSubImage< DATATYPE >::getSubImgVal ( const ImageVector p  )  const [inline]

Deprecated:
Use getSubImageValue() instead.

Definition at line 1423 of file mlTSubImage.h.

template<typename DATATYPE>
bool ml::TSubImage< DATATYPE >::isOneValued (  )  const [inline]

Returns true if all page voxels have the same value or if the page contains only 1 voxel.

If subimage has no voxels (empty) or more than one value, false is returned.

Reimplemented from ml::SubImage.

Definition at line 539 of file mlTSubImage.h.

template<typename DATATYPE>
TSubImage& ml::TSubImage< DATATYPE >::operator= ( const TSubImage< DATATYPE > &  typedSubImage  )  [inline]

Assignment operator to get an identical copy.

Note that only the pointer to the data is copied, and NOT the data itself.

Definition at line 239 of file mlTSubImage.h.

template<typename DATATYPE>
DATATYPE& ml::TSubImage< DATATYPE >::operator[] ( const ImageVector position  )  [inline]

Reference access to voxel value at the given position.

The caller must guarantee that position is inside valid subimage region. The position (0,0,0,0,0,0) is considered the origin of the image, getBox.v1() is considered the origin of the valid subimage area. Note that this operator access always calculates all six coordinate components.

Definition at line 391 of file mlTSubImage.h.

template<typename DATATYPE>
const DATATYPE& ml::TSubImage< DATATYPE >::operator[] ( const ImageVector position  )  const [inline]

Constant reference access to voxel value at the given position.

The caller must guarantee that position is inside valid subimage region. The position (0,0,0,0,0,0) is considered the origin of the image, getBox.v1() is considered the origin of the valid subimage area. Note that this operator access always calculates all six coordinate components.

Definition at line 385 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setImageValue ( MLint  x,
MLint  y,
MLint  z,
DATATYPE  value 
) [inline]

Sets the 3d voxel at the given position (x, y, z) to the given value.

The given position is relative to the origin of the complete image region. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage.

Definition at line 442 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setImageValue ( MLint  x,
MLint  y,
DATATYPE  value 
) [inline]

Sets the 2d voxel at the given position (x, y) to the the given value.

The given position is relative to the origin of the complete image region. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage.

Definition at line 433 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setImageValue ( const ImageVector position,
DATATYPE  value 
) [inline]

Sets the 6d voxel at the given position to the given value.

The position is relative to the origin of the complete image region. I.e., the position p=getBox.v1() is considered the origin of the image region/subimage.

Definition at line 424 of file mlTSubImage.h.

Referenced by ml::RasterFunction::_fillRaster().

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setImgVal ( MLint  x,
MLint  y,
MLint  z,
DATATYPE  val 
) [inline]

Deprecated:
Use setImageValue() instead.

Definition at line 1450 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setImgVal ( MLint  x,
MLint  y,
DATATYPE  val 
) [inline]

Deprecated:
Use setImageValue() instead.

Definition at line 1444 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setImgVal ( const ImageVector p,
DATATYPE  val 
) [inline]

Deprecated:
Use setImageValue() instead.

Definition at line 1438 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setSubImageValue ( MLint  x,
MLint  y,
MLint  z,
DATATYPE  value 
) [inline]

Sets the voxel value at the given position (x, y, z) to the given value where the positionis relative to the origin of the subimage region.

I.e., the position (0,0,0) is considered the origin of the subimage.

Definition at line 415 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setSubImageValue ( MLint  x,
MLint  y,
DATATYPE  value 
) [inline]

Sets the voxel value at the given position(x, y) to the given value where the position is relative to the origin of the subimage region.

I.e., the position (0,0) is considered the origin of the subimage.

Definition at line 406 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setSubImageValue ( const ImageVector position,
DATATYPE  value 
) [inline]

Sets the voxel value at the given position to the given value where position is relative to the origin of the subimage region.

I.e., the position (0,0,0,0,0,0) is considered the origin of the subimage.

Definition at line 396 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setSubImgVal ( MLint  x,
MLint  y,
MLint  z,
DATATYPE  val 
) [inline]

Deprecated:
Use setSubImageValue() instead.

Definition at line 1432 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setSubImgVal ( MLint  x,
MLint  y,
DATATYPE  val 
) [inline]

Deprecated:
Use setSubImageValue() instead.

Definition at line 1426 of file mlTSubImage.h.

template<typename DATATYPE>
void ml::TSubImage< DATATYPE >::setSubImgVal ( const ImageVector p,
DATATYPE  val 
) [inline]

Deprecated:
Use setSubImageValue() instead.

Definition at line 1420 of file mlTSubImage.h.


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

Generated on Sat Sep 3 18:39:36 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8