ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkLandmarkDisplacementFieldSource.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 __itkLandmarkDisplacementFieldSource_h
19 #define __itkLandmarkDisplacementFieldSource_h
20 
21 #include "itkImageSource.h"
22 #include "itkKernelTransform.h"
24 
25 namespace itk
26 {
48 template< class TOutputImage >
50  public ImageSource< TOutputImage >
51 {
52 public:
58 
59  typedef TOutputImage OutputImageType;
60  typedef typename OutputImageType::Pointer OutputImagePointer;
61  typedef typename OutputImageType::RegionType OutputImageRegionType;
62 
64  itkNewMacro(Self);
65 
68 
70  itkStaticConstMacro(ImageDimension, unsigned int,
71  TOutputImage::ImageDimension);
72 
82  typedef typename LandmarkContainer::ConstPointer LandmarkContainerPointer;
83 
85  typedef typename OutputImageType::SizeType OutputSizeType;
86 
88  typedef typename OutputImageType::IndexType OutputIndexType;
89 
91  typedef typename TOutputImage::PixelType OutputPixelType;
92  typedef typename OutputPixelType::ValueType OutputPixelComponentType;
93 
95  typedef typename TOutputImage::SpacingType SpacingType;
96  typedef typename TOutputImage::PointType OriginPointType;
97  typedef typename TOutputImage::DirectionType DirectionType;
98 
102  itkSetObjectMacro(KernelTransform, KernelTransformType);
103 
105  itkGetObjectMacro(KernelTransform, KernelTransformType);
106 
108  itkSetMacro(OutputRegion, OutputImageRegionType);
109 
111  itkGetConstReferenceMacro(OutputRegion, OutputImageRegionType);
112 
114  itkSetMacro(OutputSpacing, SpacingType);
115  virtual void SetOutputSpacing(const double *values);
117 
119  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
120 
122  itkSetMacro(OutputOrigin, OriginPointType);
123  virtual void SetOutputOrigin(const double *values);
125 
127  itkSetMacro(OutputDirection, DirectionType);
128  itkGetConstReferenceMacro(OutputDirection, DirectionType);
130 
132  itkGetConstReferenceMacro(OutputOrigin, OriginPointType);
133 
135  itkSetConstObjectMacro(SourceLandmarks, LandmarkContainer);
136  itkSetConstObjectMacro(TargetLandmarks, LandmarkContainer);
138 
144  virtual void GenerateOutputInformation();
145 
147  unsigned long GetMTime(void) const;
148 
149 protected:
152  void PrintSelf(std::ostream & os, Indent indent) const;
153 
158  void GenerateData();
159 
163  void PrepareKernelBaseSpline();
164 
165 private:
166  LandmarkDisplacementFieldSource(const Self &); //purposely not implemented
167  void operator=(const Self &); //purposely not implemented
168 
169  KernelTransformPointerType m_KernelTransform; // Coordinate transform to
170  // use
171 
172  OutputImageRegionType m_OutputRegion; // Region of the output
173  // image
174  SpacingType m_OutputSpacing; // output image spacing
175  OriginPointType m_OutputOrigin; // output image origin
176  DirectionType m_OutputDirection; // output image direction
177  // cosines
178 
179  LandmarkContainerPointer m_SourceLandmarks; // List of source landmarks
180  LandmarkContainerPointer m_TargetLandmarks; // List of target landmarks
181 };
182 } // end namespace itk
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 #include "itkLandmarkDisplacementFieldSource.hxx"
186 #endif
187 
188 #endif
189