MeVisLabToolboxReference
ml::PagedImage Class Reference

Class which represents an image, which manages properties of an image and image data which is located in pages. More...

#include <mlPagedImage.h>

Inheritance diagram for ml::PagedImage:
ml::MedicalImageProperties ml::ImageProperties

List of all members.

Public Member Functions

 ML_FRIEND_TEST (PagedImageDeprecationTest, NewAPI)
 ML_FRIEND_TEST (PagedImageDeprecationTest, DeprecatedAPI)
CalculateOutputImageHandlergetCalculateOutputImageHandler () const
 Returns the pointer to the output image calculation interface.
MLEXPORT void setExternalCalculateOutputImageHandler (CalculateOutputImageHandler *handler)
 Sets the pointer to the output image calculation interface handler, the ownership is NOT passed to the PagedImage and it is not overwritten by Host::updateImageProperties().
bool hasExternalCalculateOutputImageHandler () const
 Returns if the CalculateOutputImageHandler is an external handler and should not be overwritten.
MLEXPORT void setCalculateOutputImageHandler (CalculateOutputImageHandler *handler)
 Sets the pointer to the output image calculation interface handler, the ownership is passed to the PagedImage.
MLEXPORT void setCalculateOutputImagePropertiesCB (CalculateOutputImagePropertiesCB *callback, void *userData)
 Sets the callback and userdata for the calculation of the properties of this PagedImage if they need to be updated.
MLuint32 getID ()
 Returns the current image id (which changes whenever the image changes and which is unique accross all images)
void updateID ()
 Sets that the image has changed.
MLEXPORT MLMemoryBlockHandle getPage (MLint pageID) const
 Returns the pointer to the CachedBuffer containing the data of the page with the id pageID.
MLEXPORT MLMemoryBlockHandle getPageOrPendingRequest (MLint pageID, PageRequest **pendingRequest) const
 Returns the valid page handle if it exists and otherwise returns if there is a pending PageRequest that is going to calculate this page later on and may be shared (pendingRequest may NOT be NULL).
MLEXPORT void setPageRequest (MLint pageID, PageRequest *request)
 Sets a page request for a given page (or clear it by passing NULL).
MLEXPORT PagedImagegetBypassSourceImage ()
 Returns the reference to the source image of a bypass chain.
MLEXPORT SubImageBox getPageBox (MLint pageID) const
 Returns the rectangular region in the entire image covered by the page with the id pageID.
MLEXPORT void getPageIDs (std::vector< MLint > &pageIDs, const SubImageBox &subImageBox) const
 Clears pageIDs and inserts the ids of all pages which need to be calculated to cover subImageBox completely.
MLEXPORT size_t getCachedPagesSizeInBytes () const
 Returns currently used cache size for pages in bytes.
MLEXPORT MLMetaProfilePtrgetMetaProfile () const
 Returns the MLMetaProfile for this paged image. Creates it if necessary.
Construction / Destruction.
MLEXPORT PagedImage (Module *module=NULL, MLint outputIndex=-1)
 Constructor.
virtual MLEXPORT ~PagedImage ()
 Destructor.
Set/Get/Update validity of image properties.
bool isValid () const
 Returns whether image properties are valid and up-to-date.
void setValid (bool flag=true)
 Sets image properties to valid/up-to-date, i.e., isValid() returns true afterwards.
void setInvalid ()
 Sets image properties invalid, i.e., isValid() returns false afterwards.
MLEXPORT void setUpdateOfImagePropertiesNeeded (bool flag)
 Sets if the update of the image properties is needed, because the ML graph has changed since the last update.
MLEXPORT bool updateOfImagePropertiesNeeded () const
 Gets if the update of the image properties is needed, because the ML graph has changed since the last update.
MLEXPORT MLErrorCode updateImageProperties () ML_RETURN_VALUE_SHOULD_BE_USED
 Updates the image properties of the PagedImage using the Host::updateImageProperties method.
Setting Image and Page Properties
virtual MLEXPORT void setImageExtent (const ImageVector &extent)
 Sets the extents of the image to extent. The list of valid pages and its content are cleared.
void setImageExtent (MLint x, MLint y, MLint z=1, MLint c=1, MLint t=1, MLint u=1)
 Sets the extents of the image to the extent (x,y,z,c,t,u) and clears the list of valid pages and its content.
void setImageExtent (const SubImageBox &box)
 Sets the extents of the image to box.getExtent() and updates all PagedImage settings.
virtual MLEXPORT void setImageProperties (const PagedImage &imageProperties)
 Function to copy all associated characteristics from imageProperties.
MLEXPORT void setPageExtent (const ImageVector &pageExtent)
 Sets the extents of the pages to pageExtent.
