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 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(){};
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&);
00139 void operator=(
const Self&);
00140
00141
00142 };
00143
00144 }
00145
00146
#ifndef ITK_MANUAL_INSTANTIATION
00147
#include "itkSpatialObjectToImageFilter.txx"
00148
#endif
00149
00150
#endif