|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Provides locked write access to a particular region of image data. More...
#include <mitkImageWriteAccessor.h>


Public Types | |
| typedef Image::Pointer | ImagePointer |
| Smart pointer type for the associated Image. More... | |
Public Types inherited from mitk::ImageAccessorBase | |
| 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 | |
| ImageWriteAccessor (ImagePointer image, const ImageDataItem *iDI=nullptr, int OptionFlags=ImageAccessorBase::DefaultBehavior) | |
| Construct a write accessor for a slice, volume, or entire image. More... | |
| void * | GetData () |
| Get a non-const pointer to the raw image data for writing. More... | |
| ~ImageWriteAccessor () override | |
| Destructor releases the write lock on the image data. More... | |
Public Member Functions inherited from mitk::ImageAccessorBase | |
| 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 | |
| const Image * | GetImage () const override |
Protected Member Functions inherited from mitk::ImageAccessorBase | |
| 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... | |
Additional Inherited Members | |
Protected Attributes inherited from mitk::ImageAccessorBase | |
| 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 |
Provides locked write access to a particular region of image data.
ImageWriteAccessor acquires an exclusive write lock on the specified image data region upon construction and releases it upon destruction (RAII pattern). While a write accessor exists, no other read or write accessor can access an overlapping region (they will either block or throw, depending on option flags).
Use GetData() to obtain a non-const pointer to the raw data for writing.
Definition at line 44 of file mitkImageWriteAccessor.h.
| typedef Image::Pointer mitk::ImageWriteAccessor::ImagePointer |
Smart pointer type for the associated Image.
Definition at line 51 of file mitkImageWriteAccessor.h.
| mitk::ImageWriteAccessor::ImageWriteAccessor | ( | ImagePointer | image, |
| const ImageDataItem * | iDI = nullptr, |
||
| int | OptionFlags = ImageAccessorBase::DefaultBehavior |
||
| ) |
Construct a write accessor for a slice, volume, or entire image.
| [in] | image | The image to access (must be non-const). |
| [in] | iDI | Optional ImageDataItem specifying the data region. If nullptr, the entire first channel is accessed. |
| [in] | OptionFlags | Combination of mitk::ImageAccessorBase::Options flags. |
| mitk::Exception | if construction parameters are invalid. |
| mitk::MemoryIsLockedException | if the region is exclusively locked and ExceptionIfLocked is set. |
|
override |
Destructor releases the write lock on the image data.
|
inline |
Get a non-const pointer to the raw image data for writing.
Definition at line 73 of file mitkImageWriteAccessor.h.
Referenced by mitk::ImageGenerator::GenerateImageFromReference(), and mitk::ImageGenerator::GenerateRandomImage().
|
overrideprotectedvirtual |
Implements mitk::ImageAccessorBase.
Referenced by mitk::ImagePixelWriteAccessor< TPixel, VDimension >::GetPixelByWorldCoordinates().