ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkTransformToDisplacementFieldFilter.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 itkTransformToDisplacementFieldFilter_h
19 #define itkTransformToDisplacementFieldFilter_h
20 
21 #include "itkDataObjectDecorator.h"
22 #include "itkTransform.h"
23 #include "itkImageSource.h"
24 
25 namespace itk
26 {
54 template< typename TOutputImage,
55  typename TParametersValueType = double>
56 class ITK_TEMPLATE_EXPORT TransformToDisplacementFieldFilter:
57  public ImageSource< TOutputImage >
58 {
59 public:
60  ITK_DISALLOW_COPY_AND_ASSIGN(TransformToDisplacementFieldFilter);
61 
67 
68  using OutputImageType = TOutputImage;
70 
72  itkNewMacro(Self);
73 
76 
78  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
79 
83 
85  using PixelType = typename OutputImageType::PixelType;
86  using PixelValueType = typename PixelType::ValueType;
88  using SizeType = typename RegionType::SizeType;
91  using SpacingType = typename OutputImageType::SpacingType;
94 
97 
102  using Superclass::SetInput;
103  virtual void SetInput( const TransformInputType * transform );
104  const TransformInputType * GetInput() const;
105  itkSetGetDecoratedObjectInputMacro(Transform, TransformType);
107 
110  itkSetMacro(OutputStartIndex, IndexType);
111  itkGetConstReferenceMacro(OutputStartIndex, IndexType);
113 
115  itkSetMacro(Size, SizeType);
116  itkGetConstReferenceMacro(Size, SizeType);
118 
120  itkSetMacro(OutputSpacing, SpacingType);
121  virtual void SetOutputSpacing(const SpacePrecisionType *values);
123 
125  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
126 
128  itkSetMacro(OutputOrigin, OriginType);
129  virtual void SetOutputOrigin(const SpacePrecisionType *values);
131 
133  itkGetConstReferenceMacro(OutputOrigin, OriginType);
134 
136  itkSetMacro(OutputDirection, DirectionType);
137  itkGetConstReferenceMacro(OutputDirection, DirectionType);
139 
146  itkSetInputMacro(ReferenceImage, ReferenceImageBaseType);
147 
149  itkGetInputMacro(ReferenceImage, ReferenceImageBaseType);
150 
153  itkSetMacro(UseReferenceImage, bool);
154  itkBooleanMacro(UseReferenceImage);
155  itkGetConstMacro(UseReferenceImage, bool);
157 
158 #ifdef ITK_USE_CONCEPT_CHECKING
159  // Begin concept checking
160  static constexpr unsigned int PixelDimension = PixelType::Dimension;
161  itkConceptMacro( SameDimensionCheck,
163  // End concept checking
164 #endif
165 
166 protected:
168  ~TransformToDisplacementFieldFilter() override = default;
169 
171  void GenerateOutputInformation() override;
172 
174  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
175 
176 
180  void NonlinearThreadedGenerateData( const OutputImageRegionType & outputRegionForThread );
181 
185  void LinearThreadedGenerateData( const OutputImageRegionType & outputRegionForThread );
186 
187  void PrintSelf(std::ostream & os, Indent indent) const override;
188 
189 private:
191  SizeType m_Size; // size of the output region
192  IndexType m_OutputStartIndex; // start index of the output region
193  SpacingType m_OutputSpacing; // output image spacing
194  OriginType m_OutputOrigin; // output image origin
195  DirectionType m_OutputDirection; // output image direction cosines
196  bool m_UseReferenceImage{ false };
197 
198 };
199 } // end namespace itk
200 
201 #ifndef ITK_MANUAL_INSTANTIATION
202 #include "itkTransformToDisplacementFieldFilter.hxx"
203 #endif
204 
205 #endif
double SpacePrecisionType
Definition: itkFloatTypes.h:30
Generate a displacement field from a coordinate transform.
typename OutputImageType::DirectionType DirectionType
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.
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Decorates any subclass of itkObject with a DataObject API.
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:68
Base class for templated image classes.
Definition: itkImageBase.h:105
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)