ITK  6.0.0
Insight Toolkit
itkInterpolateImagePointsFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef itkInterpolateImagePointsFilter_h
29 #define itkInterpolateImagePointsFilter_h
30 
32 #include "itkImageToImageFilter.h"
33 #include "itkImageRegionIterator.h"
34 
35 namespace itk
36 {
76 template <typename TInputImage,
77  typename TOutputImage,
78  typename TCoordType = typename TInputImage::PixelType,
79  typename InterpolatorType = BSplineInterpolateImageFunction<TInputImage, TCoordType>>
80 class ITK_TEMPLATE_EXPORT InterpolateImagePointsFilter : public ImageToImageFilter<TInputImage, TOutputImage>
81 {
82 public:
83  ITK_DISALLOW_COPY_AND_MOVE(InterpolateImagePointsFilter);
84 
90 
92  itkOverrideGetNameOfClassMacro(InterpolateImagePointsFilter);
93 
95  itkNewMacro(Self);
96 
98  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
99 
101  using typename Superclass::InputImageType;
102  using typename Superclass::OutputImageType;
103  using typename Superclass::InputImagePointer;
104 
109 
111  using PixelType = typename TOutputImage::PixelType;
112 
115  using ContinuousIndexType = typename InterpolatorType::ContinuousIndexType;
116 
119 
122 
127  void
128  SetInputImage(const TInputImage * inputImage);
129 
132  void
133  SetInterpolationCoordinate(const CoordImageType * coordinate, unsigned int setDimension);
134 
136  itkSetMacro(DefaultPixelValue, PixelType);
137 
139  itkGetConstMacro(DefaultPixelValue, PixelType);
140 
144  {
145  return m_Interpolator;
146  }
147 
150  void
151  GenerateOutputInformation() override;
152 
154  void
155  GenerateInputRequestedRegion() override;
156 
157 #ifdef ITK_USE_CONCEPT_CHECKING
158  // Begin concept checking
160  // End concept checking
161 #endif
162 
163 protected:
165  // ~InterpolateImagePointsFilter(){} default implementation ok
166 
167  void
168  PrintSelf(std::ostream & os, Indent indent) const override;
169 
172  void
173  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
174 
175 
181  void
182  VerifyInputInformation() const override
183  {}
184 
185 private:
190 
191  InterpolatorPointer m_Interpolator{};
192  PixelType m_DefaultPixelValue{}; // default pixel value if the
193  // point is outside the image
194 };
195 } // namespace itk
196 
197 #ifndef ITK_MANUAL_INSTANTIATION
198 # include "itkInterpolateImagePointsFilter.hxx"
199 #endif
200 
201 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::InterpolateImagePointsFilter::ContinuousIndexType
typename InterpolatorType::ContinuousIndexType ContinuousIndexType
Definition: itkInterpolateImagePointsFilter.h:115
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:716
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::InterpolateImagePointsFilter::CoordImageRegionType
typename CoordImageType::RegionType CoordImageRegionType
Definition: itkInterpolateImagePointsFilter.h:189
itk::SmartPointer< Self >
itkImageRegionIterator.h
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageRegionIterator
A multi-dimensional iterator templated over image type that walks a region of pixels.
Definition: itkImageRegionIterator.h:80
itk::InterpolateImagePointsFilter::GetInterpolator
InterpolatorPointer GetInterpolator()
Definition: itkInterpolateImagePointsFilter.h:143
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itkBSplineInterpolateImageFunction.h
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::InterpolateImagePointsFilter
Resamples an image at the coordinates specified by the user.
Definition: itkInterpolateImagePointsFilter.h:80
itk::InterpolateImagePointsFilter::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition: itkInterpolateImagePointsFilter.h:114
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkImageToImageFilter.h
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::InterpolateImagePointsFilter::CoordImageTypePointer
typename CoordImageType::Pointer CoordImageTypePointer
Definition: itkInterpolateImagePointsFilter.h:187
itk::InterpolateImagePointsFilter::VerifyInputInformation
void VerifyInputInformation() const override
Definition: itkInterpolateImagePointsFilter.h:182
itk::ImageRegionConstIterator
A multi-dimensional iterator templated over image type that walks a region of pixels.
Definition: itkImageRegionConstIterator.h:109
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::ImageToImageFilterDetail::ImageRegionCopier
A Function object used to dispatching to a routine to copy a region (start index and size).
Definition: itkImageToImageFilterDetail.h:318
itk::InterpolateImagePointsFilter::PixelType
typename TOutputImage::PixelType PixelType
Definition: itkInterpolateImagePointsFilter.h:111