]> Creatis software - clitk.git/blobdiff - segmentation/clitkExtractMediastinumFilter.h
Add clitkImage2DicomRTStructFilter to convert an image into a dicom-rt-struct
[clitk.git] / segmentation / clitkExtractMediastinumFilter.h
index 411e20f9a012f16dee145f44f5767ce9b50d0787..61abdee1707a5e7ce533741d6908995ade1020d7 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
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ======================================================================-====*/
+  ===========================================================================**/
 
 #ifndef CLITKEXTRACTMEDIASTINUMFILTER_H
 #define CLITKEXTRACTMEDIASTINUMFILTER_H
@@ -27,11 +27,12 @@ namespace clitk {
   //--------------------------------------------------------------------
   /*
     Try to extract the mediastinum part of a thorax CT.
-    Inputs : 
-    - Patient label image
-    - Lungs label image
-    - Bones label image
-    - Trachea label image
+    Input masks needed : 
+    - Patient
+    - Lungs 
+    - Bones [Optional]
+    - Trachea
+    - VertebralBody 
   */
   //--------------------------------------------------------------------
   
@@ -63,6 +64,10 @@ namespace clitk {
     typedef typename MaskImageType::IndexType    MaskImageIndexType; 
     typedef typename MaskImageType::PointType    MaskImagePointType; 
         
+    typedef itk::Image<MaskImagePixelType, 2>    MaskSliceType;
+    typedef typename MaskSliceType::Pointer      MaskSlicePointer;
+    typedef typename MaskSliceType::PointType    MaskSlicePointType;
+
     /** Standard class typedefs. */
     typedef itk::ImageToImageFilter<TImageType, MaskImageType> Superclass;
     typedef ExtractMediastinumFilter            Self;
@@ -116,24 +121,15 @@ namespace clitk {
     itkSetMacro(IntermediateSpacing, double);
     itkGetConstMacro(IntermediateSpacing, double);
 
-    itkSetMacro(FuzzyThreshold1, double);
-    itkGetConstMacro(FuzzyThreshold1, double);
-
-    itkSetMacro(FuzzyThreshold2, double);
-    itkGetConstMacro(FuzzyThreshold2, double);
-
-    itkSetMacro(FuzzyThreshold3, double);
-    itkGetConstMacro(FuzzyThreshold3, double);
-
     itkBooleanMacro(UseBones);
     itkSetMacro(UseBones, bool);
     itkGetConstMacro(UseBones, bool);
 
-    itkSetMacro(UpperThreshold, double);
-    itkGetConstMacro(UpperThreshold, double);
+    itkSetMacro(DistanceMaxToAnteriorPartOfTheVertebralBody, double);
+    itkGetConstMacro(DistanceMaxToAnteriorPartOfTheVertebralBody, double);
 
-    itkSetMacro(LowerThreshold, double);
-    itkGetConstMacro(LowerThreshold, double);
+    void SetFuzzyThreshold(std::string tag, double value);
+    double GetFuzzyThreshold(std::string tag);
 
   protected:
     ExtractMediastinumFilter();
@@ -156,15 +152,18 @@ namespace clitk {
     MaskImagePixelType m_BackgroundValue;
     MaskImagePixelType m_ForegroundValue;
 
-    typename MaskImageType::Pointer output;
+    MaskImagePointer output;
+    MaskImagePointer patient;
+    MaskImagePointer lung;
+    MaskImagePointer bones;
+    MaskImagePointer trachea;
 
+    std::map<std::string, double> m_FuzzyThreshold;
     double m_IntermediateSpacing;
-    double m_FuzzyThreshold1;
-    double m_FuzzyThreshold2;
-    double m_FuzzyThreshold3;
     bool   m_UseBones;
-    double m_UpperThreshold;
-    double m_LowerThreshold;
+    double m_DistanceMaxToAnteriorPartOfTheVertebralBody;
+
+    void RemovePostPartOfVertebralBody();
     
     std::string m_OutputMediastinumFilename;