diff --git a/Modules/Core/include/mitkImageDataItem.h b/Modules/Core/include/mitkImageDataItem.h
index 02780abe89..6f06aa77fa 100644
--- a/Modules/Core/include/mitkImageDataItem.h
+++ b/Modules/Core/include/mitkImageDataItem.h
@@ -1,167 +1,167 @@
 /*===================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center,
 Division of Medical and Biological Informatics.
 All rights reserved.
 
 This software is distributed WITHOUT ANY WARRANTY; without
 even the implied warranty of MERCHANTABILITY or FITNESS FOR
 A PARTICULAR PURPOSE.
 
 See LICENSE.txt or http://www.mitk.org for details.
 
 ===================================================================*/
 
 #ifndef IMAGEDATAITEM_H
 #define IMAGEDATAITEM_H
 
 #include "mitkCommon.h"
 #include <MitkCoreExports.h>
 //#include <mitkIpPic.h>
 //#include "mitkPixelType.h"
 #include "mitkImageDescriptor.h"
 //#include "mitkImageVtkAccessor.h"
 
 class vtkImageData;
 
 namespace mitk
 {
   class PixelType;
   class ImageVtkReadAccessor;
   class ImageVtkWriteAccessor;
 
   class Image;
 
   //##Documentation
   //## @brief Internal class for managing references on sub-images
   //##
   //## ImageDataItem is a container for image data which is used internal in
   //## mitk::Image to handle the communication between the different data types for images
   //## used in MITK (ipPicDescriptor, mitk::Image, vtkImageData). Common for these image data
   //## types is the actual image data, but they differ in representation of pixel type etc.
   //## The class is also used to convert ipPic images to vtkImageData.
   //##
   //## The class is mainly used to extract sub-images inside of mitk::Image, like single slices etc.
   //## It should not be used outside of this.
   //##
   //## @param manageMemory Determines if image data is removed while destruction of ImageDataItem or not.
   //## @ingroup Data
   class MITKCORE_EXPORT ImageDataItem : public itk::LightObject
   {
     friend class ImageAccessorBase;
     friend class ImageWriteAccessor;
     friend class ImageReadAccessor;
 
     template <class TPixel, unsigned int VDimension>
     friend class ImagePixelAccessor;
 
     friend class Image;
 
     //  template<class TOutputImage>
     //  friend class ImageToItk;
 
   public:
     typedef itk::SmartPointer<mitk::Image> ImagePointer;
     typedef itk::SmartPointer<const mitk::Image> ImageConstPointer;
 
     mitkClassMacroItkParent(ImageDataItem, itk::LightObject);
 
     itkCloneMacro(ImageDataItem);
     itk::LightObject::Pointer InternalClone() const override;
 
     ImageDataItem(const ImageDataItem &aParent,
                   const mitk::ImageDescriptor::Pointer desc,
                   int timestep,
                   unsigned int dimension,
                   void *data = nullptr,
                   bool manageMemory = false,
                   size_t offset = 0);
 
     ~ImageDataItem() override;
 
     ImageDataItem(const mitk::ImageDescriptor::Pointer desc, int timestep, void *data, bool manageMemory);
 
     ImageDataItem(const mitk::PixelType &type,
                   int timestep,
                   unsigned int dimension,
                   unsigned int *dimensions,
                   void *data,
                   bool manageMemory);
 
     ImageDataItem(const ImageDataItem &other);
 
     /**
     \deprecatedSince{2012_09} Please use image accessors instead: See Doxygen/Related-Pages/Concepts/Image. This method
     can be replaced by ImageWriteAccessor::GetData() or ImageReadAccessor::GetData() */
     DEPRECATED(void *GetData() const) { return m_Data; }
     bool IsComplete() const { return m_IsComplete; }
     void SetComplete(bool complete) { m_IsComplete = complete; }
     int GetOffset() const { return m_Offset; }
     PixelType GetPixelType() const { return *m_PixelType; }
     void SetTimestep(int t) { m_Timestep = t; }
     void SetManageMemory(bool b) { m_ManageMemory = b; }
     int GetDimension() const { return m_Dimension; }
     int GetDimension(int i) const
     {
       int returnValue = 0;
 
       // return the true size if dimension available
       if (i < (int)m_Dimension)
         returnValue = m_Dimensions[i];
 
       return returnValue;
     }
 
     ImageDataItem::ConstPointer GetParent() const { return m_Parent; }
     /**
      * @brief GetVtkImageAccessor Returns a vtkImageDataItem, if none is present, a new one is constructed by the
      * ConstructVtkImageData method.
      *                            Due to historical development of MITK and VTK, the vtkImage origin is explicitly set
      * to
      * (0, 0, 0) for 3D images.
      *                            See bug 5050 for detailed information.
      * @return Pointer of type ImageVtkReadAccessor
      */
     ImageVtkReadAccessor *GetVtkImageAccessor(ImageConstPointer) const;
     ImageVtkWriteAccessor *GetVtkImageAccessor(ImagePointer);
 
     // Returns if image data should be deleted on destruction of ImageDataItem.
     bool GetManageMemory() const { return m_ManageMemory; }
     virtual void ConstructVtkImageData(ImageConstPointer) const;
 
-    unsigned long GetSize() const { return m_Size; }
+    size_t GetSize() const { return m_Size; }
     virtual void Modified() const;
 
   protected:
     unsigned char *m_Data;
 
     PixelType *m_PixelType;
 
     bool m_ManageMemory;
 
     mutable vtkImageData *m_VtkImageData;
     mutable ImageVtkReadAccessor *m_VtkImageReadAccessor;
     ImageVtkWriteAccessor *m_VtkImageWriteAccessor;
     int m_Offset;
 
     bool m_IsComplete;
 
-    unsigned long m_Size;
+    size_t m_Size;
 
   private:
     void ComputeItemSize(const unsigned int *dimensions, unsigned int dimension);
 
     ImageDataItem::ConstPointer m_Parent;
 
     unsigned int m_Dimension;
 
     unsigned int m_Dimensions[MAX_IMAGE_DIMENSIONS];
 
     int m_Timestep;
   };
 
 } // namespace mitk
 
 #endif /* IMAGEDATAITEM_H */