void setPageExtent (MLint x, MLint y, MLint z=1, MLint c=1, MLint t=1, MLint u=1)
 Sets the extents of the pages to the extent (x,y,z,c,t,u).
MLEXPORT void setPage (MLint pageID, const MLMemoryBlockHandle &page)
 Sets the given page handle as pagedata at pageID.
MLEXPORT void removePage (MLint pageID)
 This method removes a page with id pageID from this instance.
MLEXPORT void deletePageEntryFromDeletionCallback (PagedImageExtendedPageEntry *entry)
 This method removes a page referenced by the page entry.
MLEXPORT void clearPageList ()
 Remove all pages of the page image and from the ML cache, and all page data chunks are freed, if not referenced by a memory block handle elsewhere.
MLEXPORT void clearPageListAndMemoryImage ()
 Remove all pages of the page image and from the ML cache, and all page data chunks are freed.
Property state info.
virtual MLEXPORT void setStateInfo (const std::string &info, MLErrorCode errorCode)
 Sets the state information for this PagedImage to the string info and the MLErrorCode errorCode.
virtual MLEXPORT void setStateInfoErrorCode (MLErrorCode errorCode)
 Sets the state information as MLErrorCode errorCode for this instance.
virtual MLEXPORT const
std::string & 
getStateInfoString () const
 Returns the current state information string which might explain something about the state of this instance.
virtual MLEXPORT MLErrorCode getStateInfoErrorCode () const
 Returns the current state information as MLError code which might explain something about the state of this instance.
Bypass handling.
void setBypassIndex (MLint index)
 Sets the index of the input image whose pages should be used instead of the pages of this image.
MLint getBypassIndex () const
 Returns the index of the input image whose pages should be used instead of the pages of this image or -1 if bypassing is disabled.
Property query
ModulegetModule () const
 Returns the associated Module instance if passed to the constructor, NULL otherwise.
MLEXPORT const PagedImagegetInputImage (int inputIndex) const
 Returns the input image at inputIndex of the associated Module.
MLint getOutputIndex () const
 Returns associated output index of Module instance if passed to constructor, -1 otherwise.
ImageVector getPageSetExtent () const
 Returns the extents of the page set covering the entire image extents.
ImageVector getPageStride () const
 Returns the stride to get from one page to another.
ImageVector getPageExtent () const
 Returns the extent of a page.
MLint getPageID (const ImageVector &voxelPosition) const
 Returns the id of that page which contains the image voxel position voxelPosition.
MemoryImagegetMemoryImage ()
 Permits the access to a memory cached output of the paged image.
const MemoryImagegetMemoryImage () const
Page inplace handling.
void setInPlaceIndex (MLint inputIndex)
 Set optimization flag: If calculating a page in calculateOutputSubImage() the output image page shall use the same memory as the input page at inputIndex.
MLint getInPlaceIndex () const
 Return optimization flag: Return index of input image whose input tile is used also as output page in calculateOutputSubImage() (instead of allocating its own memory).
Setting the properties of input subimages/tiles for Module::calculateOutputSubImage
MLEXPORT void setInputSubImageDataType (int inputIndex, MLDataType dataType)
 The following methods allow to define the properties of the input subimages that are passed to the Module::calculateOutputSubImage().
MLEXPORT void setInputSubImageIsReadOnly (int inputIndex, bool readOnly)
 Sets that the input sub image for the input image at inputIndex to readOnly.
MLEXPORT void setInputSubImageUseMemoryImage (int inputIndex, bool useMemoryImage)
 Sets that the input sub image for the input image at inputIndex should use a memory image (this implicitly sets setInSubImageIsReadOnly() to true as well).
MLEXPORT void setInputSubImageScaleShift (int inputIndex, const ScaleShiftData &scaleShift)
 Sets that the input sub image for the input image at inputIndex should be rescaled with the given scaleShift data The default is to not shift/scale at all.
const InputSubImagePropertiesgetInputSubImageProperties (int inputIndex) const
 Returns a const reference to the InputSubImageProperties of the given input image at inputIndex.
MLEXPORT MLDataType getInputSubImageDataType (int inputIndex) const
 Returns the input sub image data type for the input image at inputIndex.
MLEXPORT bool getInputSubImageIsReadOnly (int inputIndex) const
 Returns if input sub image at inputIndex is set to 'read-only'.
Joining and copying Pages into sequential storage areas
MLEXPORT void copyPages (const std::vector< MLint > &pageIDs, SubImage *subImage, const ScaleShiftData &scaleShiftData=ScaleShiftData()) const
 Fills the subImage with contents of the Pages with the IDs pagesIDs The grey values become according to the Pages the parameters scaleShiftData.
Requesting data with wrapped functionality from Host
MLEXPORT MLErrorCode getTile (SubImageBox location, MLDataType dataType, void **data, const ScaleShiftData &scaleShiftData=ScaleShiftData()) ML_RETURN_VALUE_SHOULD_BE_USED
 See Host::getTile( module, outputIndex, location, dataType, data, scaleShiftData).
MLEXPORT MLErrorCode getTile (SubImage &subImage, const ScaleShiftData &scaleShiftData=ScaleShiftData()) ML_RETURN_VALUE_SHOULD_BE_USED
 See Host::getTile( module, outputIndex, subImg, scaleShiftData).
MLEXPORT void freeTile (void *data)
 Same as corresponding Host::freeTile(void *data).
Test Prints
MLEXPORT void printPageData (MLint pageID, std::ostream &ostr) const
 Prints the data contents of the page with the pageID to ostr.
MLEXPORT void printPages (std::ostream &ostr) const
 Makes a print of all pages.

Static Public Member Functions

static MLEXPORT void getPageIDs (std::vector< MLint > &pageIDs, const SubImageBox &subImageBox, const ImageVector &imageExtent, const ImageVector &pageExtent)
 Clears pageIDs and inserts the ids of all pages which need to be calculated to cover subImageBox completely.
static MLEXPORT void setPageCountLimitToUsePageEntryMap (MLuint32 limit)
 Sets the limit of number of pages for using the page entry map instead of the page list.
static MLEXPORT MLuint32 getPageCountLimitToUsePageEntryMap ()
 Returns the limit of number of pages for using the page entry map instead of the page list.

Protected Member Functions

MLEXPORT void calculateImageProperties ()
 Updates the image properties via the Module::calculateOutputImageProperties or via CalculateOutputImagePropertiesCB if it is set.
MLEXPORT void initializeInputSubImageProperties (MLint numInputs)
 Initializes the InSubImageProps for a given number of inputs, should only be called by the Host!
MLEXPORT void validateInputSubImagePropertiesAfterCalculateOutputImageProperties ()
 Validates the properties and set datatype where it was not set, should only be called by the Host!

Friends

class Host
 the host may access some methods that are otherwise not available

Deprecated

static const char *const pageAllocationMemoryProfileKey
 Static keys for the profiling manager.
static const char *const pageCacheHitsCountProfileKey
static const char *const pageCacheMissesCountProfileKey
MLint getOutIndex () const
bool isUpToDate () const
void setUpToDate ()
void setOutOfDate ()
MLEXPORT bool isGlobalDummyImage ()
 Returns if this image is the global dummy image.
void setImgExt (const ImageVector &ext)
void setImgExt (const SubImageBox &box)
void clearPageListAndMemoryImg ()
MLEXPORT BaseOpgetBaseOp () const
void setImgProps (const PagedImage &imgProps)
void setPageExt (const ImageVector &pageExt)
const PagedImagegetInImg (int index) const
ImageVector getPageSetExt () const
ImageVector getPageExt () const
MemoryImagegetMemoryImg ()
const MemoryImagegetMemoryImg () const
size_t getPageMemorySize () const
void setInSubImageDataType (int inputIndex, MLDataType datatype)
void setInSubImageIsReadOnly (int inputIndex, bool readOnly)
void setInSubImageUseMemoryImage (int inputIndex, bool useMemImg)
void setInSubImageScaleShift (int inputIndex, const ScaleShiftData &scaleShift)
const InputSubImagePropertiesgetInSubImageProps (int inputIndex) const
MLDataType getInSubImageDataType (int inputIndex) const
bool getInSubImageIsReadOnly (int inputIndex) const

Detailed Description

Class which represents an image, which manages properties of an image and image data which is located in pages.

Definition at line 68 of file mlPagedImage.h.


Constructor & Destructor Documentation

MLEXPORT ml::PagedImage::PagedImage ( Module module = NULL,
MLint  outputIndex = -1 
)

Constructor.

Parameters:
moduleis the Module instance which uses this paged image inside of one of its output connectors, default is NULL.
outputIndexis the index of the output connector of module which contains *this; default is -1. Note: module and outputIndex are only used by getTile/freeTile methods. If they are not used, the default parameters can be used.
virtual MLEXPORT ml::PagedImage::~PagedImage ( ) [virtual]

Destructor.

Remove all pages and reset corresponding memory image if it is controlled by the ML.


Member Function Documentation

MLEXPORT void ml::PagedImage::calculateImageProperties ( ) [protected]

Updates the image properties via the Module::calculateOutputImageProperties or via CalculateOutputImagePropertiesCB if it is set.

MLEXPORT void ml::PagedImage::clearPageList ( )

Remove all pages of the page image and from the ML cache, and all page data chunks are freed, if not referenced by a memory block handle elsewhere.

After this call holds getPage(ID)=0 for all pages of the image.

