X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkImageArithmGenericFilter.txx;h=4abb43343463652f899748d818f7d5bea3682d20;hb=1bc8f00b17a81decd50a5b01dc19623b486f51d6;hp=1afb77f55c1ae0fb970e4a9331a0e15ba9eb436e;hpb=0fce6cfc8ec8c2177c876a9cac67048c9adc9a6c;p=clitk.git diff --git a/tools/clitkImageArithmGenericFilter.txx b/tools/clitkImageArithmGenericFilter.txx index 1afb77f..4abb433 100644 --- a/tools/clitkImageArithmGenericFilter.txx +++ b/tools/clitkImageArithmGenericFilter.txx @@ -67,7 +67,7 @@ void ImageArithmGenericFilter::SetArgsInfo(const args_info_type mArgsInfo=a; // Set value - SetIOVerbose(mArgsInfo.verbose_flag); + this->SetIOVerbose(mArgsInfo.verbose_flag); mTypeOfOperation = mArgsInfo.operation_arg; mDefaultPixelValue = mArgsInfo.pixelValue_arg; mScalar = mArgsInfo.scalar_arg; @@ -75,13 +75,13 @@ void ImageArithmGenericFilter::SetArgsInfo(const args_info_type if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes(); - if (mArgsInfo.input1_given) AddInputFilename(mArgsInfo.input1_arg); + if (mArgsInfo.input1_given) this->AddInputFilename(mArgsInfo.input1_arg); if (mArgsInfo.input2_given) { mIsOperationUseASecondImage = true; - AddInputFilename(mArgsInfo.input2_arg); + this->AddInputFilename(mArgsInfo.input2_arg); } - if (mArgsInfo.output_given) SetOutputFilename(mArgsInfo.output_arg); + if (mArgsInfo.output_given) this->SetOutputFilename(mArgsInfo.output_arg); // Check type of operation (with scalar or with other image) if ((mArgsInfo.input2_given) && (mArgsInfo.scalar_given)) { @@ -393,6 +393,18 @@ void clitk::ImageArithmGenericFilter::ComputeImage(Iter1 it, Ite ++ito; } break; + case 13: // -ln I/I0 + while (!it.IsAtEnd()) { + if (it.Get() == 0) { // special case for fluence image with 0 value in a pixel -> consider 0.5 + ito.Set(-log(0.5 / mScalar) ); + } + else { + ito.Set(-log(PixelTypeDownCast((double)it.Get() / mScalar)) ); + } + ++it; + ++ito; + } + break; default: // error ? std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl; exit(-1);