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: 2008-10-18 16:11:13 $
00007   Version:   $Revision: 1.12 $
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 
00044   typedef TOutputImage                                   OutputImageType;
00045   typedef typename OutputImageType::SizeType             SizeType;
00046   typedef typename OutputImageType::PointType            PointType;
00047   typedef typename OutputImageType::Pointer              OutputImagePointer;
00048   typedef typename OutputImageType::ValueType            ValueType;
00049   typedef typename OutputImageType::SpacingType          SpacingType;
00050   typedef typename OutputImageType::DirectionType        DirectionType;
00051   
00053   itkNewMacro(Self);
00054 
00056   itkTypeMacro(SpatialObjectToImageFilter, ImageSource);
00057 
00059   typedef typename Superclass::OutputImageRegionType      OutputImageRegionType;
00060 
00062   typedef TInputSpatialObject                             InputSpatialObjectType;
00063   typedef typename InputSpatialObjectType::Pointer        InputSpatialObjectPointer;
00064   typedef typename InputSpatialObjectType::ConstPointer   InputSpatialObjectConstPointer;
00065   typedef typename TInputSpatialObject::ChildrenListType  ChildrenListType;
00066 
00068   itkStaticConstMacro(ObjectDimension, unsigned int,
00069                       InputSpatialObjectType::ObjectDimension);
00070 
00071   itkStaticConstMacro(OutputImageDimension, unsigned int,
00072                       TOutputImage::ImageDimension);
00073 
00075   virtual void SetInput( const InputSpatialObjectType *object);
00076   virtual void SetInput( unsigned int, const InputSpatialObjectType * object);
00077   const InputSpatialObjectType * GetInput( void );
00078   const InputSpatialObjectType * GetInput( unsigned int idx );
00080 
00085   virtual void SetSpacing( const SpacingType& spacing);
00086   virtual void SetSpacing( const double* spacing);
00087   virtual void SetSpacing( const float* spacing);
00088   virtual const double * GetSpacing( void ) const;
00090 
00093   virtual void SetDirection( const DirectionType & direction );
00094   virtual const DirectionType & GetDirection( void ) const;
00096 
00103   itkSetMacro( InsideValue, ValueType );
00104   itkGetMacro( InsideValue, ValueType );
00106 
00113   itkSetMacro( OutsideValue, ValueType );
00114   itkGetMacro( OutsideValue, ValueType );
00116 
00121   virtual void SetOrigin( const PointType& origin );
00122   virtual void SetOrigin( const double* origin );
00123   virtual void SetOrigin( const float* origin );
00124   virtual const double * GetOrigin( void ) const;
00126 
00131   itkSetMacro( ChildrenDepth, unsigned int );
00132   itkGetMacro( ChildrenDepth, unsigned int );
00134 
00136   itkSetMacro( Size, SizeType );
00137   itkGetMacro( Size, SizeType );
00139 
00142   itkSetMacro( UseObjectValue, bool );
00143   itkGetMacro( UseObjectValue, bool );
00145 
00146 protected:
00147   SpatialObjectToImageFilter();
00148   ~SpatialObjectToImageFilter();
00149 
00150   virtual void GenerateOutputInformation(){}; // do nothing
00151   virtual void GenerateData();
00152 
00153   SizeType      m_Size;
00154   double        m_Spacing[OutputImageDimension];
00155   double        m_Origin[OutputImageDimension];
00156   DirectionType m_Direction;
00157 
00158   unsigned int  m_ChildrenDepth;
00159   ValueType     m_InsideValue;
00160   ValueType     m_OutsideValue;
00161   bool          m_UseObjectValue;
00162 
00163   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00164 
00165 private:
00166 
00167   SpatialObjectToImageFilter(const Self&); //purposely not implemented
00168   void operator=(const Self&); //purposely not implemented
00169 
00170 };
00171 
00172 } // end namespace itk
00173 
00174 #ifndef ITK_MANUAL_INSTANTIATION
00175 #include "itkSpatialObjectToImageFilter.txx"
00176 #endif
00177 
00178 #endif
00179 

Generated at Sat Feb 28 13:36:13 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000