X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractLungFilter.h;h=6ec698d3a204bc98dddd17190dafa44ba8e83209;hb=880e33e1299652f7a55ff47b8d65eb89f5578e5e;hp=6a316d2c81f9d219f8a30187c10c1da5f108dc6c;hpb=6e16222234a90c6079a8f4696c92de7349a496bb;p=clitk.git diff --git a/segmentation/clitkExtractLungFilter.h b/segmentation/clitkExtractLungFilter.h index 6a316d2..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; @@ -197,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(); @@ -251,20 +233,14 @@ 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(); - - typedef Bifurcation BifurcationType; - void TrackFromThisIndex(std::vector & listOfBifurcations, - MaskImagePointer skeleton, - MaskImageIndexType index, - MaskImagePixelType label); - - + + // Functions for trachea extraction bool SearchForTracheaSeed(int skip); void SearchForTrachea(); void TracheaRegionGrowing();