25 #ifndef __mlVirtualVolume_H
26 #define __mlVirtualVolume_H
45 template<
class DATATYPE>
class TVirtualVolume;
47 class VirtualVolumeMemoryTracker;
77 bool areExceptionsOnFlag =
false);
91 bool areExceptionsOnFlag =
false);
120 inline bool isValid()
const {
return _valid; }
123 inline void invalidate() { _valid =
false; _cleanUpMemory(); }
156 void *getWrittenPageData(
MLuint32 wp);
162 void unMapAndClearWrittenPages();
179 void registerPageFunction(PageFunc pFunc,
void *userData);
207 void copyTileFromInputImage(
const SubImageBox &box,
219 void copyToSubImage(
SubImage &outSubImg);
229 void copyFromSubImg(
const SubImage &inImg,
241 BitImage *getUsedPagesMask(
bool enableMappedPages=
true,
242 bool enableWrittenPages=
true)
const;
246 void *createTypedVirtualVolume();
250 static void destroyTypedVirtualVolume(
void *tVV,
MLDataType dt);
258 #pragma warning(push)
259 #pragma warning(disable : 4996 )
304 bool areExceptionsOnFlag =
false,
305 bool useOutConnectors =
false);
319 #endif // ML_DEPRECATED
348 bool areExceptionsOnFlag =
false);
354 void _cleanUpMemory();
367 inline static void* _getPageCB(
PageBuffer *pageBuffer);
374 static void* _loadPageCB(
PageBuffer *pageBuffer);
383 void _updateWrittenPages();
402 long _getPowerOfTwo(
MLuint num)
const;
448 bool _areExceptionsOn;
473 MLuint _numPageArrayEntries;
512 VirtualVolumeMemoryTracker* _currentlyUsedMemoryTracker;
517 friend class VirtualVolumeMemoryTracker;
538 inline PageBuffer(): _virtVol(NULL), _page(NULL), _locked(false), _getPageFkt(NULL) { }
563 inline void* VirtualVolume::_getPageCB(
PageBuffer *pageBuffer) {
return pageBuffer->
_page; }
570 #endif // __mlVirtualVolume_H
VirtualVolume * _virtVol
Pointer to the virtual volume object.
SubImageBox _box
Box of original image mapped in this page.
void invalidate()
Invalidates state of virtual volume, e.g. after an error.
MLint32 MLDataType
MLDataType.
void copyToSubImg(SubImage &outSubImg)
Defines and implements management and access classes for random access to a paged image or a pure vir...
MLint getInputIndex() const
Returns the output index of the input baseOp or -1 if there is no input baseOp.
bool isValid() const
Returns true if instance is valid, otherwise false.
MLDataType getDataType() const
Return data type enum.
const ImageVector & getPageExt() const
ImageVector getExtent() const
Get extents of input volume.
MLuint64 MLuint
An unsigned ML integer type with at least 64 bits used for index calculations on very large images ev...
TScaleShiftData< MLdouble > ScaleShiftData
Double version of TScaleShiftData for maximum reasonable precision.
ImageVector getExt() const
ReturnPageFunc _getPageFkt
Pointer to function to return the page managed by the PageBuffer.
PageMapped
Enum which describes whether a page is mapped into the currently used page list or unmapped from used...
MLint getDim() const
Return dimension of specified volume.
MLuint getNumBytes()
Returns number of bytes currently allocated as pages in the virtual volume.
MLuint getNumWrittenPages()
Returns number of written (and therefore locked) pages.
Class which represents an image, which manages properties of an image and image data which is located...
The TVirtualVolume class implements random access to a paged input image or a pure virtual image with...
MLMemoryBlockHandle _memoryBlockHandle
The memory block handle for holding the page data locked.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
This class manages a virtual volume organizing efficient voxel access to the output image of an input...
MLuint getNumPages()
Returns number of all (mapped and written) pages.
const ImageVector & getPageExtent() const
Returns the extent of any written/read page used by the virtual volume.
ML_LINEAR_ALGEBRA_EXPORT typedef TImageVector< MLint > ImageVector
Defines the standard ImageVector type which is used by the ML for indexing and coordinates.
The strong handle of a MLMemoryBlock.
const ImageVector & getPageArrayExtent() const
Returns the extent of the array of page buffers.
Class to manage a binary image.
bool areExceptionsOn() const
Returns true if exception handling is enabled otherwise false.
Module * getModule() const
Returns the pointer to the module which contains the paged image the virtual volume is associated wit...
Overview documentation of the MLMemoryManager.
PageBuffer is a helper structure to manage one page of input data of the VirtualVolume class and it a...
PagedImage * getInputImage() const
Returns the pointer to the paged image the virtual volume is associated with.
#define ML_DEPRECATED_CONSTRUCTOR
const ImageVector & getPageArrayExt() const
void * _page
Pointer to the page data reduced by the offset to the page origin.
virtual ~VirtualVolume()
Destructor.
Enumerator for the unsigned 8 bit ML integer type.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
This file includes most files needed to implement new ML modules.
Base class for an image processing module of the ML.
PageBuffer()
Initialize the structure.
bool _locked
If true this page contains written data and must not be removed.
void copyTileFromInImg(const SubImageBox &box, PagedImage &image, const ImageVector &shift, const ScaleShiftData &scaleShift=ScaleShiftData())
PagedImage * getInImg() const
const SubImageBox & getBox() const
Get box extents of input volume.
MLuint getNumMappedPages() const
Returns number of currently mapped (volatile) pages. Written pages are counted only temporarily here...
This class manages/represents a rectangular 6d image region which is organized linearly in memory...