1 #ifndef __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__
2 #define __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__
4 #include <itkConceptChecking.h>
5 #include <itkImageToImageFilter.h>
6 #include <itkSpatialObject.h>
14 template< class I, class O = I >
15 class SpatialObjectMaskImageFilter
16 : public itk::ImageToImageFilter< I, O >
19 typedef SpatialObjectMaskImageFilter Self;
20 typedef itk::ImageToImageFilter< I, O > Superclass;
21 typedef itk::SmartPointer< Self > Pointer;
22 typedef itk::SmartPointer< const Self > ConstPointer;
24 typedef I TInputImage;
25 typedef O TOutputImage;
27 itkStaticConstMacro( InputDimension, unsigned int, I::ImageDimension );
28 itkStaticConstMacro( OutputDimension, unsigned int, O::ImageDimension );
30 #ifdef ITK_USE_CONCEPT_CHECKING
33 ( itk::Concept::SameDimension< InputDimension, OutputDimension > )
37 typedef typename I::RegionType TRegion;
38 typedef typename O::PixelType TOutPixel;
39 typedef itk::SpatialObject< InputDimension > TSpatialObject;
43 itkTypeMacro( SpatialObjectMaskImageFilter, itk::ImageToImageFilter );
45 itkGetObjectMacro( SpatialObject, TSpatialObject );
46 itkGetConstObjectMacro( SpatialObject, TSpatialObject );
47 itkGetConstMacro( OutsideValue, TOutPixel );
49 itkSetObjectMacro( SpatialObject, TSpatialObject );
50 itkSetMacro( OutsideValue, TOutPixel );
53 O* GetPositiveOutput( );
54 const O* GetPositiveOutput( ) const;
55 O* GetNegativeOutput( );
56 const O* GetNegativeOutput( ) const;
59 SpatialObjectMaskImageFilter( );
60 virtual ~SpatialObjectMaskImageFilter( );
62 virtual void GenerateOutputInformation( );
63 virtual void ThreadedGenerateData(
64 const TRegion& region, itk::ThreadIdType threadId
68 // Purposely not implemented.
69 SpatialObjectMaskImageFilter( const Self& other );
70 Self& operator=( const Self& other );
73 typename TSpatialObject::Pointer m_SpatialObject;
74 TOutPixel m_OutsideValue;
81 #ifndef ITK_MANUAL_INSTANTIATION
82 #include <cpExtensions/Algorithms/SpatialObjectMaskImageFilter.hxx>
83 #endif // ITK_MANUAL_INSTANTIATION
85 #endif // __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__