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: 2005/07/27 15:21:11 $
00007   Version:   $Revision: 1.10 $
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 typename TOutputImage::PointType   PointType;
00045   typedef TOutputImage  OutputImageType;
00046   typedef typename OutputImageType::Pointer OutputImagePointer;
00047   typedef typename OutputImageType::ValueType  ValueType;
00048   typedef typename OutputImageType::SpacingType SpacingType;
00049   
00051   itkNewMacro(Self);
00052   
00054   itkTypeMacro(SpatialObjectToImageFilter,ImageSource);
00055 
00057   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00058 
00060   typedef TInputSpatialObject InputSpatialObjectType;
00061   typedef typename InputSpatialObjectType::Pointer        InputSpatialObjectPointer;
00062   typedef typename InputSpatialObjectType::ConstPointer   InputSpatialObjectConstPointer;
00063   typedef typename TInputSpatialObject::ChildrenListType   ChildrenListType;
00064 
00066   itkStaticConstMacro(ObjectDimension, unsigned int,
00067                       InputSpatialObjectType::ObjectDimension);
00068   itkStaticConstMacro(OutputImageDimension, unsigned int,
00069                       TOutputImage::ImageDimension);
00070 
00072   virtual void SetInput( const InputSpatialObjectType *object);
00073   virtual void SetInput( unsigned int, const InputSpatialObjectType * object);
00074   const InputSpatialObjectType * GetInput(void);
00075   const InputSpatialObjectType * GetInput(unsigned int idx);
00076 
00081   virtual void SetSpacing( const SpacingType& spacing);
00082   virtual void SetSpacing( const double* spacing);
00083   virtual void SetSpacing( const float* spacing);
00084   virtual const double* GetSpacing() const;
00085 
00092   itkSetMacro(InsideValue, ValueType);
00093   itkGetMacro(InsideValue, ValueType);
00094 
00101   itkSetMacro(OutsideValue, ValueType);
00102   itkGetMacro(OutsideValue, ValueType);
00103 
00108   virtual void SetOrigin( const PointType& origin);
00109   virtual void SetOrigin( const double* origin);
00110   virtual void SetOrigin( const float* origin);
00111   virtual const double * GetOrigin() const;
00112 
00117   itkSetMacro(ChildrenDepth, unsigned int);
00118   itkGetMacro(ChildrenDepth, unsigned int);
00119 
00121   itkSetMacro(Size,SizeType);
00122   itkGetMacro(Size,SizeType);
00123 
00126   itkSetMacro(UseObjectValue,bool);
00127   itkGetMacro(UseObjectValue,bool);
00128 
00129 
00130 protected:
00131   SpatialObjectToImageFilter();
00132   ~SpatialObjectToImageFilter();
00133 
00134   virtual void GenerateOutputInformation(){}; // do nothing
00135   virtual void GenerateData();
00136 
00137 
00138   SizeType     m_Size;
00139   double       m_Spacing[OutputImageDimension];
00140   double       m_Origin[OutputImageDimension];
00141   unsigned int m_ChildrenDepth;
00142   ValueType    m_InsideValue;
00143   ValueType    m_OutsideValue;
00144   bool         m_UseObjectValue;
00145 
00146   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00147 
00148 private:
00149   SpatialObjectToImageFilter(const Self&); //purposely not implemented
00150   void operator=(const Self&); //purposely not implemented
00151 
00152 
00153 };
00154 
00155 } // end namespace itk
00156 
00157 #ifndef ITK_MANUAL_INSTANTIATION
00158 #include "itkSpatialObjectToImageFilter.txx"
00159 #endif
00160 
00161 #endif

Generated at Thu May 25 00:06:04 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000