From 7c4ea05111826e62fe6efc7886dd9b034abf7cd1 Mon Sep 17 00:00:00 2001 From: srit Date: Fri, 10 Sep 2010 12:38:23 +0000 Subject: [PATCH] Try to adapt the filter to Jef's clitk2 solution. --- segmentation/clitkExtractPatientFilter.txx | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/segmentation/clitkExtractPatientFilter.txx b/segmentation/clitkExtractPatientFilter.txx index cfc2ab2..e9dd6fe 100644 --- a/segmentation/clitkExtractPatientFilter.txx +++ b/segmentation/clitkExtractPatientFilter.txx @@ -194,10 +194,10 @@ GenerateOutputInformation() { typedef itk::BinaryThresholdImageFilter iBinarizeFilterType; typename iBinarizeFilterType::Pointer binarizeFilter2 = iBinarizeFilterType::New(); binarizeFilter2->SetInput(working_image); - binarizeFilter2->SetLowerThreshold(this->GetForegroundValue()); - binarizeFilter2->SetUpperThreshold(this->GetForegroundValue()); - binarizeFilter2 ->SetInsideValue(this->GetBackgroundValue()); - binarizeFilter2 ->SetOutsideValue(this->GetForegroundValue()); + binarizeFilter2->SetLowerThreshold(GetFirstKeep()); + binarizeFilter2->SetUpperThreshold(GetLastKeep()); + binarizeFilter2 ->SetInsideValue(0); + binarizeFilter2 ->SetOutsideValue(1); // binarizeFilter2 ->Update(); // NEEDED ? typename ConnectFilterType::Pointer connectFilter2 = ConnectFilterType::New(); @@ -231,19 +231,6 @@ GenerateOutputInformation() { StopCurrentStep(working_image); } - //-------------------------------------------------------------------- - //-------------------------------------------------------------------- - StartNewStep("Keep patient's labels"); - typename iBinarizeFilterType::Pointer binarizeFilter3 = iBinarizeFilterType::New(); - binarizeFilter3->SetInput(working_image); - binarizeFilter3->SetLowerThreshold(GetFirstKeep()); - binarizeFilter3->SetUpperThreshold(GetLastKeep()); - binarizeFilter3 ->SetInsideValue(this->GetForegroundValue()); - binarizeFilter3 ->SetOutsideValue(this->GetBackgroundValue()); - binarizeFilter3->Update(); - working_image = binarizeFilter3->GetOutput(); - StopCurrentStep(working_image); - //-------------------------------------------------------------------- //-------------------------------------------------------------------- // [Optional] -- 2.47.1