Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkBoundingObjectCutAndCast.txx
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITKBOUNDINGOBJECTCUTANDCAST_TXX
14 #define MITKBOUNDINGOBJECTCUTANDCAST_TXX
15 
16 #include "mitkBoundingObjectCutAndCast.h"
17 #include "mitkImage.h"
18 #include "mitkImageAccessByItk.h"
19 
20 namespace mitk
21 {
22  template <typename TPixel>
23  BoundingObjectCutAndCast<TPixel>::BoundingObjectCutAndCast()
24  {
25  }
26 
27  template <typename TPixel>
28  BoundingObjectCutAndCast<TPixel>::~BoundingObjectCutAndCast()
29  {
30  }
31 
32  template <typename TPixel>
33  const std::type_info &BoundingObjectCutAndCast<TPixel>::GetOutputPixelType()
34  {
35  return typeid(TPixel);
36  }
37 
38  template <typename TInputPixelType, unsigned int VImageDimension, class TBoundingObjectCutAndCastType>
39  void CutImageFixedOutputType(itk::Image<TInputPixelType, VImageDimension> *inputItkImage,
40  TBoundingObjectCutAndCastType *cutter,
41  int boTimeStep)
42  {
43  CutImageWithOutputTypeSelect<TInputPixelType, VImageDimension, typename TBoundingObjectCutAndCastType::PixelType>(
44  inputItkImage, cutter, boTimeStep);
45  }
46 
47  template <typename TPixel>
48  void BoundingObjectCutAndCast<TPixel>::ComputeData(mitk::Image *input3D, int boTimeStep)
49  {
50  AccessFixedDimensionByItk_2(input3D, CutImageFixedOutputType, 3, this, boTimeStep);
51  }
52 
53 } // of namespace mitk
54 #endif // of MITKBOUNDINGOBJECTCUTANDCAST_TXX