X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractLungFilter.h;h=6ec698d3a204bc98dddd17190dafa44ba8e83209;hb=880e33e1299652f7a55ff47b8d65eb89f5578e5e;hp=c62afe527066816da79fd6bc43c2611bea7c9ed4;hpb=e0464c9f7bdde185755d60e9dead188291fc3550;p=clitk.git diff --git a/segmentation/clitkExtractLungFilter.h b/segmentation/clitkExtractLungFilter.h index c62afe5..6ec698d 100644 --- a/segmentation/clitkExtractLungFilter.h +++ b/segmentation/clitkExtractLungFilter.h @@ -54,30 +54,10 @@ namespace clitk { */ //-------------------------------------------------------------------- - - //-------------------------------------------------------------------- -template -class Bifurcation -{ -public: - Bifurcation(IndexType _index, PixelType _l, PixelType _l1, PixelType _l2) { - index = _index; - _l = l; - _l1 = l1; - _l2 = l2; - } - IndexType index; - PixelType l; - PixelType l1; - PixelType l2; -}; - //-------------------------------------------------------------------- - - //-------------------------------------------------------------------- template class ITK_EXPORT ExtractLungFilter: - public clitk::FilterBase, + public virtual clitk::FilterBase, public itk::ImageToImageFilter { @@ -103,6 +83,7 @@ public: typedef typename ImageType::PixelType InputImagePixelType; typedef typename ImageType::SizeType InputImageSizeType; typedef typename ImageType::IndexType InputImageIndexType; + typedef typename ImageType::PointType InputImagePointType; typedef TMaskImageType MaskImageType; typedef typename MaskImageType::ConstPointer MaskImageConstPointer; @@ -111,6 +92,7 @@ public: typedef typename MaskImageType::PixelType MaskImagePixelType; typedef typename MaskImageType::SizeType MaskImageSizeType; typedef typename MaskImageType::IndexType MaskImageIndexType; + typedef typename MaskImageType::PointType MaskImagePointType; itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension); typedef int InternalPixelType; @@ -147,6 +129,10 @@ public: itkGetConstMacro(UpperThreshold, InputImagePixelType); GGO_DefineOption(upper, SetUpperThreshold, InputImagePixelType); + itkSetMacro(NumberOfSlicesToSkipBeforeSearchingSeed, int); + itkGetConstMacro(NumberOfSlicesToSkipBeforeSearchingSeed, int); + GGO_DefineOption(skipslices, SetNumberOfSlicesToSkipBeforeSearchingSeed, int); + itkSetMacro(LowerThreshold, InputImagePixelType); itkGetConstMacro(LowerThreshold, InputImagePixelType); itkSetMacro(UseLowerThreshold, bool); @@ -193,15 +179,15 @@ public: itkGetConstMacro(LabelizeParameters3, LabelParamType*); GGO_DefineOption_LabelParam(3, SetLabelizeParameters3, LabelParamType); - // Step 5 options LungSeparation - // itkSetMacro(FinalOpenClose, bool); - // itkGetConstMacro(FinalOpenClose, bool); - // itkBooleanMacro(FinalOpenClose); + // Step 5 final openclose + itkSetMacro(FinalOpenClose, bool); + itkGetConstMacro(FinalOpenClose, bool); + itkBooleanMacro(FinalOpenClose); + GGO_DefineOption_Flag(openclose, SetFinalOpenClose); - // Bronchial bifurcations - itkSetMacro(FindBronchialBifurcations, bool); - itkGetConstMacro(FindBronchialBifurcations, bool); - itkBooleanMacro(FindBronchialBifurcations); + itkSetMacro(FinalOpenCloseRadius, int); + itkGetConstMacro(FinalOpenCloseRadius, int); + GGO_DefineOption(opencloseRadius, SetFinalOpenCloseRadius, int); protected: ExtractLungFilter(); @@ -236,6 +222,7 @@ public: InputImagePixelType m_ThresholdStepSizeForTrachea; double m_MultiplierForTrachea; std::vector m_Seeds; + int m_NumberOfSlicesToSkipBeforeSearchingSeed; // Step 3 int m_NumberOfHistogramBins; @@ -246,19 +233,19 @@ public: LabelParamType* m_LabelizeParameters3; // Step 5 - // bool m_FinalOpenClose; - - bool m_FindBronchialBifurcations; - + bool m_FinalOpenClose; + int m_FinalOpenCloseRadius; + + // Main functions virtual void GenerateOutputInformation(); virtual void GenerateData(); + + // Functions for trachea extraction + bool SearchForTracheaSeed(int skip); + void SearchForTrachea(); + void TracheaRegionGrowing(); + double ComputeTracheaVolume(); - typedef Bifurcation BifurcationType; - void TrackFromThisIndex(std::vector & listOfBifurcations, - MaskImagePointer skeleton, - MaskImageIndexType index, - MaskImagePixelType label); - private: ExtractLungFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented