]> Creatis software - clitk.git/blobdiff - itk/clitkSliceBySliceRelativePositionFilter.h
Merge branch 'master' of /home/dsarrut/clitk3.server
[clitk.git] / itk / clitkSliceBySliceRelativePositionFilter.h
index 01f9cd9c833578d802af33e96ba39d0c6cfa43f7..53c5a87c1b345815eb7a3e05a218d334daa2ab56 100644 (file)
@@ -21,6 +21,7 @@
 
 // clitk
 #include "clitkFilterBase.h"
+#include "clitkAddRelativePositionConstraintToLabelImageFilter.h"
 
 namespace clitk {
   
@@ -32,13 +33,12 @@ namespace clitk {
   
   template <class ImageType>
   class ITK_EXPORT SliceBySliceRelativePositionFilter:
-    public clitk::FilterBase, 
-    public itk::ImageToImageFilter<ImageType, ImageType> 
+    public AddRelativePositionConstraintToLabelImageFilter<ImageType>
   {
 
   public:
     /** Standard class typedefs. */
-    typedef itk::ImageToImageFilter<ImageType, ImageType> Superclass;
+    typedef AddRelativePositionConstraintToLabelImageFilter<ImageType>   Superclass;
     typedef SliceBySliceRelativePositionFilter              Self;
     typedef itk::SmartPointer<Self>                         Pointer;
     typedef itk::SmartPointer<const Self>                   ConstPointer;
@@ -50,6 +50,10 @@ namespace clitk {
     itkTypeMacro(SliceBySliceRelativePositionFilter, ImageToImageFilter);
     FILTERBASE_INIT;
 
+    /** ImageDimension constants */
+    itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
+    typedef itk::Image<float, ImageDimension> FloatImageType;
+
     /** Some convenient typedefs. */
     typedef typename ImageType::ConstPointer ImageConstPointer;
     typedef typename ImageType::Pointer      ImagePointer;
@@ -57,28 +61,46 @@ namespace clitk {
     typedef typename ImageType::PixelType    PixelType;
     typedef typename ImageType::SpacingType  SpacingType;
     typedef typename ImageType::SizeType     SizeType;
+    typedef itk::Image<PixelType, ImageDimension-1> SliceType;
+    typedef clitk::AddRelativePositionConstraintToLabelImageFilter<SliceType> RelPosFilterType;
+    typedef typename RelPosFilterType::OrientationTypeEnumeration OrientationTypeEnumeration;
     
-    /** ImageDimension constants */
-    itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
-    typedef itk::Image<float, ImageDimension> FloatImageType;
-
     /** Input : initial image and object */
     void SetInput(const ImageType * image);
     void SetInputObject(const ImageType * image);
-    
+
     // Options
+    void PrintOptions();
     itkGetConstMacro(Direction, int);
     itkSetMacro(Direction, int);
-    itkGetConstMacro(ObjectBackgroundValue, PixelType);
-    itkSetMacro(ObjectBackgroundValue, PixelType);
+
+    itkGetConstMacro(UniqueConnectedComponentBySlice, bool);
+    itkSetMacro(UniqueConnectedComponentBySlice, bool);
+    itkBooleanMacro(UniqueConnectedComponentBySlice);
+
+    itkGetConstMacro(IgnoreEmptySliceObjectFlag, bool);
+    itkSetMacro(IgnoreEmptySliceObjectFlag, bool);
+    itkBooleanMacro(IgnoreEmptySliceObjectFlag);
+
+    itkGetConstMacro(UseASingleObjectConnectedComponentBySliceFlag, bool);
+    itkSetMacro(UseASingleObjectConnectedComponentBySliceFlag, bool);
+    itkBooleanMacro(UseASingleObjectConnectedComponentBySliceFlag);
+
+    itkGetConstMacro(CCLSelectionFlag, bool);
+    itkSetMacro(CCLSelectionFlag, bool);
+    itkBooleanMacro(CCLSelectionFlag);
+    itkGetConstMacro(CCLSelectionDimension, int);
+    itkSetMacro(CCLSelectionDimension, int);
+    itkGetConstMacro(CCLSelectionDirection, int);
+    itkSetMacro(CCLSelectionDirection, int);
+    itkGetConstMacro(CCLSelectionIgnoreSingleCCLFlag, bool);
+    itkSetMacro(CCLSelectionIgnoreSingleCCLFlag, bool);
+    itkBooleanMacro(CCLSelectionIgnoreSingleCCLFlag);
 
   protected:
     SliceBySliceRelativePositionFilter();
     virtual ~SliceBySliceRelativePositionFilter() {}
     
-    int m_Direction;
-    PixelType m_ObjectBackgroundValue;
-
     virtual void GenerateOutputInformation();
     virtual void GenerateInputRequestedRegion();
     virtual void GenerateData();
@@ -87,6 +109,14 @@ namespace clitk {
     ImagePointer object;
     ImagePointer m_working_input;
     ImagePointer m_working_object;
+    bool         m_UniqueConnectedComponentBySlice;
+    int          m_Direction;
+    bool         m_IgnoreEmptySliceObjectFlag;
+    bool         m_UseASingleObjectConnectedComponentBySliceFlag;
+    bool         m_CCLSelectionFlag;
+    int          m_CCLSelectionDimension;
+    int          m_CCLSelectionDirection;
+    bool         m_CCLSelectionIgnoreSingleCCLFlag;
 
   private:
     SliceBySliceRelativePositionFilter(const Self&); //purposely not implemented