MCPcopy Create free account
hub / github.com/MITK/MITK / ImageAccessorBase

Method ImageAccessorBase

Modules/Core/src/DataManagement/mitkImageAccessorBase.cpp:41–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41mitk::ImageAccessorBase::ImageAccessorBase(ImageConstPointer image,
42 const ImageDataItem *imageDataItem,
43 int OptionFlags)
44 : // m_Image(iP)
45 //, imageDataItem(iDI)
46 m_SubRegion(nullptr),
47 m_Options(OptionFlags),
48 m_CoherentMemory(false)
49{
50 m_Thread = CurrentThreadHandle();
51
52 // Initialize WaitLock
53 m_WaitLock = new ImageAccessorWaitLock();
54 m_WaitLock->m_WaiterCount = 0;
55
56 // Check validity of ImageAccessor
57
58 // Is there an Image?
59 /*
60 if(!m_Image)
61 {
62 mitkThrow() << "Invalid ImageAccessor: No Image was specified in constructor of ImageAccessor";
63 }
64 */
65
66 if (image)
67 {
68 // Make sure, that the Image is initialized properly
69 if (image->m_Initialized == false)
70 {
71 if (image->GetSource().IsNull())
72 {
73 mitkThrow() << "ImageAccessor: No image source is defined";
74 }
75 image->m_ReadWriteLock.lock();
76 if (image->GetSource()->Updating() == false)
77 {
78 image->GetSource()->UpdateOutputInformation();
79 }
80 image->m_ReadWriteLock.unlock();
81 }
82 }
83
84 // Investigate 4 cases of possible image parts/regions
85
86 // Case 1: No ImageDataItem and no Subregion => Whole Image is accessed
87 if (imageDataItem == nullptr && m_SubRegion == nullptr)
88 {
89 m_CoherentMemory = true;
90
91 // Organize first image channel
92 image->m_ReadWriteLock.lock();
93 imageDataItem = image->GetChannelData();
94 image->m_ReadWriteLock.unlock();
95
96 // Set memory area
97 m_AddressBegin = imageDataItem->m_Data;
98 m_AddressEnd = (unsigned char *)m_AddressBegin + imageDataItem->m_Size;

Callers

nothing calls this directly

Calls 7

UpdatingMethod · 0.80
IsNullMethod · 0.45
GetSourceMethod · 0.45
lockMethod · 0.45
unlockMethod · 0.45
GetChannelDataMethod · 0.45

Tested by

no test coverage detected