1 /*============================================================================
3 The Medical Imaging Interaction Toolkit (MITK)
5 Copyright (c) German Cancer Research Center (DKFZ)
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
11 ============================================================================*/
13 #ifndef _itkImportMitkImageContainer_txx
14 #define _itkImportMitkImageContainer_txx
16 #include "itkImportMitkImageContainer.h"
20 template <typename TElementIdentifier, typename TElement>
21 ImportMitkImageContainer<TElementIdentifier, TElement>::ImportMitkImageContainer() : m_imageAccess(nullptr)
25 template <typename TElementIdentifier, typename TElement>
26 ImportMitkImageContainer<TElementIdentifier, TElement>::~ImportMitkImageContainer()
28 if (m_imageAccess != nullptr)
30 m_imageAccess = nullptr;
34 template <typename TElementIdentifier, typename TElement>
36 ImportMitkImageContainer< TElementIdentifier , TElement >
37 ::SetImageDataItem(mitk::ImageDataItem* imageDataItem)
39 m_ImageDataItem = imageDataItem;
41 this->SetImportPointer( (TElement*) m_ImageDataItem->GetData(), m_ImageDataItem->GetSize()/sizeof(Element), false);
47 template <typename TElementIdentifier, typename TElement>
48 void ImportMitkImageContainer<TElementIdentifier, TElement>::SetImageAccessor(mitk::ImageAccessorBase *imageAccess,
51 m_imageAccess = imageAccess;
53 this->SetImportPointer((TElement *)m_imageAccess->GetData(), noOfBytes / sizeof(Element), false);
58 template <typename TElementIdentifier, typename TElement>
59 void ImportMitkImageContainer<TElementIdentifier, TElement>::PrintSelf(std::ostream &os, Indent indent) const
61 Superclass::PrintSelf(os, indent);
63 os << indent << "ImageAccessor: " << m_imageAccess << std::endl;
66 } // end namespace itk