Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
itkImageToPathFilter.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 /*===================================================================
18 
19 This file is based heavily on a corresponding ITK filter.
20 
21 ===================================================================*/
22 
23 #ifndef __itkImageToPathFilter_txx
24 #define __itkImageToPathFilter_txx
25 
26 #include "itkImageToPathFilter.h"
27 
28 namespace itk
29 {
30  /**
31  *
32  */
33  template <class TInputImage, class TOutputPath>
34  ImageToPathFilter<TInputImage, TOutputPath>::ImageToPathFilter()
35  {
36  // Modify superclass default values, can be overridden by subclasses
37  this->SetNumberOfRequiredInputs(1);
38  }
39 
40  /**
41  *
42  */
43  template <class TInputImage, class TOutputPath>
44  ImageToPathFilter<TInputImage, TOutputPath>::~ImageToPathFilter()
45  {
46  }
47 
48  /**
49  *
50  */
51  template <class TInputImage, class TOutputPath>
52  void ImageToPathFilter<TInputImage, TOutputPath>::SetInput(const InputImageType *input)
53  {
54  // Process object is not const-correct so the const_cast is required here
55  this->ProcessObject::SetNthInput(0, const_cast<InputImageType *>(input));
56  }
57 
58  /**
59  * Connect one of the operands for pixel-wise addition
60  */
61  template <class TInputImage, class TOutputPath>
62  void ImageToPathFilter<TInputImage, TOutputPath>::SetInput(unsigned int index, const TInputImage *image)
63  {
64  // Process object is not const-correct so the const_cast is required here
65  this->ProcessObject::SetNthInput(index, const_cast<TInputImage *>(image));
66  }
67 
68  /**
69  *
70  */
71  template <class TInputImage, class TOutputPath>
72  const typename ImageToPathFilter<TInputImage, TOutputPath>::InputImageType *
73  ImageToPathFilter<TInputImage, TOutputPath>::GetInput(void)
74  {
75  if (this->GetNumberOfInputs() < 1)
76  {
77  return nullptr;
78  }
79 
80  return static_cast<const TInputImage *>(this->ProcessObject::GetInput(0));
81  }
82 
83  /**
84  *
85  */
86  template <class TInputImage, class TOutputPath>
87  const typename ImageToPathFilter<TInputImage, TOutputPath>::InputImageType *
88  ImageToPathFilter<TInputImage, TOutputPath>::GetInput(unsigned int idx)
89  {
90  return static_cast<const TInputImage *>(this->ProcessObject::GetInput(idx));
91  }
92 
93  template <class TInputImage, class TOutputPath>
94  void ImageToPathFilter<TInputImage, TOutputPath>::PrintSelf(std::ostream &os, Indent indent) const
95  {
96  Superclass::PrintSelf(os, indent);
97  }
98 
99 } // end namespace itk
100 
101 #endif