MLEXPORT void ml::PagedImage::clearPageListAndMemoryImage ( )

Remove all pages of the page image and from the ML cache, and all page data chunks are freed.

Pages are also removed if they are locked pages. After this call holds getPage(ID)=0 for all pages of the image. It also clears the memoryImg if the memoryImg mode is adequate.

void ml::PagedImage::clearPageListAndMemoryImg ( ) [inline]
Deprecated:
Use clearPageListAndMemoryImage() instead.

Definition at line 673 of file mlPagedImage.h.

MLEXPORT void ml::PagedImage::copyPages ( const std::vector< MLint > &  pageIDs,
SubImage subImage,
const ScaleShiftData scaleShiftData = ScaleShiftData() 
) const

Fills the subImage with contents of the Pages with the IDs pagesIDs The grey values become according to the Pages the parameters scaleShiftData.

(class ScaleShiftData) linear transformation. Remark:

  • by the linear transformation of the grey values before copying, one can avoid the overflows by type Casting.
  • for the default value of scaleShiftData applies for scaleShiftData.getScale()==1 and scaleShiftData.getShift()==0. Thus the grey value transformation does not cause anything and a copying with a special routine is more efficiently implemented.
MLEXPORT void ml::PagedImage::deletePageEntryFromDeletionCallback ( PagedImageExtendedPageEntry *  entry)

This method removes a page referenced by the page entry.

It removes the page entry of entry->pageId only if the stored pointer in the page entry map is the same as entry. It finally deletes the page entry.

MLEXPORT void ml::PagedImage::freeTile ( void *  data)

Same as corresponding Host::freeTile(void *data).

MLEXPORT BaseOp* ml::PagedImage::getBaseOp ( ) const
Deprecated:
Use getModule() instead.
MLint ml::PagedImage::getBypassIndex ( ) const [inline]

Returns the index of the input image whose pages should be used instead of the pages of this image or -1 if bypassing is disabled.

Definition at line 256 of file mlPagedImage.h.

MLEXPORT PagedImage& ml::PagedImage::getBypassSourceImage ( )

Returns the reference to the source image of a bypass chain.

MLEXPORT size_t ml::PagedImage::getCachedPagesSizeInBytes ( ) const

Returns currently used cache size for pages in bytes.

CalculateOutputImageHandler* ml::PagedImage::getCalculateOutputImageHandler ( ) const [inline]

Returns the pointer to the output image calculation interface.

Definition at line 99 of file mlPagedImage.h.

MLuint32 ml::PagedImage::getID ( ) [inline]

Returns the current image id (which changes whenever the image changes and which is unique accross all images)

Definition at line 115 of file mlPagedImage.h.

const PagedImage* ml::PagedImage::getInImg ( int  index) const [inline]
Deprecated:
Use getInputImage() instead.

Definition at line 685 of file mlPagedImage.h.

MLint ml::PagedImage::getInPlaceIndex ( ) const [inline]

Return optimization flag: Return index of input image whose input tile is used also as output page in calculateOutputSubImage() (instead of allocating its own memory).

If inplace calculation is off then -1 is returned. Using inplace require that page extent and voxel data type remain unchanged or errors will occur or that the ML will disable inplace calculations automatically in some cases.

Definition at line 352 of file mlPagedImage.h.

MLEXPORT const PagedImage* ml::PagedImage::getInputImage ( int  inputIndex) const

Returns the input image at inputIndex of the associated Module.

MLEXPORT MLDataType ml::PagedImage::getInputSubImageDataType ( int  inputIndex) const

Returns the input sub image data type for the input image at inputIndex.

MLEXPORT bool ml::PagedImage::getInputSubImageIsReadOnly ( int  inputIndex) const

Returns if input sub image at inputIndex is set to 'read-only'.

const InputSubImageProperties& ml::PagedImage::getInputSubImageProperties ( int  inputIndex) const [inline]

Returns a const reference to the InputSubImageProperties of the given input image at inputIndex.

Indexes outside the bounds of 0-Module::getNumInputs()-1 will be handled fatally.

Definition at line 406 of file mlPagedImage.h.

References mlrange_cast().

MLDataType ml::PagedImage::getInSubImageDataType ( int  inputIndex) const [inline]
Deprecated:
Use getInputSubImageDataType() instead.

Definition at line 718 of file mlPagedImage.h.

bool ml::PagedImage::getInSubImageIsReadOnly ( int  inputIndex) const [inline]
Deprecated:
Use getInputSubImageIsReadOnly() instead.

Definition at line 721 of file mlPagedImage.h.

const InputSubImageProperties& ml::PagedImage::getInSubImageProps ( int  inputIndex) const [inline]
Deprecated:
Use getInputSubImageProperties() instead.

Definition at line 715 of file mlPagedImage.h.

