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

itkGridImageSource.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGridImageSource.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-14 21:12:03 $
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 #ifndef __itkGridImageSource_h
00018 #define __itkGridImageSource_h
00019 
00020 #include "itkImageSource.h"
00021 #include "itkFixedArray.h"
00022 #include "itkKernelFunction.h"
00023 #include "itkVectorContainer.h"
00024  
00025 #include "vnl/vnl_vector.h" 
00026 
00027 namespace itk
00028 {
00029 
00055 template <typename TOutputImage>
00056 class ITK_EXPORT GridImageSource : public ImageSource<TOutputImage>
00057 {
00058 public:
00060   typedef GridImageSource                                  Self;
00061   typedef ImageSource<TOutputImage>                        Superclass;
00062   typedef SmartPointer<Self>                               Pointer;
00063   typedef SmartPointer<const Self>                         ConstPointer;
00064 
00066   itkTypeMacro( GridImageSource, ImageSource );
00067 
00069   itkNewMacro(Self);
00070 
00071   typedef double                                           RealType;
00072 
00074   itkStaticConstMacro( ImageDimension, unsigned int, 
00075     TOutputImage::ImageDimension );
00076 
00078   typedef TOutputImage                                     ImageType;
00079   typedef typename TOutputImage::RegionType                ImageRegionType;
00080   typedef typename TOutputImage::PixelType                 PixelType;
00081   typedef typename TOutputImage::SpacingType               SpacingType;
00082   typedef typename TOutputImage::PointType                 OriginType;
00083   typedef typename TOutputImage::DirectionType             DirectionType;
00084   typedef typename TOutputImage::SizeType                  SizeType;
00085 
00087   typedef FixedArray<RealType, itkGetStaticConstMacro(ImageDimension)>
00088                                                            ArrayType;
00089   typedef FixedArray<bool, itkGetStaticConstMacro(ImageDimension)>
00090                                                            BoolArrayType; 
00091   typedef vnl_vector<RealType>                             PixelArrayType;
00092   typedef VectorContainer<unsigned long, PixelArrayType>   PixelArrayContainerType;
00094 
00096   itkSetMacro( Spacing, SpacingType );
00097   itkGetConstReferenceMacro( Spacing, SpacingType );
00099 
00100   itkSetMacro( Origin, OriginType );
00101   itkGetConstReferenceMacro( Origin, OriginType );
00102 
00103   itkSetMacro( Direction, DirectionType );
00104   itkGetConstReferenceMacro( Direction, DirectionType );
00105 
00106   itkSetMacro( Size, SizeType );
00107   itkGetConstReferenceMacro( Size, SizeType );
00108   
00110   itkSetObjectMacro( KernelFunction, KernelFunction );
00111   itkGetConstReferenceObjectMacro( KernelFunction, KernelFunction );
00113 
00114   itkSetMacro( Sigma, ArrayType );
00115   itkGetConstReferenceMacro( Sigma, ArrayType );
00116 
00117   itkSetMacro( GridSpacing, ArrayType );
00118   itkGetConstReferenceMacro( GridSpacing, ArrayType );
00119 
00120   itkSetMacro( GridOffset, ArrayType );
00121   itkGetConstReferenceMacro( GridOffset, ArrayType );
00122 
00123   itkSetMacro( WhichDimensions, BoolArrayType );
00124   itkGetConstReferenceMacro( WhichDimensions, BoolArrayType );
00125 
00126   itkSetMacro( Scale, RealType );
00127   itkGetConstReferenceMacro( Scale, RealType );
00128 
00129 protected:
00130   GridImageSource();
00131   ~GridImageSource(){};
00132   void PrintSelf(std::ostream& os, Indent indent) const;
00133 
00134   virtual void 
00135   ThreadedGenerateData(const ImageRegionType& 
00136                        outputRegionForThread, int threadId );
00137   virtual void BeforeThreadedGenerateData();
00138   virtual void GenerateOutputInformation();
00139 
00140 private:
00141   GridImageSource(const GridImageSource&); //purposely not implemented
00142   void operator=(const GridImageSource&); //purposely not implemented
00143 
00146   SizeType       m_Size;       //size 
00147   SpacingType    m_Spacing;    //spacing
00148   OriginType     m_Origin;     //origin
00149   DirectionType  m_Direction;  //direction
00150 
00154   typename PixelArrayContainerType::Pointer m_PixelArrays;
00155 
00157   typename KernelFunction::Pointer m_KernelFunction;
00158 
00161   ArrayType m_Sigma;
00162 
00164   ArrayType m_GridSpacing;
00165 
00167   ArrayType m_GridOffset;
00168 
00170   BoolArrayType m_WhichDimensions;
00171 
00173   RealType m_Scale;
00174 };
00175 
00176 } // end namespace itk
00177 
00178 #ifndef ITK_MANUAL_INSTANTIATION
00179 #include "itkGridImageSource.txx"
00180 #endif
00181 
00182 #endif
00183 

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