Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkTransformToDeformationFieldSource.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkTransformToDeformationFieldSource.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-08-01 13:42:00 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 /*======================================================================
00018 
00019 This file is part of the elastix software.
00020 
00021 Copyright (c) University Medical Center Utrecht. All rights reserved.
00022 See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00023 details.
00024 
00025 This software is distributed WITHOUT ANY WARRANTY; without even 
00026 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00027 PURPOSE. See the above copyright notices for more information.
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 
00116   typedef ImageBase< itkGetStaticConstMacro( ImageDimension ) > ImageBaseType;
00117 
00125   itkSetConstObjectMacro( Transform, TransformType ); 
00126 
00128   itkGetConstObjectMacro( Transform, TransformType );
00129 
00131   virtual void SetOutputSize( const SizeType & size );
00132 
00134   virtual const SizeType & GetOutputSize();
00135 
00138   virtual void SetOutputIndex( const IndexType & index );
00139 
00141   virtual const IndexType & GetOutputIndex();
00142 
00144   itkSetMacro( OutputRegion, OutputImageRegionType );
00145 
00147   itkGetConstReferenceMacro( OutputRegion, OutputImageRegionType );
00148 
00150   itkSetMacro( OutputSpacing, SpacingType );
00151   virtual void SetOutputSpacing( const double* values );
00153 
00155   itkGetConstReferenceMacro( OutputSpacing, SpacingType );
00156 
00158   itkSetMacro( OutputOrigin, OriginType );
00159   virtual void SetOutputOrigin( const double* values);
00161 
00163   itkGetConstReferenceMacro( OutputOrigin, OriginType );
00164 
00166   itkSetMacro( OutputDirection, DirectionType );
00167   itkGetConstReferenceMacro( OutputDirection, DirectionType );
00169 
00171   void SetOutputParametersFromImage( const ImageBaseType * image );
00172 
00174   virtual void GenerateOutputInformation( void );
00175 
00177   virtual void BeforeThreadedGenerateData( void );
00178 
00180   unsigned long GetMTime( void ) const;
00181 
00182 #ifdef ITK_USE_CONCEPT_CHECKING
00183 
00184   itkStaticConstMacro(PixelDimension, unsigned int,
00185                       PixelType::Dimension );
00186   itkConceptMacro(SameDimensionCheck,
00187     (Concept::SameDimension<ImageDimension,PixelDimension>));
00188 
00190 #endif
00191 
00192 protected:
00193   TransformToDeformationFieldSource( void );
00194   ~TransformToDeformationFieldSource( void ) {};
00195 
00196   void PrintSelf( std::ostream& os, Indent indent ) const;
00197 
00201   void ThreadedGenerateData(
00202     const OutputImageRegionType & outputRegionForThread,
00203     int threadId );
00204 
00208   void NonlinearThreadedGenerateData(
00209     const OutputImageRegionType& outputRegionForThread,
00210     int threadId );
00211 
00215   void LinearThreadedGenerateData(
00216     const OutputImageRegionType & outputRegionForThread,
00217     int threadId );
00218 
00219 private:
00220 
00221   TransformToDeformationFieldSource( const Self& ); //purposely not implemented
00222   void operator=( const Self& ); //purposely not implemented
00223 
00225   RegionType              m_OutputRegion;      // region of the output image
00226   TransformPointerType    m_Transform;         // Coordinate transform to use
00227   SpacingType             m_OutputSpacing;     // output image spacing
00228   OriginType              m_OutputOrigin;      // output image origin
00229   DirectionType           m_OutputDirection;   // output image direction cosines
00230 
00231 }; // end class TransformToDeformationFieldSource
00232   
00233 } // end namespace itk
00234   
00235 #ifndef ITK_MANUAL_INSTANTIATION
00236 #include "itkTransformToDeformationFieldSource.txx"
00237 #endif
00238   
00239 #endif // end #ifndef __itkTransformToDeformationFieldSource_h
00240 

Generated at Thu Nov 6 00:30:31 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000