X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkFooImageGenericFilter.txx;h=1724454b17a10776e711227679ed46c999f17f27;hb=f49bf3a44e6deb7f840f4f63d5609206c0042b09;hp=57895ee3b0e6716840baf071bba84a8f56f1280c;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/tools/clitkFooImageGenericFilter.txx b/tools/clitkFooImageGenericFilter.txx old mode 100755 new mode 100644 index 57895ee..1724454 --- a/tools/clitkFooImageGenericFilter.txx +++ b/tools/clitkFooImageGenericFilter.txx @@ -18,15 +18,6 @@ #ifndef clitkFooImageGenericFilter_txx #define clitkFooImageGenericFilter_txx -/* ================================================= - * @file clitkFooImageGenericFilter.txx - * @author Jef Vandemeulebroucke - * @date 29 june 2009 - * - * @brief - * - ===================================================*/ - // itk include #include "itkBinaryThresholdImageFilter.h" #include "itkMaskImageFilter.h" @@ -63,14 +54,14 @@ template void FooImageGenericFilter::SetArgsInfo(const args_info_type & a) { mArgsInfo=a; - SetIOVerbose(mArgsInfo.verbose_flag); + this->SetIOVerbose(mArgsInfo.verbose_flag); if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes(); if (mArgsInfo.input_given) { - SetInputFilename(mArgsInfo.input_arg); + this->SetInputFilename(mArgsInfo.input_arg); } if (mArgsInfo.output_given) { - SetOutputFilename(mArgsInfo.output_arg); + this->SetOutputFilename(mArgsInfo.output_arg); } } //-------------------------------------------------------------------- @@ -95,40 +86,11 @@ FooImageGenericFilter::UpdateWithInputImageType() typedef itk::BinaryThresholdImageFilter BinaryThresholdImageFilterType; typename BinaryThresholdImageFilterType::Pointer thresholdFilter=BinaryThresholdImageFilterType::New(); thresholdFilter->SetInput(input); - thresholdFilter->SetInsideValue(mArgsInfo.fg_arg); - - if (mArgsInfo.lower_given) thresholdFilter->SetLowerThreshold(static_cast(mArgsInfo.lower_arg)); - if (mArgsInfo.upper_given) thresholdFilter->SetUpperThreshold(static_cast(mArgsInfo.upper_arg)); - - if (mArgsInfo.mode_arg == std::string("both")) { - thresholdFilter->SetOutsideValue(mArgsInfo.bg_arg); - thresholdFilter->Update(); - - typename OutputImageType::Pointer outputImage = thresholdFilter->GetOutput(); - this->template SetNextOutput(outputImage); - } else { - typename InputImageType::Pointer outputImage; - thresholdFilter->SetOutsideValue(0); - if (mArgsInfo.mode_arg == std::string("BG")) { - typedef itk::MaskImageFilter maskFilterType; - typename maskFilterType::Pointer maskFilter = maskFilterType::New(); - maskFilter->SetInput1(input); - maskFilter->SetInput2(thresholdFilter->GetOutput()); - maskFilter->SetOutsideValue(mArgsInfo.bg_arg); - maskFilter->Update(); - outputImage = maskFilter->GetOutput(); - } else { - typedef itk::MaskNegatedImageFilter maskFilterType; - typename maskFilterType::Pointer maskFilter = maskFilterType::New(); - maskFilter->SetInput1(input); - maskFilter->SetInput2(thresholdFilter->GetOutput()); - maskFilter->SetOutsideValue(mArgsInfo.fg_arg); - maskFilter->Update(); - outputImage = maskFilter->GetOutput(); - } - // Write/Save results - this->template SetNextOutput(outputImage); - } + // Set filter members + + // Write/Save results + typename OutputImageType::Pointer outputImage = thresholdFilter->GetOutput(); + this->template SetNextOutput(outputImage); } //--------------------------------------------------------------------