ITK  4.5.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 {
54 template< typename TOutputImage,
55  typename TTransformPrecisionType = double >
57  public ImageSource< TOutputImage >
58 {
59 public:
65 
66  typedef TOutputImage OutputImageType;
67  typedef typename OutputImageType::Pointer OutputImagePointer;
68  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
69  typedef typename OutputImageType::RegionType OutputImageRegionType;
70 
72  itkNewMacro(Self);
73 
76 
78  itkStaticConstMacro(ImageDimension, unsigned int,
79  TOutputImage::ImageDimension);
80 
82  typedef Transform< TTransformPrecisionType,
83  itkGetStaticConstMacro(ImageDimension),
84  itkGetStaticConstMacro(ImageDimension) > TransformType;
87 
89  typedef typename OutputImageType::PixelType PixelType;
90  typedef typename PixelType::ValueType PixelValueType;
91  typedef typename OutputImageType::RegionType RegionType;
92  typedef typename RegionType::SizeType SizeType;
93  typedef typename OutputImageType::IndexType IndexType;
94  typedef typename OutputImageType::PointType PointType;
95  typedef typename OutputImageType::SpacingType SpacingType;
96  typedef typename OutputImageType::PointType OriginType;
97  typedef typename OutputImageType::DirectionType DirectionType;
98 
101 
109  itkSetConstObjectMacro(Transform, TransformType);
110  itkGetConstObjectMacro(Transform, TransformType);
112 
114  virtual void SetOutputSize(const SizeType & size);
115 
117  virtual const SizeType & GetOutputSize();
118 
121  virtual void SetOutputIndex(const IndexType & index);
122 
124  virtual const IndexType & GetOutputIndex();
125 
127  itkSetMacro(OutputRegion, OutputImageRegionType);
128 
130  itkGetConstReferenceMacro(OutputRegion, OutputImageRegionType);
131 
133  itkSetMacro(OutputSpacing, SpacingType);
134  virtual void SetOutputSpacing(const double *values);
136 
138  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
139 
141  itkSetMacro(OutputOrigin, OriginType);
142  virtual void SetOutputOrigin(const double *values);
144 
146  itkGetConstReferenceMacro(OutputOrigin, OriginType);
147 
149  itkSetMacro(OutputDirection, DirectionType);
150  itkGetConstReferenceMacro(OutputDirection, DirectionType);
152 
154  void SetOutputParametersFromImage(const ImageBaseType *image);
155 
157  virtual void GenerateOutputInformation(void);
158 
160  virtual void BeforeThreadedGenerateData(void);
161 
163  ModifiedTimeType GetMTime(void) const;
164 
165 #ifdef ITK_USE_CONCEPT_CHECKING
166  // Begin concept checking
167  itkStaticConstMacro(PixelDimension, unsigned int,
168  PixelType::Dimension);
169  itkConceptMacro( SameDimensionCheck,
171  // End concept checking
172 #endif
173 
174 protected:
177 
178  void PrintSelf(std::ostream & os, Indent indent) const;
179 
184  const OutputImageRegionType & outputRegionForThread,
185  ThreadIdType threadId);
186 
191  const OutputImageRegionType & outputRegionForThread,
192  ThreadIdType threadId);
193 
198  const OutputImageRegionType & outputRegionForThread,
199  ThreadIdType threadId);
200 
201 private:
202 
203  TransformToDisplacementFieldSource(const Self &); //purposely not implemented
204  void operator=(const Self &); //purposely not implemented
205 
207  RegionType m_OutputRegion; // region of the output image
208  TransformPointerType m_Transform; // Coordinate transform to use
209  SpacingType m_OutputSpacing; // output image spacing
210  OriginType m_OutputOrigin; // output image origin
211  DirectionType m_OutputDirection; // output image direction cosines
212 }; // end class
213  // TransformToDisplacementFieldSource
214 } // end namespace itk
215 
216 #ifndef ITK_MANUAL_INSTANTIATION
217 #include "itkTransformToDisplacementFieldSource.hxx"
218 #endif
219 
220 #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)
void PrintSelf(std::ostream &os, Indent indent) const
virtual const SizeType & GetOutputSize()
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
virtual void GenerateOutputInformation(void)
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
ModifiedTimeType GetMTime(void) const
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
#define itkConceptMacro(name, concept)
virtual void SetOutputSpacing(SpacingType _arg)
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
virtual void BeforeThreadedGenerateData(void)
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
ImageBase< itkGetStaticConstMacro(ImageDimension) > ImageBaseType