1 /*===================================================================
3 The Medical Imaging Interaction Toolkit (MITK)
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 See LICENSE.txt or http://www.mitk.org for details.
15 ===================================================================*/
17 #ifndef _itkImportMitkImageContainer_txx
18 #define _itkImportMitkImageContainer_txx
20 #include "itkImportMitkImageContainer.h"
24 template <typename TElementIdentifier, typename TElement>
25 ImportMitkImageContainer<TElementIdentifier, TElement>::ImportMitkImageContainer() : m_imageAccess(nullptr)
29 template <typename TElementIdentifier, typename TElement>
30 ImportMitkImageContainer<TElementIdentifier, TElement>::~ImportMitkImageContainer()
32 if (m_imageAccess != nullptr)
34 m_imageAccess = nullptr;
38 template <typename TElementIdentifier, typename TElement>
40 ImportMitkImageContainer< TElementIdentifier , TElement >
41 ::SetImageDataItem(mitk::ImageDataItem* imageDataItem)
43 m_ImageDataItem = imageDataItem;
45 this->SetImportPointer( (TElement*) m_ImageDataItem->GetData(), m_ImageDataItem->GetSize()/sizeof(Element), false);
51 template <typename TElementIdentifier, typename TElement>
52 void ImportMitkImageContainer<TElementIdentifier, TElement>::SetImageAccessor(mitk::ImageAccessorBase *imageAccess,
55 m_imageAccess = imageAccess;
57 this->SetImportPointer((TElement *)m_imageAccess->GetData(), noOfBytes / sizeof(Element), false);
62 template <typename TElementIdentifier, typename TElement>
63 void ImportMitkImageContainer<TElementIdentifier, TElement>::PrintSelf(std::ostream &os, Indent indent) const
65 Superclass::PrintSelf(os, indent);
67 os << indent << "ImageAccessor: " << m_imageAccess << std::endl;
70 } // end namespace itk