ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkWarpVectorImageFilter.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 itkWarpVectorImageFilter_h
19 #define itkWarpVectorImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 #include "itkPoint.h"
24 #include "itkFixedArray.h"
25 
26 namespace itk
27 {
87 template<
88  typename TInputImage,
89  typename TOutputImage,
90  typename TDisplacementField
91  >
92 class ITK_TEMPLATE_EXPORT WarpVectorImageFilter:
93  public ImageToImageFilter< TInputImage, TOutputImage >
94 {
95 public:
96  ITK_DISALLOW_COPY_AND_ASSIGN(WarpVectorImageFilter);
97 
103 
105  itkNewMacro(Self);
106 
109 
112 
114  using InputImageType = typename Superclass::InputImageType;
115  using InputImagePointer = typename Superclass::InputImagePointer;
116  using OutputImageType = typename Superclass::OutputImageType;
117  using OutputImagePointer = typename Superclass::OutputImagePointer;
118  using InputImageConstPointer = typename Superclass::InputImageConstPointer;
119 
122  using PixelType = typename OutputImageType::PixelType;
123  using SpacingType = typename OutputImageType::SpacingType;
124  using ValueType = typename OutputImageType::PixelType::ValueType;
125 
127  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
128 
130  static constexpr unsigned int PixelDimension = PixelType::Dimension;
131 
133  using DisplacementFieldType = TDisplacementField;
134  using DisplacementFieldPointer = typename DisplacementFieldType::Pointer;
135  using DisplacementType = typename DisplacementFieldType::PixelType;
136 
138  using CoordRepType = double;
143 
146 
149 
151  void SetDisplacementField(const DisplacementFieldType *field);
152 
154  void SetDisplacementField(DisplacementFieldType *field);
155 
157  DisplacementFieldType * GetDisplacementField();
158 
160  itkSetObjectMacro(Interpolator, InterpolatorType);
161  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
163 
165  itkSetMacro(OutputSpacing, SpacingType);
166  virtual void SetOutputSpacing(const double *values);
168 
170  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
171 
173  itkSetMacro(OutputOrigin, PointType);
174  virtual void SetOutputOrigin(const double *values);
176 
178  itkGetConstReferenceMacro(OutputOrigin, PointType);
179 
181  itkSetMacro(OutputDirection, DirectionType);
182  itkGetConstReferenceMacro(OutputDirection, DirectionType);
184 
186  itkSetMacro(EdgePaddingValue, PixelType);
187 
189  itkGetConstMacro(EdgePaddingValue, PixelType);
190 
196  void GenerateOutputInformation() override;
197 
204  void GenerateInputRequestedRegion() override;
205 
208  void BeforeThreadedGenerateData() override;
209 
210 #ifdef ITK_USE_CONCEPT_CHECKING
211  // Begin concept checking
212  itkConceptMacro( InputHasNumericTraitsCheck,
214  itkConceptMacro( OutputHasNumericTraitsCheck,
216  itkConceptMacro( DisplacementFieldHasNumericTraitsCheck,
218  // End concept checking
219 #endif
220 
221 protected:
223  ~WarpVectorImageFilter() override = default;
224  void PrintSelf(std::ostream & os, Indent indent) const override;
225 
229  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
230 
231 
232 private:
237 
239 };
240 } // end namespace itk
241 
242 #ifndef ITK_MANUAL_INSTANTIATION
243 #include "itkWarpVectorImageFilter.hxx"
244 #endif
245 
246 #endif
typename OutputImageType::Pointer OutputImagePointer
typename InterpolatorType::Pointer InterpolatorPointer
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 OutputImageType::SizeType SizeType
typename OutputImageType::SpacingType SpacingType
typename OutputImageType::PixelType PixelType
typename DisplacementFieldType::PixelType DisplacementType
Warps an image using an input displacement field.
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Base class for filters that take an image as input and produce an image as output.
typename TOutputImage::DirectionType DirectionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for all vector image interpolaters.
typename OutputImageType::PixelType::ValueType ValueType
#define itkConceptMacro(name, concept)
typename InputImageType::ConstPointer InputImageConstPointer
Linearly interpolate a vector image at specified positions.
typename OutputImageType::IndexType IndexType