13 #ifndef mitkImageAccessorBase_h
14 #define mitkImageAccessorBase_h
16 #include <itkImageRegion.h>
18 #include <itkSmartPointer.h>
62 #if defined(ITK_USE_SPROC) || defined(ITK_USE_PTHREADS) || defined(ITK_USE_WIN32_THREADS)
63 #define MITK_USE_RECURSIVE_MUTEX_PREVENTION
73 template <
class TPixel,
unsigned int VDimension>
76 template <
class TPixel,
unsigned int VDimension>
94 ExceptionIfLocked = 1,
97 ForceCoherentMemory = 2,
110 inline const void *
GetData()
const {
return m_AddressBegin; }
114 typedef int ThreadIDType;
117 #ifdef ITK_USE_WIN32_THREADS
118 typedef DWORD ThreadIDType;
121 #ifdef ITK_USE_PTHREADS
122 typedef pthread_t ThreadIDType;
173 ThreadIDType CurrentThreadHandle();
175 inline bool CompareThreadHandles(ThreadIDType, ThreadIDType);
Base class for all MITK exceptions.
virtual ~ImageAccessorBase()
Virtual destructor. Releases the wait lock if no other accessors are waiting.
void Increment()
Increments m_WaiterCount. A call of this method is prohibited unless the Mutex m_ReadWriteLock in the...
bool Overlap(const ImageAccessorBase *iAB)
Computes if there is an Overlap of the image part between this instantiation and another ImageAccesso...
const void * GetData() const
Get const access to the raw image data.
void WaitForReleaseOf(ImageAccessorWaitLock *wL)
Uses the WaitLock to wait for another ImageAccessor.
ImageAccessorWaitLock * m_WaitLock
Pointer to a WaitLock struct, that allows other ImageAccessors to wait for this ImageAccessor.
ImageAccessorBase(ImageConstPointer iP, const ImageDataItem *iDI=nullptr, int OptionFlags=DefaultBehavior)
Checks validity of given parameters from inheriting classes and stores those parameters in member var...
itk::SmartPointer< const mitk::Image > ImageConstPointer
Const smart pointer type for the associated Image.
itk::ImageRegion< 4 > * m_SubRegion
void PreventRecursiveMutexLock(ImageAccessorBase *iAB)
Prevents a recursive mutex lock by comparing thread ids of competing image accessors.
Options
Option flags that control ImageAccessor behavior.
int m_Options
Stores all extended properties of an ImageAccessor. The different flags in mitk::ImageAccessorBase::O...
virtual const Image * GetImage() const =0
Internal container for image data used by mitk::Image.
Gives locked and index-based read access for a particular image part.
Gives locked and index-based write access for a particular image part.
Provides locked read-only access to a particular region of image data.
Provides locked write access to a particular region of image data.
Image class for storing multi-dimensional medical image data.
#define mitkExceptionClassMacro(ClassName, SuperClassName)
Convenience macro for defining MITK exception subclasses.
Find image slices visible on a given plane.
Wait-lock structure allowing ImageAccessors to wait for each other.
std::mutex m_Mutex
Mutex that other ImageAccessors lock on to wait for this accessor.
unsigned int m_WaiterCount
Number of ImageAccessors waiting for this accessor to be released.