X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractPatientFilter.txx;h=e9dd6fe57bd8da7f034b7c27634c99376ebbccad;hb=1f1bdd1897b6668306d6ddc531d1ee0e43363de3;hp=cfc2ab2f8d4544c992374864ab38364b5da187d3;hpb=e008d74b0ecdc4ca2eaae8c429901a78f9ef5c31;p=clitk.git 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]