00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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[OutputImageDimension] );
00083
virtual void SetSpacing(
const float spacing[OutputImageDimension] );
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[OutputImageDimension] );
00110 virtual
void SetOrigin( const
float origin[OutputImageDimension] );
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
00124 protected:
00125 SpatialObjectToImageFilter();
00126 ~SpatialObjectToImageFilter();
00127
00128 virtual
void GenerateOutputInformation(){};
00129
virtual void GenerateData();
00130
00131
00132 SizeType m_Size;
00133
double m_Spacing[OutputImageDimension];
00134
double m_Origin[OutputImageDimension];
00135
unsigned int m_ChildrenDepth;
00136 ValueType m_InsideValue;
00137
ValueType m_OutsideValue;
00138
00139
virtual void PrintSelf(std::ostream& os,
Indent indent)
const;
00140
00141 private:
00142 SpatialObjectToImageFilter(
const Self&);
00143 void operator=(
const Self&);
00144
00145
00146 };
00147
00148 }
00149
00150
#ifndef ITK_MANUAL_INSTANTIATION
00151
#include "itkSpatialObjectToImageFilter.txx"
00152
#endif
00153
00154
#endif