diff --git a/Modules/Core/test/mitkImageDataItemTest.cpp b/Modules/Core/test/mitkImageDataItemTest.cpp
index b332e9eca7..735c88d1ae 100644
--- a/Modules/Core/test/mitkImageDataItemTest.cpp
+++ b/Modules/Core/test/mitkImageDataItemTest.cpp
@@ -1,32 +1,74 @@
 /*===================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center,
 Division of Medical and Biological Informatics.
 All rights reserved.
 
 This software is distributed WITHOUT ANY WARRANTY; without
 even the implied warranty of MERCHANTABILITY or FITNESS FOR
 A PARTICULAR PURPOSE.
 
 See LICENSE.txt or http://www.mitk.org for details.
 
 ===================================================================*/
 
-#include "mitkImage.h"
-#include "mitkImageDataItem.h"
+#include <array>
 
-#include <fstream>
-int mitkImageDataItemTest(int /*argc*/, char * /*argv*/ [])
+#include "mitkTestFixture.h"
+#include "mitkTestingMacros.h"
+
+#include <mitkImageDataItem.h>
+
+#include <mitkPixelType.h>
+#include <mitkImage.h>
+#include <mitkImagePixelWriteAccessor.h>
+
+class mitkImageDataItemTestSuite : public mitk::TestFixture
 {
-  auto pixels = new unsigned long[100];
-  void *data = pixels;
+  CPPUNIT_TEST_SUITE(mitkImageDataItemTestSuite);
+  MITK_TEST(TestAccessOnHugeImage);
+  CPPUNIT_TEST_SUITE_END();
+
+private:
+  mitk::Image::Pointer m_Image;
+
+public:
+  void setUp() override
+  {
+    m_Image = mitk::Image::New();
+    mitk::PixelType pixelType = mitk::MakeScalarPixelType<unsigned char>();
+
+    std::array<unsigned int, 3> dimensions = { 1700, 1700, 1700 };
+    m_Image->Initialize(pixelType, 3, dimensions.data());
+  }
+
+  void TestAccessOnHugeImage()
+  {
+    CPPUNIT_ASSERT(m_Image.IsNotNull());
+
+    try
+    {
+      mitk::ImagePixelWriteAccessor<unsigned char, 3> writeAccess(m_Image.GetPointer(), m_Image->GetVolumeData());
+
+      auto* voxelStart = writeAccess.GetData();
+      size_t imageSize = 1;
+      for (unsigned int i = 0; i < m_Image->GetDimension(); i++)
+        imageSize *= m_Image->GetDimension(i);
+
+      auto* voxelEnd = voxelStart + imageSize;
 
-  std::cout << "Testing pseudo-type independent deleting: ";
-  delete[](unsigned char *) data;
-  std::cout << "[PASSED]" << std::endl;
+      CPPUNIT_ASSERT(writeAccess.GetData() != nullptr);
+      auto* accessCheck = voxelEnd - 1;
+      *accessCheck = 1;
+    }
+    catch (const itk::MemoryAllocationError& e)
+    {
+      MITK_ERROR << e.what();
+      exit(77);
+    }
+  }
+};
 
-  std::cout << "[TEST DONE]" << std::endl;
-  return EXIT_SUCCESS;
-}
+MITK_TEST_SUITE_REGISTRATION(mitkImageDataItem)