ITK  4.8.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 itkLandmarkDisplacementFieldSource.h in ITKv4"
27 #endif
28 
29 namespace itk
30 {
53 template< typename TOutputImage >
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 
90  typedef typename OutputImageType::SizeType OutputSizeType;
91 
93  typedef typename OutputImageType::IndexType OutputIndexType;
94 
96  typedef typename TOutputImage::PixelType OutputPixelType;
97  typedef typename OutputPixelType::ValueType OutputPixelComponentType;
98 
100  typedef typename TOutputImage::SpacingType SpacingType;
101  typedef typename TOutputImage::PointType OriginPointType;
102  typedef typename TOutputImage::DirectionType DirectionType;
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();
149 
151  unsigned long GetMTime() const;
152 
153 protected:
156  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
157 
162  void GenerateData();
163 
168 
169 private:
170  DeformationFieldSource(const Self &); //purposely not implemented
171  void operator=(const Self &); //purposely not implemented
172 
173  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
174  // use
175 
176  OutputImageRegionType m_OutputRegion; // Region of the output
177  // image
178  SpacingType m_OutputSpacing; // output image spacing
179  OriginPointType m_OutputOrigin; // output image origin
180  DirectionType m_OutputDirection; // output image direction
181  // cosines
182 
183  LandmarkContainerPointer m_SourceLandmarks; // List of source landmarks
184  LandmarkContainerPointer m_TargetLandmarks; // List of target landmarks
185 };
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 #include "itkDeformationFieldSource.hxx"
190 #endif
191 
192 #endif
SmartPointer< const Self > ConstPointer
static const unsigned int ImageDimension
LandmarkContainer::ConstPointer LandmarkContainerPointer
KernelTransformType::PointSetType LandmarkPointSetType
virtual void SetOutputOrigin(OriginPointType _arg)
void PrintSelf(std::ostream &os, Indent indent) const override
LandmarkContainerPointer m_SourceLandmarks
LandmarkContainerPointer m_TargetLandmarks
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
virtual void SetOutputSpacing(SpacingType _arg)
OutputImageType::Pointer OutputImagePointer
unsigned long GetMTime() const
ImageSource< TOutputImage > Superclass
virtual void GenerateOutputInformation()
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
void operator=(const Self &)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
KernelTransformPointerType m_KernelTransform
KernelTransformType::Pointer KernelTransformPointerType