X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractLungFilter.txx;h=52276f4478bb0cd55a6040efd07a763bd291d120;hb=3c89981c4f78fe15b1087f40e51e37c0c1fb087c;hp=2147b881681934dfd48ae0242c47d0b14c811969;hpb=5668d4a49a5a6b68dc80fa28f0f82b54187cb70c;p=clitk.git diff --git a/segmentation/clitkExtractLungFilter.txx b/segmentation/clitkExtractLungFilter.txx index 2147b88..52276f4 100644 --- a/segmentation/clitkExtractLungFilter.txx +++ b/segmentation/clitkExtractLungFilter.txx @@ -190,6 +190,7 @@ GenerateOutputInformation() cropFilter->SetCropLikeImage(patient); cropFilter->Update(); working_input = cropFilter->GetOutput(); + DD(working_input->GetLargestPossibleRegion()); StopCurrentStep(working_input); //-------------------------------------------------------------------- @@ -344,6 +345,7 @@ GenerateOutputInformation() autocropFilter2->SetInput(working_image); autocropFilter2->Update(); working_image = autocropFilter2->GetOutput(); + DD(working_image->GetLargestPossibleRegion()); StopCurrentStep(working_image); //-------------------------------------------------------------------- @@ -382,13 +384,14 @@ GenerateOutputInformation() // Fill Lungs if (GetFillHoles()) { StartNewStep("Fill Holes"); - /* + typedef clitk::FillMaskFilter FillMaskFilterType; typename FillMaskFilterType::Pointer fillMaskFilter = FillMaskFilterType::New(); - fillMaskFilter(working_image); + fillMaskFilter->SetInput(working_image); + fillMaskFilter->AddDirection(2); + //fillMaskFilter->AddDirection(1); fillMaskFilter->Update(); working_image = fillMaskFilter->GetOutput(); StopCurrentStep(working_image); - */ } //-------------------------------------------------------------------- @@ -411,13 +414,14 @@ GenerateOutputInformation() // Decompose the first label static const unsigned int Dim = ImageType::ImageDimension; if (initialNumberOfLabels<2) { + DD(initialNumberOfLabels); // Structuring element radius typename ImageType::SizeType radius; for (unsigned int i=0;i DecomposeAndReconstructFilterType; typename DecomposeAndReconstructFilterType::Pointer decomposeAndReconstructFilter=DecomposeAndReconstructFilterType::New(); decomposeAndReconstructFilter->SetInput(working_image); - decomposeAndReconstructFilter->SetVerbose(false); + decomposeAndReconstructFilter->SetVerbose(true); decomposeAndReconstructFilter->SetRadius(radius); decomposeAndReconstructFilter->SetMaximumNumberOfLabels(2); decomposeAndReconstructFilter->SetMinimumObjectSize(this->GetMinimalComponentSize()); @@ -534,7 +538,8 @@ TracheaRegionGrowing() f->SetLower(-2000); f->SetUpper(GetUpperThresholdForTrachea()); f->SetMinimumLowerThreshold(-2000); - f->SetMaximumUpperThreshold(0); + // f->SetMaximumUpperThreshold(0); // MAYBE TO CHANGE ??? + f->SetMaximumUpperThreshold(-800); // MAYBE TO CHANGE ??? f->SetAdaptLowerBorder(false); f->SetAdaptUpperBorder(true); f->SetMinimumSize(5000); @@ -542,12 +547,15 @@ TracheaRegionGrowing() f->SetMultiplier(GetMultiplierForTrachea()); f->SetThresholdStepSize(GetThresholdStepSizeForTrachea()); f->SetMinimumThresholdStepSize(1); + f->VerboseOn(); for(unsigned int i=0; iAddSeed(m_Seeds[i]); // DD(m_Seeds[i]); } f->Update(); + writeImage(f->GetOutput(), "trg.mhd"); + // take first (main) connected component trachea_tmp = Labelize(f->GetOutput(), GetBackgroundValue(),