]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.h
Cast image filter added. ROI filter modified.
[cpPlugins.git] / lib / cpExtensions / Algorithms / SpatialObjectMaskImageFilter.h
index f8fd3546fe11be69f10a014607af700f6a09565d..2b81fb7834baccb730f2f4f4ef5682550cf998c6 100644 (file)
@@ -2,7 +2,7 @@
 #define __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__
 
 #include <itkConceptChecking.h>
-#include <itkInPlaceImageFilter.h>
+#include <itkImageToImageFilter.h>
 #include <itkSpatialObject.h>
 
 namespace cpExtensions
@@ -13,11 +13,11 @@ namespace cpExtensions
      */
     template< class I, class O = I >
     class SpatialObjectMaskImageFilter
-      : public itk::InPlaceImageFilter< I, O >
+      : public itk::ImageToImageFilter< I, O >
     {
     public:
       typedef SpatialObjectMaskImageFilter    Self;
-      typedef itk::InPlaceImageFilter< I, O > Superclass;
+      typedef itk::ImageToImageFilter< I, O > Superclass;
       typedef itk::SmartPointer< Self >       Pointer;
       typedef itk::SmartPointer< const Self > ConstPointer;
 
@@ -28,12 +28,10 @@ namespace cpExtensions
       itkStaticConstMacro( OutputDimension, unsigned int, O::ImageDimension );
 
 #ifdef ITK_USE_CONCEPT_CHECKING
-      // Begin concept checking
       itkConceptMacro(
         SameDimensionCheck1,
         ( itk::Concept::SameDimension< InputDimension, OutputDimension > )
         );
-      // End concept checking
 #endif
 
       typedef typename I::RegionType TRegion;
@@ -42,7 +40,7 @@ namespace cpExtensions
 
     public:
       itkNewMacro( Self );
-      itkTypeMacro( SpatialObjectMaskImageFilter, itk::InPlaceImageFilter );
+      itkTypeMacro( SpatialObjectMaskImageFilter, itk::ImageToImageFilter );
 
       itkGetObjectMacro( SpatialObject, TSpatialObject );
       itkGetConstObjectMacro( SpatialObject, TSpatialObject );
@@ -51,6 +49,12 @@ namespace cpExtensions
       itkSetObjectMacro( SpatialObject, TSpatialObject );
       itkSetMacro( OutsideValue, TOutPixel );
 
+    public:
+      O* GetPositiveOutput( );
+      const O* GetPositiveOutput( ) const;
+      O* GetNegativeOutput( );
+      const O* GetNegativeOutput( ) const;
+
     protected:
       SpatialObjectMaskImageFilter( );
       virtual ~SpatialObjectMaskImageFilter( );