X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkImageArithmGenericFilter.txx;h=37fa000d3c3e402a1dac421696e070ed8f4f4e90;hb=33c594d9f55d2b377223fc989727d42114170c77;hp=1316fc145c7caf0a524a9a77f3cf9255498f2c90;hpb=9b9e0b969b87e4e5799436d503e9cde6ea551ca7;p=clitk.git diff --git a/tools/clitkImageArithmGenericFilter.txx b/tools/clitkImageArithmGenericFilter.txx index 1316fc1..37fa000 100644 --- a/tools/clitkImageArithmGenericFilter.txx +++ b/tools/clitkImageArithmGenericFilter.txx @@ -45,8 +45,6 @@ template void ImageArithmGenericFilter::InitializeImageType() { ADD_DEFAULT_IMAGE_TYPES(Dim); - ADD_VEC_IMAGE_TYPE(3u,3u,float); - ADD_VEC_IMAGE_TYPE(3u,3u,double); } //-------------------------------------------------------------------- @@ -393,6 +391,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(PixelTypeDownCast(-log((double)it.Get() / mScalar)) ); + } + ++it; + ++ito; + } + break; default: // error ? std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl; exit(-1);