X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractMediastinumFilter.h;h=3144c95be73a468f37d27e453342a6e406f73240;hb=a6957c4825e83c61b977ec316dd841878617ffbd;hp=ea7f86aace0697dcf793cf246d3aec0d97e52b53;hpb=573d80d0f7a17607d2ee883c21c940c0ba020282;p=clitk.git diff --git a/segmentation/clitkExtractMediastinumFilter.h b/segmentation/clitkExtractMediastinumFilter.h index ea7f86a..3144c95 100644 --- a/segmentation/clitkExtractMediastinumFilter.h +++ b/segmentation/clitkExtractMediastinumFilter.h @@ -19,27 +19,25 @@ #ifndef CLITKEXTRACTMEDIASTINUMFILTER_H #define CLITKEXTRACTMEDIASTINUMFILTER_H -#include "clitkFilterBase.h" -#include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h" +#include "clitkStructuresExtractionFilter.h" 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 */ //-------------------------------------------------------------------- template class ITK_EXPORT ExtractMediastinumFilter: - public virtual clitk::FilterBase, - public clitk::FilterWithAnatomicalFeatureDatabaseManagement, - public itk::ImageToImageFilter > + public clitk::StructuresExtractionFilter { public: @@ -63,8 +61,13 @@ namespace clitk { typedef typename MaskImageType::IndexType MaskImageIndexType; typedef typename MaskImageType::PointType MaskImagePointType; + typedef itk::Image MaskSliceType; + typedef typename MaskSliceType::Pointer MaskSlicePointer; + typedef typename MaskSliceType::PointType MaskSlicePointType; + /** Standard class typedefs. */ - typedef itk::ImageToImageFilter Superclass; + // typedef itk::ImageToImageFilter Superclass; + typedef clitk::StructuresExtractionFilter Superclass; typedef ExtractMediastinumFilter Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; @@ -83,8 +86,8 @@ namespace clitk { MaskImagePixelType fgLeftLung=1, MaskImagePixelType fgRightLung=2); void SetInputBonesLabelImage(const MaskImageType * image, MaskImagePixelType bg=0); void SetInputTracheaLabelImage(const MaskImageType * image, MaskImagePixelType bg=0); - - // Output filename (for AFBD) + + // Output filename (for AFBD) itkSetMacro(OutputMediastinumFilename, std::string); itkGetConstMacro(OutputMediastinumFilename, std::string); @@ -101,9 +104,6 @@ namespace clitk { itkSetMacro(BackgroundValueBones, MaskImagePixelType); itkGetConstMacro(BackgroundValueBones, MaskImagePixelType); - itkGetConstMacro(BackgroundValue, MaskImagePixelType); - itkGetConstMacro(ForegroundValue, MaskImagePixelType); - itkSetMacro(ForegroundValueLeftLung, MaskImagePixelType); itkGetConstMacro(ForegroundValueLeftLung, MaskImagePixelType); @@ -116,24 +116,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(); @@ -142,10 +133,7 @@ namespace clitk { virtual void GenerateOutputInformation(); virtual void GenerateInputRequestedRegion(); virtual void GenerateData(); - - itkSetMacro(BackgroundValue, MaskImagePixelType); - itkSetMacro(ForegroundValue, MaskImagePixelType); - + MaskImagePixelType m_BackgroundValuePatient; MaskImagePixelType m_BackgroundValueLung; MaskImagePixelType m_BackgroundValueBones; @@ -153,18 +141,18 @@ namespace clitk { MaskImagePixelType m_ForegroundValueLeftLung; MaskImagePixelType m_ForegroundValueRightLung; - MaskImagePixelType m_BackgroundValue; - MaskImagePixelType m_ForegroundValue; - - typename MaskImageType::Pointer output; + MaskImagePointer output; + MaskImagePointer patient; + MaskImagePointer lung; + MaskImagePointer bones; + MaskImagePointer trachea; + std::map 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;