ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkTransformToDisplacementFieldSource.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 itkTransformToDisplacementFieldSource_h
19 #define itkTransformToDisplacementFieldSource_h
20 
21 #include "itkTransform.h"
22 #include "itkImageSource.h"
23 
24 namespace itk
25 {
58 template< typename TOutputImage,
59  typename TTransformPrecisionType = double >
61  public ImageSource< TOutputImage >
62 {
63 public:
69 
70  typedef TOutputImage OutputImageType;
71  typedef typename OutputImageType::Pointer OutputImagePointer;
72  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
73  typedef typename OutputImageType::RegionType OutputImageRegionType;
74 
76  itkNewMacro(Self);
77 
80 
82  itkStaticConstMacro(ImageDimension, unsigned int,
83  TOutputImage::ImageDimension);
84 
86  typedef Transform< TTransformPrecisionType,
87  itkGetStaticConstMacro(ImageDimension),
88  itkGetStaticConstMacro(ImageDimension) > TransformType;
91 
93  typedef typename OutputImageType::PixelType PixelType;
94  typedef typename PixelType::ValueType PixelValueType;
95  typedef typename OutputImageType::RegionType RegionType;
96  typedef typename RegionType::SizeType SizeType;
97  typedef typename OutputImageType::IndexType IndexType;
98  typedef typename OutputImageType::PointType PointType;
99  typedef typename OutputImageType::SpacingType SpacingType;
100  typedef typename OutputImageType::PointType OriginType;
101  typedef typename OutputImageType::DirectionType DirectionType;
102 
105 
113  itkSetConstObjectMacro(Transform, TransformType);
114  itkGetConstObjectMacro(Transform, TransformType);
116 
118  virtual void SetOutputSize(const SizeType & size);
119 
121  virtual const SizeType & GetOutputSize();
122 
125  virtual void SetOutputIndex(const IndexType & index);
126 
128  virtual const IndexType & GetOutputIndex();
129 
131  itkSetMacro(OutputRegion, OutputImageRegionType);
132 
134  itkGetConstReferenceMacro(OutputRegion, OutputImageRegionType);
135 
137  itkSetMacro(OutputSpacing, SpacingType);
138  virtual void SetOutputSpacing(const double *values);
140 
142  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
143 
145  itkSetMacro(OutputOrigin, OriginType);
146  virtual void SetOutputOrigin(const double *values);
148 
150  itkGetConstReferenceMacro(OutputOrigin, OriginType);
151 
153  itkSetMacro(OutputDirection, DirectionType);
154  itkGetConstReferenceMacro(OutputDirection, DirectionType);
156 
158  void SetOutputParametersFromImage(const ImageBaseType *image);
159 
161  virtual void GenerateOutputInformation();
162 
164  virtual void BeforeThreadedGenerateData();
165 
167  ModifiedTimeType GetMTime() const;
168 
169 #ifdef ITK_USE_CONCEPT_CHECKING
170  // Begin concept checking
171  itkStaticConstMacro(PixelDimension, unsigned int,
172  PixelType::Dimension);
173  itkConceptMacro( SameDimensionCheck,
175  // End concept checking
176 #endif
177 
178 protected:
181 
182  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
183 
188  const OutputImageRegionType & outputRegionForThread,
189  ThreadIdType threadId);
190 
195  const OutputImageRegionType & outputRegionForThread,
196  ThreadIdType threadId);
197 
202  const OutputImageRegionType & outputRegionForThread,
203  ThreadIdType threadId);
204 
205 private:
206 
207  TransformToDisplacementFieldSource(const Self &); //purposely not implemented
208  void operator=(const Self &); //purposely not implemented
209 
211  RegionType m_OutputRegion; // region of the output image
212  TransformPointerType m_Transform; // Coordinate transform to use
213  SpacingType m_OutputSpacing; // output image spacing
214  OriginType m_OutputOrigin; // output image origin
215  DirectionType m_OutputDirection; // output image direction cosines
216 }; // end class
217  // TransformToDisplacementFieldSource
218 } // end namespace itk
219 
220 #ifndef ITK_MANUAL_INSTANTIATION
221 #include "itkTransformToDisplacementFieldSource.hxx"
222 #endif
223 
224 #endif // end #ifndef itkTransformToDisplacementFieldSource_h
void NonlinearThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
virtual void SetOutputSize(const SizeType &size)
void LinearThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
ModifiedTimeType GetMTime() const
virtual const SizeType & GetOutputSize()
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
void SetOutputParametersFromImage(const ImageBaseType *image)
Transform< TTransformPrecisionType, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension) > TransformType
virtual void SetOutputOrigin(OriginType _arg)
virtual void SetOutputIndex(const IndexType &index)
Base class for all process objects that output image data.
Generate a displacement field from a coordinate transform.
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Base class for templated image classes.
Definition: itkImageBase.h:112
virtual const IndexType & GetOutputIndex()
OutputImageType::RegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void PrintSelf(std::ostream &os, Indent indent) const override
#define itkConceptMacro(name, concept)
virtual void SetOutputSpacing(SpacingType _arg)
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
ImageBase< itkGetStaticConstMacro(ImageDimension) > ImageBaseType