const MemoryImage& ml::PagedImage::getMemoryImage ( ) const [inline]

Definition at line 292 of file mlPagedImage.h.

MemoryImage& ml::PagedImage::getMemoryImage ( ) [inline]

Permits the access to a memory cached output of the paged image.

It can be used by the module and by the host for caching the paged image. Who controls this image is defined by _memoryImage.

Definition at line 291 of file mlPagedImage.h.

MemoryImage& ml::PagedImage::getMemoryImg ( ) [inline]
Deprecated:
Use getMemoryImage() instead.

Definition at line 694 of file mlPagedImage.h.

const MemoryImage& ml::PagedImage::getMemoryImg ( ) const [inline]
Deprecated:
Use getMemoryImage() instead.

Definition at line 697 of file mlPagedImage.h.

MLEXPORT MLMetaProfilePtr& ml::PagedImage::getMetaProfile ( ) const

Returns the MLMetaProfile for this paged image. Creates it if necessary.

Module* ml::PagedImage::getModule ( ) const [inline]

Returns the associated Module instance if passed to the constructor, NULL otherwise.

Definition at line 266 of file mlPagedImage.h.

MLint ml::PagedImage::getOutIndex ( ) const [inline]

Definition at line 646 of file mlPagedImage.h.

MLint ml::PagedImage::getOutputIndex ( ) const [inline]

Returns associated output index of Module instance if passed to constructor, -1 otherwise.

Definition at line 272 of file mlPagedImage.h.

MLEXPORT MLMemoryBlockHandle ml::PagedImage::getPage ( MLint  pageID) const

Returns the pointer to the CachedBuffer containing the data of the page with the id pageID.

MLEXPORT SubImageBox ml::PagedImage::getPageBox ( MLint  pageID) const

Returns the rectangular region in the entire image covered by the page with the id pageID.

static MLEXPORT MLuint32 ml::PagedImage::getPageCountLimitToUsePageEntryMap ( ) [inline, static]

Returns the limit of number of pages for using the page entry map instead of the page list.

Definition at line 485 of file mlPagedImage.h.

ImageVector ml::PagedImage::getPageExt ( ) const [inline]
Deprecated:
Use getPageExtent() instead.

Definition at line 691 of file mlPagedImage.h.

ImageVector ml::PagedImage::getPageExtent ( ) const [inline]

Returns the extent of a page.

Definition at line 281 of file mlPagedImage.h.

MLint ml::PagedImage::getPageID ( const ImageVector voxelPosition) const [inline]

Returns the id of that page which contains the image voxel position voxelPosition.

Definition at line 284 of file mlPagedImage.h.

MLEXPORT void ml::PagedImage::getPageIDs ( std::vector< MLint > &  pageIDs,
const SubImageBox subImageBox 
) const

Clears pageIDs and inserts the ids of all pages which need to be calculated to cover subImageBox completely.

static MLEXPORT void ml::PagedImage::getPageIDs ( std::vector< MLint > &  pageIDs,
const SubImageBox subImageBox,
const ImageVector imageExtent,
const ImageVector pageExtent 
) [static]

Clears pageIDs and inserts the ids of all pages which need to be calculated to cover subImageBox completely.

Static version of the upper method which also requires the extent of the image given by imageExtent and the extent of the pages pageExtent.

size_t ml::PagedImage::getPageMemorySize ( ) const [inline]
Deprecated:
Use getCachedPagesSizeInBytes() instead.

Definition at line 700 of file mlPagedImage.h.

MLEXPORT MLMemoryBlockHandle ml::PagedImage::getPageOrPendingRequest ( MLint  pageID,
PageRequest **  pendingRequest 
) const

Returns the valid page handle if it exists and otherwise returns if there is a pending PageRequest that is going to calculate this page later on and may be shared (pendingRequest may NOT be NULL).

ImageVector ml::PagedImage::getPageSetExt ( ) const [inline]
Deprecated:
Use getPageSetExtent() instead.

Definition at line 688 of file mlPagedImage.h.

ImageVector ml::PagedImage::getPageSetExtent ( ) const [inline]

Returns the extents of the page set covering the entire image extents.

Definition at line 275 of file mlPagedImage.h.

ImageVector ml::PagedImage::getPageStride ( ) const [inline]

Returns the stride to get from one page to another.

Definition at line 278 of file mlPagedImage.h.

virtual MLEXPORT MLErrorCode ml::PagedImage::getStateInfoErrorCode ( ) const [virtual]

Returns the current state information as MLError code which might explain something about the state of this instance.

virtual MLEXPORT const std::string& ml::PagedImage::getStateInfoString ( ) const [virtual]

Returns the current state information string which might explain something about the state of this instance.

