]> Creatis software - clitk.git/blobdiff - itk/clitkAddRelativePositionConstraintToLabelImageFilter.h
With ITK 5.0, itk::ProcessObject::VerifyInputInformation are now declared const
[clitk.git] / itk / clitkAddRelativePositionConstraintToLabelImageFilter.h
index c3655719294752311d5f94da12a30fbe662d414e..df052838b2f7e12e139a77fccdd734b3a0f80a16 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to: 
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ======================================================================-====*/
+  ===========================================================================**/
 
 #ifndef CLITKADDRELATIVEPOSITIONCONSTRAINTTOLABELIMAGEFILTER_H
 #define CLITKADDRELATIVEPOSITIONCONSTRAINTTOLABELIMAGEFILTER_H
 
 // clitk
 #include "clitkFilterBase.h"
+#include "clitkCropLikeImageFilter.h"
 
 // itk
 #include <itkPasteImageFilter.h>
@@ -84,21 +85,24 @@ namespace clitk {
     } OrientationTypeEnumeration;
 
     /** Input : initial image and object */
-    void SetInput(const ImageType * image);
+    void SetInput(const ImageType * image) ITK_OVERRIDE;
     void SetInputObject(const ImageType * image);
     
     // Options
     void AddOrientationType(OrientationTypeEnumeration orientation);
     void AddOrientationTypeString(std::string s);
     void ClearOrientationType();
-    void AddAngles(double a, double b);
+    void AddAnglesInRad(double a, double b);
+    void AddAnglesInDeg(double a, double b);
+    double GetAngle1InRad(int i) { return m_Angle1[i]; }
+    double GetAngle2InRad(int i) { return m_Angle2[i]; }
     int GetNumberOfAngles();
     std::string GetOrientationTypeString(int i) { return m_OrientationTypeString[i]; }
     std::vector<std::string> & GetOrientationTypeString() { return m_OrientationTypeString; }
 
-    itkGetConstMacro(ResampleBeforeRelativePositionFilter, bool);
-    itkSetMacro(ResampleBeforeRelativePositionFilter, bool);
-    itkBooleanMacro(ResampleBeforeRelativePositionFilter);
+    itkGetConstMacro(IntermediateSpacingFlag, bool);
+    itkSetMacro(IntermediateSpacingFlag, bool);
+    itkBooleanMacro(IntermediateSpacingFlag);
 
     itkGetConstMacro(IntermediateSpacing, double);
     itkSetMacro(IntermediateSpacing, double);
@@ -128,6 +132,32 @@ namespace clitk {
     itkSetMacro(CombineWithOrFlag, bool);
     itkBooleanMacro(CombineWithOrFlag);
 
+    itkGetConstMacro(FuzzyMapOnlyFlag, bool);
+    itkSetMacro(FuzzyMapOnlyFlag, bool);
+    itkBooleanMacro(FuzzyMapOnlyFlag);
+
+    itkGetConstMacro(FastFlag, bool);
+    itkSetMacro(FastFlag, bool);
+    itkBooleanMacro(FastFlag);
+
+    itkGetConstMacro(Radius, double);
+    itkSetMacro(Radius, double);
+
+    itkSetMacro(K1, double);
+    itkGetMacro(K1, double);
+
+    typename FloatImageType::Pointer GetFuzzyMap() { return m_FuzzyMap; }
+
+    // I dont want to verify inputs information
+#if ITK_VERSION_MAJOR <= 4
+    virtual void VerifyInputInformation() ITK_OVERRIDE { }
+#else
+    virtual void VerifyInputInformation() const ITK_OVERRIDE { }
+#endif
+    
+    // For debug
+    void PrintOptions();
+
   protected:
     AddRelativePositionConstraintToLabelImageFilter();
     virtual ~AddRelativePositionConstraintToLabelImageFilter() {}
@@ -140,20 +170,26 @@ namespace clitk {
     PixelType m_ObjectBackgroundValue;
     std::vector<double> m_Angle1;
     std::vector<double> m_Angle2;
-    bool m_ResampleBeforeRelativePositionFilter;
+    bool m_IntermediateSpacingFlag;
     bool m_AutoCropFlag;
     bool m_InverseOrientationFlag;
     bool m_RemoveObjectFlag;
     bool m_CombineWithOrFlag;
+    bool m_FuzzyMapOnlyFlag;
+    bool m_FastFlag;
+    double m_Radius;
+    double m_K1;
 
-    virtual void GenerateOutputInformation();
-    virtual void GenerateInputRequestedRegion();
-    virtual void GenerateData();
+    virtual void GenerateOutputInformation() ITK_OVERRIDE;
+    virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
+    virtual void GenerateData() ITK_OVERRIDE;
 
-    typedef itk::PasteImageFilter<ImageType,ImageType> PadFilterType;
+    typedef itk::PasteImageFilter<ImageType,ImageType> PasteFilterType;
+    typedef itk::PasteImageFilter<FloatImageType,FloatImageType> PasteFloatFilterType;
     typename ImageType::Pointer working_image;
     typename ImageType::Pointer object_resampled;
     typename FloatImageType::Pointer relPos;
+    typename FloatImageType::Pointer m_FuzzyMap;
     ImagePointer input;
     ImagePointer object;