Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::ImageAccessorBase Class Referenceabstract

#include <mitkImageAccessorBase.h>

Inheritance diagram for mitk::ImageAccessorBase:
Collaboration diagram for mitk::ImageAccessorBase:

Public Types

enum  Options { DefaultBehavior , ExceptionIfLocked , ForceCoherentMemory , IgnoreLock }
 Option flags that control ImageAccessor behavior. More...
 
typedef itk::SmartPointer< const mitk::Image > ImageConstPointer
 Const smart pointer type for the associated Image. More...
 

Public Member Functions

virtual ~ImageAccessorBase ()
 Virtual destructor. Releases the wait lock if no other accessors are waiting. More...
 
const void * GetData () const
 Get const access to the raw image data. More...
 

Protected Member Functions

 ImageAccessorBase (ImageConstPointer iP, const ImageDataItem *iDI=nullptr, int OptionFlags=DefaultBehavior)
 Checks validity of given parameters from inheriting classes and stores those parameters in member variables. More...
 
void Increment ()
 Increments m_WaiterCount. A call of this method is prohibited unless the Mutex m_ReadWriteLock in the mitk::Image class is Locked. More...
 
bool Overlap (const ImageAccessorBase *iAB)
 Computes if there is an Overlap of the image part between this instantiation and another ImageAccessor object. More...
 
void WaitForReleaseOf (ImageAccessorWaitLock *wL)
 Uses the WaitLock to wait for another ImageAccessor. More...
 
void PreventRecursiveMutexLock (ImageAccessorBase *iAB)
 Prevents a recursive mutex lock by comparing thread ids of competing image accessors. More...
 
virtual const Image * GetImage () const =0
 

Protected Attributes

itk::ImageRegion< 4 > * m_SubRegion
 
void * m_AddressBegin
 
void * m_AddressEnd
 
int m_Options
 Stores all extended properties of an ImageAccessor. The different flags in mitk::ImageAccessorBase::Options can be unified by bitwise operations. More...
 
bool m_CoherentMemory
 
ImageAccessorWaitLock * m_WaitLock
 Pointer to a WaitLock struct, that allows other ImageAccessors to wait for this ImageAccessor. More...
 
ThreadIDType m_Thread
 

Detailed Description

Definition at line 66 of file mitkImageAccessorBase.h.

Member Typedef Documentation

◆ ImageConstPointer

Const smart pointer type for the associated Image.

Definition at line 81 of file mitkImageAccessorBase.h.

Member Enumeration Documentation

◆ Options

Option flags that control ImageAccessor behavior.

These flags can be combined via bitwise OR and passed to accessor constructors.

Enumerator
DefaultBehavior 

Default behavior: wait for locked memory to be released.

ExceptionIfLocked 

Throw MemoryIsLockedException instead of waiting if the memory is locked.

ForceCoherentMemory 

Force the accessed memory to be coherent (contiguous). May cause additional memory allocation and data copying, potentially affecting performance.

IgnoreLock 

Bypass the lock mechanism for immediate access. Only valid for read accessors.

Definition at line 89 of file mitkImageAccessorBase.h.

Constructor & Destructor Documentation

◆ ~ImageAccessorBase()

virtual mitk::ImageAccessorBase::~ImageAccessorBase ( )
virtual

Virtual destructor. Releases the wait lock if no other accessors are waiting.

◆ ImageAccessorBase()

mitk::ImageAccessorBase::ImageAccessorBase ( ImageConstPointer  iP,
const ImageDataItem *  iDI = nullptr,
int  OptionFlags = DefaultBehavior 
)
protected

Checks validity of given parameters from inheriting classes and stores those parameters in member variables.

Member Function Documentation

◆ GetData()

const void* mitk::ImageAccessorBase::GetData ( ) const
inline

Get const access to the raw image data.

Returns
Pointer to the beginning of the accessed image memory region.

Definition at line 110 of file mitkImageAccessorBase.h.

◆ GetImage()

virtual const Image* mitk::ImageAccessorBase::GetImage ( ) const
protectedpure virtual

◆ Increment()

void mitk::ImageAccessorBase::Increment ( )
inlineprotected

Increments m_WaiterCount. A call of this method is prohibited unless the Mutex m_ReadWriteLock in the mitk::Image class is Locked.

Definition at line 154 of file mitkImageAccessorBase.h.

References mitk::ImageAccessorWaitLock::m_WaiterCount.

◆ Overlap()

bool mitk::ImageAccessorBase::Overlap ( const ImageAccessorBase *  iAB)
protected

Computes if there is an Overlap of the image part between this instantiation and another ImageAccessor object.

Exceptions
mitk::Exceptionif memory area is incoherent (not supported yet)

◆ PreventRecursiveMutexLock()

void mitk::ImageAccessorBase::PreventRecursiveMutexLock ( ImageAccessorBase *  iAB)
protected

Prevents a recursive mutex lock by comparing thread ids of competing image accessors.

◆ WaitForReleaseOf()

void mitk::ImageAccessorBase::WaitForReleaseOf ( ImageAccessorWaitLock *  wL)
protected

Uses the WaitLock to wait for another ImageAccessor.

Member Data Documentation

◆ m_AddressBegin

◆ m_AddressEnd

◆ m_CoherentMemory

bool mitk::ImageAccessorBase::m_CoherentMemory
protected

Defines if the accessed image part lies coherently in memory

Definition at line 147 of file mitkImageAccessorBase.h.

◆ m_Options

int mitk::ImageAccessorBase::m_Options
protected

Stores all extended properties of an ImageAccessor. The different flags in mitk::ImageAccessorBase::Options can be unified by bitwise operations.

Definition at line 144 of file mitkImageAccessorBase.h.

◆ m_SubRegion

itk::ImageRegion<4>* mitk::ImageAccessorBase::m_SubRegion
protected

ImageAccessor has access to the image it belongs to. Contains a SubRegion (always represented in maximal possible dimension)

Definition at line 133 of file mitkImageAccessorBase.h.

◆ m_Thread

ThreadIDType mitk::ImageAccessorBase::m_Thread
protected

Definition at line 164 of file mitkImageAccessorBase.h.

◆ m_WaitLock

ImageAccessorWaitLock* mitk::ImageAccessorBase::m_WaitLock
protected

Pointer to a WaitLock struct, that allows other ImageAccessors to wait for this ImageAccessor.

Definition at line 150 of file mitkImageAccessorBase.h.


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