00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __itkTransformToDeformationFieldSource_h
00032 #define __itkTransformToDeformationFieldSource_h
00033
00034 #include "itkTransform.h"
00035 #include "itkImageSource.h"
00036
00037 namespace itk
00038 {
00039
00070 template <class TOutputImage,
00071 class TTransformPrecisionType=double>
00072 class ITK_EXPORT TransformToDeformationFieldSource:
00073 public ImageSource<TOutputImage>
00074 {
00075 public:
00077 typedef TransformToDeformationFieldSource Self;
00078 typedef ImageSource<TOutputImage> Superclass;
00079 typedef SmartPointer<Self> Pointer;
00080 typedef SmartPointer<const Self> ConstPointer;
00081
00082 typedef TOutputImage OutputImageType;
00083 typedef typename OutputImageType::Pointer OutputImagePointer;
00084 typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
00085 typedef typename OutputImageType::RegionType OutputImageRegionType;
00086
00088 itkNewMacro( Self );
00089
00091 itkTypeMacro( TransformToDeformationFieldSource, ImageSource );
00092
00094 itkStaticConstMacro( ImageDimension, unsigned int,
00095 TOutputImage::ImageDimension );
00096
00098 typedef Transform<TTransformPrecisionType,
00099 itkGetStaticConstMacro( ImageDimension ),
00100 itkGetStaticConstMacro( ImageDimension )> TransformType;
00101 typedef typename TransformType::ConstPointer TransformPointerType;
00103
00105 typedef typename OutputImageType::PixelType PixelType;
00106 typedef typename PixelType::ValueType PixelValueType;
00107 typedef typename OutputImageType::RegionType RegionType;
00108 typedef typename RegionType::SizeType SizeType;
00109 typedef typename OutputImageType::IndexType IndexType;
00110 typedef typename OutputImageType::PointType PointType;
00111 typedef typename OutputImageType::SpacingType SpacingType;
00112 typedef typename OutputImageType::PointType OriginType;
00113 typedef typename OutputImageType::DirectionType DirectionType;
00114
00122 itkSetConstObjectMacro( Transform, TransformType );
00123
00125 itkGetConstObjectMacro( Transform, TransformType );
00126
00128 itkSetMacro( OutputSize, SizeType );
00129
00131 itkGetConstReferenceMacro( OutputSize, SizeType );
00132
00134 itkSetMacro( OutputSpacing, SpacingType );
00135 virtual void SetOutputSpacing( const double* values );
00137
00139 itkGetConstReferenceMacro( OutputSpacing, SpacingType );
00140
00142 itkSetMacro( OutputOrigin, OriginType );
00143 virtual void SetOutputOrigin( const double* values);
00145
00147 itkGetConstReferenceMacro( OutputOrigin, OriginType );
00148
00151 itkSetMacro( OutputIndex, IndexType );
00152
00154 itkGetConstReferenceMacro( OutputIndex, IndexType );
00155
00157 itkSetMacro( OutputDirection, DirectionType );
00158 itkGetConstReferenceMacro( OutputDirection, DirectionType );
00160
00162 void SetOutputParametersFromImage( OutputImagePointer image );
00163
00165 void SetOutputParametersFromImage( OutputImageConstPointer image );
00166
00168 virtual void GenerateOutputInformation( void );
00169
00171 virtual void BeforeThreadedGenerateData( void );
00172
00174 unsigned long GetMTime( void ) const;
00175
00176 #ifdef ITK_USE_CONCEPT_CHECKING
00177
00178 itkStaticConstMacro(PixelDimension, unsigned int,
00179 PixelType::Dimension );
00180 itkConceptMacro(SameDimensionCheck,
00181 (Concept::SameDimension<ImageDimension,PixelDimension>));
00182
00184 #endif
00185
00186 protected:
00187 TransformToDeformationFieldSource( void );
00188 ~TransformToDeformationFieldSource( void ) {};
00189
00190 void PrintSelf( std::ostream& os, Indent indent ) const;
00191
00195 void ThreadedGenerateData(
00196 const OutputImageRegionType & outputRegionForThread,
00197 int threadId );
00198
00202 void NonlinearThreadedGenerateData(
00203 const OutputImageRegionType& outputRegionForThread,
00204 int threadId );
00205
00209 void LinearThreadedGenerateData(
00210 const OutputImageRegionType & outputRegionForThread,
00211 int threadId );
00212
00213 private:
00214
00215 TransformToDeformationFieldSource( const Self& );
00216 void operator=( const Self& );
00217
00219 SizeType m_OutputSize;
00220 TransformPointerType m_Transform;
00221 SpacingType m_OutputSpacing;
00222 OriginType m_OutputOrigin;
00223 DirectionType m_OutputDirection;
00224 IndexType m_OutputIndex;
00225
00226 };
00227
00228 }
00229
00230 #ifndef ITK_MANUAL_INSTANTIATION
00231 #include "itkTransformToDeformationFieldSource.txx"
00232 #endif
00233
00234 #endif // end #ifndef __itkTransformToDeformationFieldSource_h
00235