MLEXPORT MLErrorCode ml::PagedImage::getTile ( SubImage subImage,
const ScaleShiftData scaleShiftData = ScaleShiftData() 
)

See Host::getTile( module, outputIndex, subImg, scaleShiftData).

The call of this method requires that valid module and outputIndex parameters have been passed to the constructor. This is true if this instance is part of an output connector of a Module.

MLEXPORT MLErrorCode ml::PagedImage::getTile ( SubImageBox  location,
MLDataType  dataType,
void **  data,
const ScaleShiftData scaleShiftData = ScaleShiftData() 
)

See Host::getTile( module, outputIndex, location, dataType, data, scaleShiftData).

The call of this method requires that valid module and outputIndex parameters have been passed to the constructor. This is true if this instance is part of an output connector of a Module.

Referenced by ml::getInputAsItkImportImageAndSubImg().

bool ml::PagedImage::hasExternalCalculateOutputImageHandler ( ) const [inline]

Returns if the CalculateOutputImageHandler is an external handler and should not be overwritten.

Definition at line 106 of file mlPagedImage.h.

MLEXPORT void ml::PagedImage::initializeInputSubImageProperties ( MLint  numInputs) [protected]

Initializes the InSubImageProps for a given number of inputs, should only be called by the Host!

MLEXPORT bool ml::PagedImage::isGlobalDummyImage ( )

Returns if this image is the global dummy image.

Deprecated:
Do not use it.
bool ml::PagedImage::isUpToDate ( ) const [inline]

Definition at line 650 of file mlPagedImage.h.

bool ml::PagedImage::isValid ( ) const [inline]

Returns whether image properties are valid and up-to-date.

The default of a new instance is false. The validity is changed only by the methods setValid() and setInvalid(), all other functions/ methods do not change the valid state of the instance.

Definition at line 129 of file mlPagedImage.h.

Referenced by ml::internal::TypedHandlerBase< ProcessAllPagesHandler, Derived, NumberOfInputImages >::verifyProperties().

ml::PagedImage::ML_FRIEND_TEST ( PagedImageDeprecationTest  ,
DeprecatedAPI   
)
ml::PagedImage::ML_FRIEND_TEST ( PagedImageDeprecationTest  ,
NewAPI   
)
MLEXPORT void ml::PagedImage::printPageData ( MLint  pageID,
std::ostream &  ostr 
) const

Prints the data contents of the page with the pageID to ostr.

MLEXPORT void ml::PagedImage::printPages ( std::ostream &  ostr) const

Makes a print of all pages.

Prints a "1" for each valid page, and "0" for invalid ones. Prints it to the passed stream ostr.

MLEXPORT void ml::PagedImage::removePage ( MLint  pageID)

This method removes a page with id pageID from this instance.

If it is no more referenced by another memory block handle, it is freed immediately.

void ml::PagedImage::setBypassIndex ( MLint  index) [inline]

Sets the index of the input image whose pages should be used instead of the pages of this image.

The index = -1 disables the option to find pages also in an input image. Bypassing requires that image (data) content, image extent, page extent and voxel data type remain unchanged or errors will occur.

Definition at line 252 of file mlPagedImage.h.

MLEXPORT void ml::PagedImage::setCalculateOutputImageHandler ( CalculateOutputImageHandler handler)

Sets the pointer to the output image calculation interface handler, the ownership is passed to the PagedImage.

MLEXPORT void ml::PagedImage::setCalculateOutputImagePropertiesCB ( CalculateOutputImagePropertiesCB callback,
void *  userData 
)

Sets the callback and userdata for the calculation of the properties of this PagedImage if they need to be updated.

MLEXPORT void ml::PagedImage::setExternalCalculateOutputImageHandler ( CalculateOutputImageHandler handler)

Sets the pointer to the output image calculation interface handler, the ownership is NOT passed to the PagedImage and it is not overwritten by Host::updateImageProperties().

void ml::PagedImage::setImageExtent ( MLint  x,
MLint  y,
MLint  z = 1,
MLint  c = 1,
MLint  t = 1,
MLint  u = 1 
) [inline]

Sets the extents of the image to the extent (x,y,z,c,t,u) and clears the list of valid pages and its content.

The default value for missing dimensions is 1.

Definition at line 163 of file mlPagedImage.h.

References ml::ImageVector, and ml::ImageProperties::setImageExtent().

void ml::PagedImage::setImageExtent ( const SubImageBox box) [inline]

Sets the extents of the image to box.getExtent() and updates all PagedImage settings.

The list of valid pages and its content are cleared.

Definition at line 170 of file mlPagedImage.h.

References ml::TSubImageBox< intT >::getExtent(), and setImageExtent().

Referenced by setImageExtent().

virtual MLEXPORT void ml::PagedImage::setImageExtent ( const ImageVector extent) [virtual]

