]> Creatis software - clitk.git/blobdiff - itk/clitkRelativePositionAnalyzerFilter.h
Add ComputeBBUnion
[clitk.git] / itk / clitkRelativePositionAnalyzerFilter.h
index 2933958725e32c1e9dbe48ea811894699641348c..7d70fe79a22b9a7e096d0c07392134fde60845bc 100644 (file)
 #define CLITKRELATIVEPOSITIONANALYZERFILTER_H
 
 // clitk
-#include "clitkCommon.h"
+#include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
+#include "clitkFilterBase.h"
+#include "clitkSliceBySliceRelativePositionFilter.h"
 
 // itk
 #include <itkImageToImageFilter.h>
+#include <itkLabelStatisticsImageFilter.h>
 
 namespace clitk {
   
   //--------------------------------------------------------------------
   /*
-    TODO
+    Analyze the relative position of a Target (mask image) according
+    to some Object, in a given Support. Indicate the main important
+    position of this Target according the Object. 
   */
   //--------------------------------------------------------------------
   
   template <class ImageType>
-  class ITK_EXPORT RelativePositionAnalyzerFilter:
-    public itk::ImageToImageFilter<ImageType, ImageType> 
+  class RelativePositionAnalyzerFilter:
+    public virtual FilterBase,
+    public clitk::FilterWithAnatomicalFeatureDatabaseManagement,
+    public itk::ImageToImageFilter<ImageType, ImageType>
   {
 
   public:
     /** Standard class typedefs. */
     typedef itk::ImageToImageFilter<ImageType, ImageType>      Superclass;
-    typedef RelativePositionAnalyzerFilter                     Self;
+    typedef RelativePositionAnalyzerFilter<ImageType>          Self;
     typedef itk::SmartPointer<Self>                            Pointer;
     typedef itk::SmartPointer<const Self>                      ConstPointer;
        
@@ -63,6 +70,7 @@ namespace clitk {
     
     /** ImageDimension constants */
     itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
+    FILTERBASE_INIT;
     typedef itk::Image<float, ImageDimension> FloatImageType;
 
      /** Input : initial image and object */
@@ -71,10 +79,6 @@ namespace clitk {
     void SetInputTarget(const ImageType * image);
     
     // Options
-    itkSetMacro(VerboseFlag, bool);
-    itkGetConstMacro(VerboseFlag, bool);
-    itkBooleanMacro(VerboseFlag);
-
     itkGetConstMacro(BackgroundValue, PixelType);
     itkSetMacro(BackgroundValue, PixelType);
 
@@ -84,19 +88,29 @@ namespace clitk {
     // For debug
     void PrintOptions();
 
-  protected:
+    // I dont want to verify inputs information
+    virtual void VerifyInputInformation() { }
+    
+   protected:
     RelativePositionAnalyzerFilter();
     virtual ~RelativePositionAnalyzerFilter() {}
     
-    bool m_VerboseFlag;
     PixelType m_BackgroundValue;
     PixelType m_ForegroundValue;
     ImagePointer m_Support;
     ImagePointer m_Object;
     ImagePointer m_Target;
 
+    virtual void GenerateOutputInformation();
+    virtual void GenerateInputRequestedRegion();
     virtual void GenerateData();
 
+    typename FloatImageType::Pointer
+    ComputeFuzzyMap(ImageType * object, ImageType * target, double angle);
+    
+    void
+    ComputeOptimalThresholds(FloatImageType * map, ImageType * target, int bins, double tolerance, 
+                             double & threshold, double & reverseThreshold);
   private:
     RelativePositionAnalyzerFilter(const Self&); //purposely not implemented
     void operator=(const Self&); //purposely not implemented
@@ -107,8 +121,6 @@ namespace clitk {
 } // end namespace clitk
 //--------------------------------------------------------------------
 
-#ifndef ITK_MANUAL_INSTANTIATION
 #include "clitkRelativePositionAnalyzerFilter.txx"
-#endif
 
 #endif