ITK  5.2.0
Insight Toolkit
itkLandmarkDisplacementFieldSource.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  * 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 itkLandmarkDisplacementFieldSource_h
19 #define itkLandmarkDisplacementFieldSource_h
20 
21 #include "itkImageSource.h"
22 #include "itkKernelTransform.h"
24 
25 namespace itk
26 {
48 template <typename TOutputImage>
49 class ITK_TEMPLATE_EXPORT LandmarkDisplacementFieldSource : public ImageSource<TOutputImage>
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_MOVE(LandmarkDisplacementFieldSource);
53 
59 
60  using OutputImageType = TOutputImage;
61  using OutputImagePointer = typename OutputImageType::Pointer;
63 
65  itkNewMacro(Self);
66 
69 
71  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
72 
82  using LandmarkContainerPointer = typename LandmarkContainer::ConstPointer;
83 
86 
89 
91  using OutputPixelType = typename TOutputImage::PixelType;
92  using OutputPixelComponentType = typename OutputPixelType::ValueType;
93 
95  using SpacingType = typename TOutputImage::SpacingType;
98 
102  itkSetObjectMacro(KernelTransform, KernelTransformType);
103  itkGetModifiableObjectMacro(KernelTransform, KernelTransformType);
105 
107  itkSetMacro(OutputRegion, OutputImageRegionType);
108 
110  itkGetConstReferenceMacro(OutputRegion, OutputImageRegionType);
111 
113  itkSetMacro(OutputSpacing, SpacingType);
114  virtual void
115  SetOutputSpacing(const double * spacing);
117 
119  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
120 
122  itkSetMacro(OutputOrigin, OriginPointType);
123  virtual void
124  SetOutputOrigin(const double * origin);
126 
128  itkSetMacro(OutputDirection, DirectionType);
129  itkGetConstReferenceMacro(OutputDirection, DirectionType);
131 
133  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
134 
136  itkSetConstObjectMacro(SourceLandmarks, LandmarkContainer);
137  itkSetConstObjectMacro(TargetLandmarks, LandmarkContainer);
139 
145  void
146  GenerateOutputInformation() override;
147 
150  GetMTime() const override;
151 
152 protected:
154  ~LandmarkDisplacementFieldSource() override = default;
155  void
156  PrintSelf(std::ostream & os, Indent indent) const override;
157 
162  void
163  GenerateData() override;
164 
168  void
169  PrepareKernelBaseSpline();
170 
171 private:
172  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
173  // use
174 
175  OutputImageRegionType m_OutputRegion; // Region of the output
176  // image
177  SpacingType m_OutputSpacing; // output image spacing
178  OriginPointType m_OutputOrigin; // output image origin
179  DirectionType m_OutputDirection; // output image direction
180  // cosines
181 
182  LandmarkContainerPointer m_SourceLandmarks; // List of source landmarks
183  LandmarkContainerPointer m_TargetLandmarks; // List of target landmarks
184 };
185 } // end namespace itk
186 
187 #ifndef ITK_MANUAL_INSTANTIATION
188 # include "itkLandmarkDisplacementFieldSource.hxx"
189 #endif
190 
191 #endif
itk::LandmarkDisplacementFieldSource::KernelTransformPointerType
typename KernelTransformType::Pointer KernelTransformPointerType
Definition: itkLandmarkDisplacementFieldSource.h:80
itk::LandmarkDisplacementFieldSource::m_OutputRegion
OutputImageRegionType m_OutputRegion
Definition: itkLandmarkDisplacementFieldSource.h:175
itk::LandmarkDisplacementFieldSource::m_KernelTransform
KernelTransformPointerType m_KernelTransform
Definition: itkLandmarkDisplacementFieldSource.h:172
itk::LandmarkDisplacementFieldSource::OutputSizeType
typename OutputImageType::SizeType OutputSizeType
Definition: itkLandmarkDisplacementFieldSource.h:85
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::PointSet
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition: itkPointSet.h:82
itkImageSource.h
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:102
itk::LandmarkDisplacementFieldSource::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkLandmarkDisplacementFieldSource.h:91
itk::LandmarkDisplacementFieldSource::DirectionType
typename TOutputImage::DirectionType DirectionType
Definition: itkLandmarkDisplacementFieldSource.h:97
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::LandmarkDisplacementFieldSource::m_TargetLandmarks
LandmarkContainerPointer m_TargetLandmarks
Definition: itkLandmarkDisplacementFieldSource.h:183
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::LandmarkDisplacementFieldSource::LandmarkContainerPointer
typename LandmarkContainer::ConstPointer LandmarkContainerPointer
Definition: itkLandmarkDisplacementFieldSource.h:82
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkImageRegionIteratorWithIndex.h
itkKernelTransform.h
itk::LandmarkDisplacementFieldSource::m_OutputOrigin
OriginPointType m_OutputOrigin
Definition: itkLandmarkDisplacementFieldSource.h:178
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::LandmarkDisplacementFieldSource::LandmarkPointSetType
typename KernelTransformType::PointSetType LandmarkPointSetType
Definition: itkLandmarkDisplacementFieldSource.h:78
itk::LandmarkDisplacementFieldSource::m_OutputSpacing
SpacingType m_OutputSpacing
Definition: itkLandmarkDisplacementFieldSource.h:177
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::LandmarkDisplacementFieldSource::SpacingType
typename TOutputImage::SpacingType SpacingType
Definition: itkLandmarkDisplacementFieldSource.h:95
itk::LandmarkDisplacementFieldSource::OutputPixelComponentType
typename OutputPixelType::ValueType OutputPixelComponentType
Definition: itkLandmarkDisplacementFieldSource.h:92
itk::LandmarkDisplacementFieldSource::OriginPointType
typename TOutputImage::PointType OriginPointType
Definition: itkLandmarkDisplacementFieldSource.h:96
itk::KernelTransform::PointsContainer
typename PointSetType::PointsContainer PointsContainer
Definition: itkKernelTransform.h:122
itk::LandmarkDisplacementFieldSource::m_OutputDirection
DirectionType m_OutputDirection
Definition: itkLandmarkDisplacementFieldSource.h:179
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::LandmarkDisplacementFieldSource::LandmarkPointType
typename LandmarkPointSetType::PointType LandmarkPointType
Definition: itkLandmarkDisplacementFieldSource.h:79
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::LandmarkDisplacementFieldSource::OutputIndexType
typename OutputImageType::IndexType OutputIndexType
Definition: itkLandmarkDisplacementFieldSource.h:88
itk::LandmarkDisplacementFieldSource::m_SourceLandmarks
LandmarkContainerPointer m_SourceLandmarks
Definition: itkLandmarkDisplacementFieldSource.h:182
itk::LandmarkDisplacementFieldSource::LandmarkContainer
typename KernelTransformType::PointsContainer LandmarkContainer
Definition: itkLandmarkDisplacementFieldSource.h:81
itk::KernelTransform
Definition: itkKernelTransform.h:61
itk::LandmarkDisplacementFieldSource
Computes a displacement field from two sets of landmarks.
Definition: itkLandmarkDisplacementFieldSource.h:49
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90