Medical Imaging Interaction Toolkit  2016.11.0
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 }
 defines different flags for the ImageAccessor constructors More...
 
typedef itk::SmartPointer< const mitk::ImageImageConstPointer
 

Public Member Functions

virtual ~ImageAccessorBase ()
 
const void * GetData () const
 Gives const access to the 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 ImageGetImage () 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
 
ImageAccessorWaitLockm_WaitLock
 Pointer to a WaitLock struct, that allows other ImageAccessors to wait for this ImageAccessor. More...
 
ThreadIDType m_Thread
 

Detailed Description

Definition at line 52 of file mitkImageAccessorBase.h.

Member Typedef Documentation

Member Enumeration Documentation

defines different flags for the ImageAccessor constructors

Enumerator
DefaultBehavior 

No specific Options ==> Default

ExceptionIfLocked 

Defines if the Constructor waits for locked memory until it is released or not. If not, an exception is thrown.

ForceCoherentMemory 

Defines if requested Memory has to be coherent. If the parameter is true, it is possible that new Memory has to be allocated to arrange this desired condition. Consequently, this parameter can heavily affect computation time.

IgnoreLock 

Ignores the lock mechanism for immediate access. Only possible with read accessors.

Definition at line 70 of file mitkImageAccessorBase.h.

Constructor & Destructor Documentation

mitk::ImageAccessorBase::~ImageAccessorBase ( )
virtual

Definition at line 41 of file mitkImageAccessorBase.cpp.

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.

Definition at line 45 of file mitkImageAccessorBase.cpp.

References m_AddressBegin, m_AddressEnd, m_CoherentMemory, mitk::ImageDataItem::m_Data, mitk::ImageDataItem::m_Size, m_SubRegion, m_Thread, mitk::ImageAccessorWaitLock::m_WaiterCount, m_WaitLock, and mitkThrow.

Member Function Documentation

virtual const Image* mitk::ImageAccessorBase::GetImage ( ) const
protectedpure virtual
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 133 of file mitkImageAccessorBase.h.

References mitk::ImageAccessorWaitLock::m_WaiterCount.

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)

Definition at line 131 of file mitkImageAccessorBase.cpp.

References m_AddressBegin, m_AddressEnd, and mitkThrow.

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

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

Definition at line 176 of file mitkImageAccessorBase.cpp.

References m_Thread, and mitkThrow.

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

Uses the WaitLock to wait for another ImageAccessor.

Definition at line 156 of file mitkImageAccessorBase.cpp.

References mitk::ImageAccessorWaitLock::m_Mutex, and mitk::ImageAccessorWaitLock::m_WaiterCount.

Member Data Documentation

bool mitk::ImageAccessorBase::m_CoherentMemory
protected

Defines if the accessed image part lies coherently in memory

Definition at line 126 of file mitkImageAccessorBase.h.

Referenced by ImageAccessorBase().

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 123 of file mitkImageAccessorBase.h.

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 112 of file mitkImageAccessorBase.h.

Referenced by ImageAccessorBase().

ThreadIDType mitk::ImageAccessorBase::m_Thread
protected

Definition at line 143 of file mitkImageAccessorBase.h.

Referenced by ImageAccessorBase(), and PreventRecursiveMutexLock().

ImageAccessorWaitLock* mitk::ImageAccessorBase::m_WaitLock
protected

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

Definition at line 129 of file mitkImageAccessorBase.h.

Referenced by ImageAccessorBase(), and mitk::ImageReadAccessor::ImageReadAccessor().


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