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

itkDeformationFieldSource.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDeformationFieldSource.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-11-21 21:21:56 $
00007   Version:   $Revision: 1.6 $
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 #ifndef __itkDeformationFieldSource_h
00018 #define __itkDeformationFieldSource_h
00019 
00020 #include "itkImageSource.h"
00021 #include "itkKernelTransform.h"
00022 #include "itkImageRegionIteratorWithIndex.h"
00023 
00024 namespace itk
00025 {
00026 
00047 template <class TOutputImage>
00048 class ITK_EXPORT DeformationFieldSource:
00049     public ImageSource<TOutputImage>
00050 {
00051 public:
00053   typedef DeformationFieldSource         Self;
00054   typedef ImageSource<TOutputImage>      Superclass;
00055   typedef SmartPointer<Self>             Pointer;
00056   typedef SmartPointer<const Self>       ConstPointer;
00057 
00058   typedef TOutputImage                          OutputImageType;
00059   typedef typename OutputImageType::Pointer     OutputImagePointer;
00060   typedef typename OutputImageType::RegionType  OutputImageRegionType;
00061 
00063   itkNewMacro(Self);  
00064 
00066   itkTypeMacro(DeformationFieldSource, ImageSource);
00067 
00069   itkStaticConstMacro(ImageDimension, unsigned int,
00070                       TOutputImage::ImageDimension);
00071 
00076   typedef KernelTransform<double, itkGetStaticConstMacro(ImageDimension)> KernelTransformType;
00077   typedef typename KernelTransformType::PointSetType      LandmarkPointSetType;
00078   typedef typename LandmarkPointSetType::PointType        LandmarkPointType;
00079   typedef typename KernelTransformType::Pointer           KernelTransformPointerType;
00080   typedef typename KernelTransformType::PointsContainer   LandmarkContainer;
00081   typedef typename LandmarkContainer::ConstPointer        LandmarkContainerPointer;
00082 
00083 
00085   typedef typename OutputImageType::SizeType      OutputSizeType;
00086 
00088   typedef typename OutputImageType::IndexType     OutputIndexType;
00089 
00091   typedef typename TOutputImage::PixelType        OutputPixelType;
00092   typedef typename OutputPixelType::ValueType     OutputPixelComponentType;
00093 
00095   typedef typename TOutputImage::SpacingType      SpacingType;
00096   typedef typename TOutputImage::PointType        OriginPointType;
00097   typedef typename TOutputImage::DirectionType    DirectionType;
00098 
00102   itkSetObjectMacro( KernelTransform, KernelTransformType ); 
00103 
00105   itkGetObjectMacro( KernelTransform, KernelTransformType );
00106 
00108   itkSetMacro( OutputRegion, OutputImageRegionType );
00109 
00111   itkGetConstReferenceMacro( OutputRegion, OutputImageRegionType );
00112 
00114   itkSetMacro(OutputSpacing, SpacingType);
00115   virtual void SetOutputSpacing( const double* values);
00117 
00119   itkGetConstReferenceMacro( OutputSpacing, SpacingType );
00120 
00122   itkSetMacro(OutputOrigin, OriginPointType);
00123   virtual void SetOutputOrigin( const double* values);
00125 
00127   itkSetMacro( OutputDirection, DirectionType );
00128   itkGetConstReferenceMacro( OutputDirection, DirectionType );
00130 
00132   itkGetConstReferenceMacro( OutputOrigin, OriginPointType );
00133 
00135   itkSetConstObjectMacro( SourceLandmarks, LandmarkContainer );
00136   itkSetConstObjectMacro( TargetLandmarks, LandmarkContainer );
00138 
00144   virtual void GenerateOutputInformation();
00145 
00146 
00148   unsigned long GetMTime( void ) const;
00149 
00150 protected:
00151   DeformationFieldSource();
00152   ~DeformationFieldSource() {};
00153   void PrintSelf(std::ostream& os, Indent indent) const;
00154 
00159   void GenerateData();
00160 
00164   void PrepareKernelBaseSpline();
00165 
00166 private:
00167   DeformationFieldSource(const Self&); //purposely not implemented
00168   void operator=(const Self&); //purposely not implemented
00169 
00170   KernelTransformPointerType    m_KernelTransform;   // Coordinate transform to use
00171 
00172   OutputImageRegionType         m_OutputRegion;      // Region of the output image
00173   SpacingType                   m_OutputSpacing;     // output image spacing
00174   OriginPointType               m_OutputOrigin;      // output image origin
00175   DirectionType                 m_OutputDirection;   // output image direction cosines
00176 
00177   LandmarkContainerPointer      m_SourceLandmarks;   // List of source landmarks
00178   LandmarkContainerPointer      m_TargetLandmarks;   // List of target landmarks
00179 
00180 };
00181 
00182   
00183 } // end namespace itk
00184   
00185 #ifndef ITK_MANUAL_INSTANTIATION
00186 #include "itkDeformationFieldSource.txx"
00187 #endif
00188   
00189 #endif
00190 

Generated at Mon Jul 12 2010 18:12:32 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000