X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=segmentation%2FclitkExtractLungGenericFilter.txx;h=64e7fb85f36513f3aa75febcddfc2a965bb2098f;hb=5668d4a49a5a6b68dc80fa28f0f82b54187cb70c;hp=2bc8af880bc6fe3abc4ab4a017698aed6df55115;hpb=c8d53d40ac8f5f83843193c51ac1787a8f38ee90;p=clitk.git diff --git a/segmentation/clitkExtractLungGenericFilter.txx b/segmentation/clitkExtractLungGenericFilter.txx index 2bc8af8..64e7fb8 100644 --- a/segmentation/clitkExtractLungGenericFilter.txx +++ b/segmentation/clitkExtractLungGenericFilter.txx @@ -26,6 +26,7 @@ template clitk::ExtractLungGenericFilter::ExtractLungGenericFilter(): ImageToImageGenericFilter("ExtractLung") { + this->SetFilterBase(NULL); // Default values cmdline_parser_clitkExtractLung_init(&mArgsInfo); InitializeImageType<3>(); @@ -53,7 +54,6 @@ void clitk::ExtractLungGenericFilter::SetArgsInfo(const ArgsInfoTy SetIOVerbose(mArgsInfo.verbose_flag); if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes(); if (mArgsInfo.input_given) AddInputFilename(mArgsInfo.input_arg); - if (mArgsInfo.patient_given) AddInputFilename(mArgsInfo.patient_arg); if (mArgsInfo.output_given) AddOutputFilename(mArgsInfo.output_arg); if (mArgsInfo.outputTrachea_given) AddOutputFilename(mArgsInfo.outputTrachea_arg); } @@ -68,35 +68,28 @@ template void clitk::ExtractLungGenericFilter::UpdateWithInputImageType() { // Mask & output image type - typedef itk::Image OutputImageType; typedef itk::Image MaskImageType; // Reading input typename ImageType::Pointer input = this->template GetInput(0); - typename MaskImageType::Pointer patient = this->template GetInput(1); // Create filter - typedef clitk::ExtractLungFilter FilterType; + typedef clitk::ExtractLungFilter FilterType; typename FilterType::Pointer filter = FilterType::New(); + + // Set the filter (needed for example for threaded monitoring) + this->SetFilterBase(filter); // Set global Options filter->SetArgsInfo(mArgsInfo); filter->SetInput(input); - filter->SetInputPatientMask(patient, mArgsInfo.patientBG_arg); // Go ! filter->Update(); - // Check if error - if (filter->HasError()) { - SetLastError(filter->GetLastError()); - // No output - return; - } - // Write/Save results - typename OutputImageType::Pointer output = filter->GetOutput(); - this->template SetNextOutput(output); + typename MaskImageType::Pointer output = filter->GetOutput(); + this->template SetNextOutput(output); this->template SetNextOutput(filter->GetTracheaImage()); } //--------------------------------------------------------------------