ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkDeformationFieldSource.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 itkDeformationFieldSource_h
19 #define itkDeformationFieldSource_h
20 
21 #include "itkImageSource.h"
22 #include "itkKernelTransform.h"
24 
25 #ifndef ITKV3_COMPATIBILITY
26 #error "This file is only valid when ITKV3_COMPATIBILITY is turned on. Users are encouraged to convert to itk::LandmarkDisplacementFieldSource in ITKv4"
27 #endif
28 
29 namespace itk
30 {
53 template< typename TOutputImage >
54 class ITK_TEMPLATE_EXPORT DeformationFieldSource:
55  public ImageSource< TOutputImage >
56 {
57 public:
63 
64  typedef TOutputImage OutputImageType;
65  typedef typename OutputImageType::Pointer OutputImagePointer;
66  typedef typename OutputImageType::RegionType OutputImageRegionType;
67 
69  itkNewMacro(Self);
70 
72  itkTypeMacro(DeformationFieldSource, ImageSource);
73 
75  itkStaticConstMacro(ImageDimension, unsigned int,
76  TOutputImage::ImageDimension);
77 
87  typedef typename LandmarkContainer::ConstPointer LandmarkContainerPointer;
88 
91 
94 
96  typedef typename TOutputImage::PixelType OutputPixelType;
97  typedef typename OutputPixelType::ValueType OutputPixelComponentType;
98 
100  typedef typename TOutputImage::SpacingType SpacingType;
103 
107  itkSetObjectMacro(KernelTransform, KernelTransformType);
108  itkGetModifiableObjectMacro(KernelTransform, KernelTransformType);
110 
112  itkSetMacro(OutputRegion, OutputImageRegionType);
113 
115  itkGetConstReferenceMacro(OutputRegion, OutputImageRegionType);
116 
118  itkSetMacro(OutputSpacing, SpacingType);
119  virtual void SetOutputSpacing(const double *values);
121 
123  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
124 
126  itkSetMacro(OutputOrigin, OriginPointType);
127  virtual void SetOutputOrigin(const double *values);
129 
131  itkSetMacro(OutputDirection, DirectionType);
132  itkGetConstReferenceMacro(OutputDirection, DirectionType);
134 
136  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
137 
139  itkSetConstObjectMacro(SourceLandmarks, LandmarkContainer);
140  itkSetConstObjectMacro(TargetLandmarks, LandmarkContainer);
142 
148  virtual void GenerateOutputInformation() ITK_OVERRIDE;
149 
151  ModifiedTimeType GetMTime() const ITK_OVERRIDE;
152 
153 protected:
155  ~DeformationFieldSource() {}
156  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
157 
162  void GenerateData() ITK_OVERRIDE;
163 
167  void PrepareKernelBaseSpline();
168 
169 private:
170  ITK_DISALLOW_COPY_AND_ASSIGN(DeformationFieldSource);
171 
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 "itkDeformationFieldSource.hxx"
189 #endif
190 
191 #endif
SmartPointer< const Self > ConstPointer
LandmarkContainer::ConstPointer LandmarkContainerPointer
KernelTransformType::PointSetType LandmarkPointSetType
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
TOutputImage::SpacingType SpacingType
Computes a deformation field from two sets of landmarks.
OutputImageType::IndexType OutputIndexType
PointSetType::PointsContainer PointsContainer
Base class for all process objects that output image data.
TOutputImage::PointType OriginPointType
TOutputImage::DirectionType DirectionType
KernelTransformType::PointsContainer LandmarkContainer
KernelTransform< double, itkGetStaticConstMacro(ImageDimension) > KernelTransformType
OutputImageType::Pointer OutputImagePointer
ImageSource< TOutputImage > Superclass
TOutputImage::PixelType OutputPixelType
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition: itkPointSet.h:84
OutputImageType::SizeType OutputSizeType
MeshTraits::PointType PointType
Definition: itkPointSet.h:106
OutputImageType::RegionType OutputImageRegionType
OutputPixelType::ValueType OutputPixelComponentType
LandmarkPointSetType::PointType LandmarkPointType
OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
KernelTransformType::Pointer KernelTransformPointerType