ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkInterpolateImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkInterpolateImageFilter_h
19 #define itkInterpolateImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
43 template< typename TInputImage, typename TOutputImage >
44 class ITK_TEMPLATE_EXPORT InterpolateImageFilter:
45  public ImageToImageFilter< TInputImage, TOutputImage >
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_ASSIGN(InterpolateImageFilter);
49 
55 
57  itkNewMacro(Self);
58 
61 
63  using InputImageType = typename Superclass::InputImageType;
64  using InputImagePointer = typename Superclass::InputImagePointer;
65  using OutputImageType = typename Superclass::OutputImageType;
66  using OutputImagePointer = typename Superclass::OutputImagePointer;
67  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
68 
70  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
71  static constexpr unsigned int IntermediateImageDimension = TOutputImage::ImageDimension + 1;
72 
74  using InputPixelType = typename TInputImage::PixelType;
77 
79  void SetInput1(const InputImageType *image)
80  { this->SetInput(image); }
82  { return this->GetInput(); }
84 
86  void SetInput2(const InputImageType *image);
87 
88  const InputImageType * GetInput2();
89 
92  itkSetClampMacro(Distance, double, 0.0, 1.0);
93  itkGetConstMacro(Distance, double);
95 
97  itkSetObjectMacro(Interpolator, InterpolatorType)
98  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
99 
102  void BeforeThreadedGenerateData() override;
103 
105  void AfterThreadedGenerateData() override;
106 
107 #ifdef ITK_USE_CONCEPT_CHECKING
108  // Begin concept checking
109  itkConceptMacro( InputHasNumericTraitsCheck,
111  // End concept checking
112 #endif
113 
114 protected:
116  ~InterpolateImageFilter() override = default;
117  void PrintSelf(std::ostream & os, Indent indent) const override;
118 
120  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
121 
122 
123 private:
125 
127 
128  double m_Distance;
129 };
130 } // end namespace itk
131 
132 #ifndef ITK_MANUAL_INSTANTIATION
133 #include "itkInterpolateImageFilter.hxx"
134 #endif
135 
136 #endif
typename OutputImageType::Pointer OutputImagePointer
const InputImageType * GetInput1()
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Base class for all image interpolaters.
void SetInput1(const InputImageType *image)
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename TInputImage::PixelType InputPixelType
InterpolatorType::Pointer m_Interpolator
#define itkConceptMacro(name, concept)
Interpolate an image from two N-D images.
IntermediateImageType::Pointer m_IntermediateImage
Templated n-dimensional image class.
Definition: itkImage.h:75