Sets the extents of the image to extent. The list of valid pages and its content are cleared.

Reimplemented from ml::ImageProperties.

virtual MLEXPORT void ml::PagedImage::setImageProperties ( const PagedImage imageProperties) [virtual]

Function to copy all associated characteristics from imageProperties.

Inherited image characteristics as well as all MedicalImageProperties. Note that it usually does only properties and not page or image contents. The list of valid pages and its content are cleared and virgin.

Referenced by ml::MLImageFormatInfos::reset().

void ml::PagedImage::setImgExt ( const SubImageBox box) [inline]
Deprecated:
Use setImageExtent() instead.

Definition at line 670 of file mlPagedImage.h.

References ml::ImageProperties::setImageExtent().

void ml::PagedImage::setImgExt ( const ImageVector ext) [inline]
Deprecated:
Use setImageExtent() instead.

Reimplemented from ml::ImageProperties.

Definition at line 667 of file mlPagedImage.h.

References ml::ImageProperties::setImageExtent().

void ml::PagedImage::setImgProps ( const PagedImage imgProps) [inline]
void ml::PagedImage::setInPlaceIndex ( MLint  inputIndex) [inline]

Set optimization flag: If calculating a page in calculateOutputSubImage() the output image page shall use the same memory as the input page at inputIndex.

So less allocations occur and the read and written buffer are identical. Usually only useful for pixel operations or algorithms which do not modify the image data. Using inplace require that page extent and voxel data type remain unchanged or errors will occur or that the ML will disable inplace calculations automatically in some cases.

Definition at line 343 of file mlPagedImage.h.

MLEXPORT void ml::PagedImage::setInputSubImageDataType ( int  inputIndex,
MLDataType  dataType 
)

The following methods allow to define the properties of the input subimages that are passed to the Module::calculateOutputSubImage().

The default behavior is to provide all input subimages in the datatype of the output image. Using the methods below, this behavior can be modified, to e.g., use the input iamge datatype for the input subimages. Sets the dataType for the given inputIndex. If this method is not called, the default is the output data type (getDataType()) after the Module::calculateOutputImageProperties() call. Note that your algorithm in Module::calculateOutputSubImage has to support different data types for in- and output subimages if you change the data type. NOTE: This should only be called from within Module::calculateOutputImageProperties().

MLEXPORT void ml::PagedImage::setInputSubImageIsReadOnly ( int  inputIndex,
bool  readOnly 
)

Sets that the input sub image for the input image at inputIndex to readOnly.

This means it is not allowed to write to this input sub image in Module::calculateOutputSubImage(). To ensure that your module supports this, you should use a "const TSubImage" to ensure that the data is only accessed via const pointers. For the Host to make usage of this, the SubImageBox of the input subimage needs to match that of an input page, otherwise the input data needs to be copied anyways. NOTE: This should only be called from within Module::calculateOutputImageProperties().

MLEXPORT void ml::PagedImage::setInputSubImageScaleShift ( int  inputIndex,
const ScaleShiftData scaleShift 
)

Sets that the input sub image for the input image at inputIndex should be rescaled with the given scaleShift data The default is to not shift/scale at all.

NOTE: This should only be called from within Module::calculateOutputImageProperties().

MLEXPORT void ml::PagedImage::setInputSubImageUseMemoryImage ( int  inputIndex,
bool  useMemoryImage 
)

Sets that the input sub image for the input image at inputIndex should use a memory image (this implicitly sets setInSubImageIsReadOnly() to true as well).

This is turned off on default. When requesting this, make sure that you return the complete input image box in Module::calculateInputSubImageBox(). If this is set to true and the input module does not control its memory image itself then the host saves the input volume in the memory output of the input image. So the input tile does not have to be calculated many times if many modules request it. So a significant memory and performance gain may result if many connected modules request the same output page and at least one of them enables this flag. NOTE: Use the flag useMemoryImage only if really necessary, because it usually assumes that the entire input image is cached at the output of the input module. This breaks the page based image processing and may require a lot of memory. Also it requests the entire input image through predecessor modules which may use a lot of processing time. NOTE: This should only be called from within Module::calculateOutputImageProperties().

void ml::PagedImage::setInSubImageDataType ( int  inputIndex,
MLDataType  datatype 
) [inline]
Deprecated:
Use setInputSubImageDataType() instead.

Definition at line 703 of file mlPagedImage.h.

void ml::PagedImage::setInSubImageIsReadOnly ( int  inputIndex,
bool  readOnly 
) [inline]
Deprecated:
Use setInputSubImageIsReadOnly() instead.

Definition at line 706 of file mlPagedImage.h.

void ml::PagedImage::setInSubImageScaleShift ( int  inputIndex,
const ScaleShiftData scaleShift 
) [inline]
Deprecated:
Use setInputSubImageScaleShift() instead.

