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

itkSpatialObjectToImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSpatialObjectToImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:28:57 $
00007   Version:   $Revision: 1.7 $
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 __itkSpatialObjectToImageFilter_h
00018 #define __itkSpatialObjectToImageFilter_h
00019 
00020 #include "itkImageSource.h"
00021 #include "itkConceptChecking.h"
00022 
00023 namespace itk
00024 {
00025   
00034 template <class TInputSpatialObject, class TOutputImage>
00035 class ITK_EXPORT SpatialObjectToImageFilter : public ImageSource<TOutputImage>
00036 {
00037 public:
00039   typedef SpatialObjectToImageFilter  Self;
00040   typedef ImageSource<TOutputImage>  Superclass;
00041   typedef SmartPointer<Self>  Pointer;
00042   typedef SmartPointer<const Self>  ConstPointer;
00043   typedef typename TOutputImage::SizeType   SizeType;
00044   typedef TOutputImage  OutputImageType;
00045   typedef typename OutputImageType::Pointer OutputImagePointer;
00046   typedef typename OutputImageType::ValueType  ValueType;
00047   
00049   itkNewMacro(Self);
00050   
00052   itkTypeMacro(SpatialObjectToImageFilter,ImageSource);
00053 
00055   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00056 
00058   typedef TInputSpatialObject InputSpatialObjectType;
00059   typedef typename InputSpatialObjectType::Pointer        InputSpatialObjectPointer;
00060   typedef typename InputSpatialObjectType::ConstPointer   InputSpatialObjectConstPointer;
00061   typedef typename TInputSpatialObject::ChildrenListType   ChildrenListType;
00062 
00064   itkStaticConstMacro(ObjectDimension, unsigned int,
00065                       InputSpatialObjectType::ObjectDimension);
00066   itkStaticConstMacro(OutputImageDimension, unsigned int,
00067                       TOutputImage::ImageDimension);
00068 
00070   virtual void SetInput( const InputSpatialObjectType *object);
00071   virtual void SetInput( unsigned int, const InputSpatialObjectType * object);
00072   const InputSpatialObjectType * GetInput(void);
00073   const InputSpatialObjectType * GetInput(unsigned int idx);
00074 
00079   virtual void SetSpacing( const double spacing[OutputImageDimension] );
00080   virtual void SetSpacing( const float spacing[OutputImageDimension] );
00081   virtual const double* GetSpacing() const;
00082 
00089   itkSetMacro(InsideValue, ValueType);
00090   itkGetMacro(InsideValue, ValueType);
00091 
00098   itkSetMacro(OutsideValue, ValueType);
00099   itkGetMacro(OutsideValue, ValueType);
00100 
00105   virtual void SetOrigin( const double origin[OutputImageDimension] );
00106   virtual void SetOrigin( const float origin[OutputImageDimension] );
00107   virtual const double * GetOrigin() const;
00108 
00113   itkSetMacro(ChildrenDepth, unsigned int);
00114   itkGetMacro(ChildrenDepth, unsigned int);
00115 
00117   itkSetMacro(Size,SizeType);
00118   itkGetMacro(Size,SizeType);
00119 
00120 protected:
00121   SpatialObjectToImageFilter();
00122   ~SpatialObjectToImageFilter();
00123 
00124   virtual void GenerateOutputInformation(){}; // do nothing
00125   virtual void GenerateData();
00126 
00127 
00128   SizeType     m_Size;
00129   double       m_Spacing[OutputImageDimension];
00130   double       m_Origin[OutputImageDimension];
00131   unsigned int m_ChildrenDepth;
00132   ValueType    m_InsideValue;
00133   ValueType    m_OutsideValue;
00134 
00135   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00136 
00137 private:
00138   SpatialObjectToImageFilter(const Self&); //purposely not implemented
00139   void operator=(const Self&); //purposely not implemented
00140 
00141 
00142 };
00143 
00144 } // end namespace itk
00145 
00146 #ifndef ITK_MANUAL_INSTANTIATION
00147 #include "itkSpatialObjectToImageFilter.txx"
00148 #endif
00149 
00150 #endif

Generated at Tue Sep 16 11:32:10 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000