Definition at line 712 of file mlPagedImage.h.

void ml::PagedImage::setInSubImageUseMemoryImage ( int  inputIndex,
bool  useMemImg 
) [inline]
Deprecated:
Use setInputSubImageUseMemoryImage() instead.

Definition at line 709 of file mlPagedImage.h.

void ml::PagedImage::setInvalid ( ) [inline]

Sets image properties invalid, i.e., isValid() returns false afterwards.

Definition at line 137 of file mlPagedImage.h.

Referenced by ml::internal::TypedHandlerBase< ProcessAllPagesHandler, Derived, NumberOfInputImages >::verifyProperties().

void ml::PagedImage::setOutOfDate ( ) [inline]

Definition at line 658 of file mlPagedImage.h.

MLEXPORT void ml::PagedImage::setPage ( MLint  pageID,
const MLMemoryBlockHandle page 
)

Sets the given page handle as pagedata at pageID.

static MLEXPORT void ml::PagedImage::setPageCountLimitToUsePageEntryMap ( MLuint32  limit) [inline, static]

Sets the limit of number of pages for using the page entry map instead of the page list.

Definition at line 482 of file mlPagedImage.h.

void ml::PagedImage::setPageExt ( const ImageVector pageExt) [inline]
Deprecated:
Use setPageExtent() instead.

Definition at line 682 of file mlPagedImage.h.

MLEXPORT void ml::PagedImage::setPageExtent ( const ImageVector pageExtent)

Sets the extents of the pages to pageExtent.

void ml::PagedImage::setPageExtent ( MLint  x,
MLint  y,
MLint  z = 1,
MLint  c = 1,
MLint  t = 1,
MLint  u = 1 
) [inline]

Sets the extents of the pages to the extent (x,y,z,c,t,u).

The default value for missing dimensions is 1.

Definition at line 183 of file mlPagedImage.h.

References ml::ImageVector.

MLEXPORT void ml::PagedImage::setPageRequest ( MLint  pageID,
PageRequest request 
)

Sets a page request for a given page (or clear it by passing NULL).

virtual MLEXPORT void ml::PagedImage::setStateInfo ( const std::string &  info,
MLErrorCode  errorCode 
) [virtual]

Sets the state information for this PagedImage to the string info and the MLErrorCode errorCode.

Calling this method only changes the state information, but no data or validity of the instance itself. This method can be called by module programmers in calculateOutputImageProperties() to describe why they invalidated the module output.

Referenced by ml::internal::TypedHandlerBase< ProcessAllPagesHandler, Derived, NumberOfInputImages >::verifyProperties().

virtual MLEXPORT void ml::PagedImage::setStateInfoErrorCode ( MLErrorCode  errorCode) [virtual]

Sets the state information as MLErrorCode errorCode for this instance.

It also sets the stateInfoString to the corresponding MLErrorCode. Calling this method only changes the state information, but no data or validity of the instance itself. This method can be called by module programmers in calculateOutputImageProperties() to describe why they invalidated the module output.

MLEXPORT void ml::PagedImage::setUpdateOfImagePropertiesNeeded ( bool  flag)

Sets if the update of the image properties is needed, because the ML graph has changed since the last update.

This sets the isOutOfDate() flag as well if set to true.

void ml::PagedImage::setUpToDate ( ) [inline]

Definition at line 654 of file mlPagedImage.h.

void ml::PagedImage::setValid ( bool  flag = true) [inline]

Sets image properties to valid/up-to-date, i.e., isValid() returns true afterwards.

Definition at line 133 of file mlPagedImage.h.

void ml::PagedImage::updateID ( ) [inline]

Sets that the image has changed.

Definition at line 118 of file mlPagedImage.h.

MLEXPORT MLErrorCode ml::PagedImage::updateImageProperties ( )

Updates the image properties of the PagedImage using the Host::updateImageProperties method.

MLEXPORT bool ml::PagedImage::updateOfImagePropertiesNeeded ( ) const [inline]

Gets if the update of the image properties is needed, because the ML graph has changed since the last update.

Definition at line 145 of file mlPagedImage.h.

MLEXPORT void ml::PagedImage::validateInputSubImagePropertiesAfterCalculateOutputImageProperties ( ) [protected]

Validates the properties and set datatype where it was not set, should only be called by the Host!


Friends And Related Function Documentation

friend class Host [friend]

the host may access some methods that are otherwise not available

Definition at line 74 of file mlPagedImage.h.


Member Data Documentation

Static keys for the profiling manager.

Definition at line 639 of file mlPagedImage.h.

Definition at line 640 of file mlPagedImage.h.

Definition at line 641 of file mlPagedImage.h.


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