From b1f5d6c99d0263700df2ddb2c6d1bf348709cd92 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Tue, 29 Mar 2011 14:26:56 +0000 Subject: [PATCH] Add EPID conversion (2^16 - value)/alpha --- tools/clitkImageArithm.ggo | 2 +- tools/clitkImageArithmGenericFilter.txx | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/clitkImageArithm.ggo b/tools/clitkImageArithm.ggo index 4cc5fbd..6f4b932 100644 --- a/tools/clitkImageArithm.ggo +++ b/tools/clitkImageArithm.ggo @@ -13,7 +13,7 @@ option "input2" j "Input second image filename" string no option "output" o "Output image filename" string yes option "scalar" s "Scalar value" double no -option "operation" t "Type of operation : \n With another image : 0=add, 1=multiply, 2=divide,\n 3=max, 4=min, 5=absdiff, 6=squareddiff, 7=difference, 8=relativ diff\n For 'scalar' : 0=add, 1=multiply, 2=inverse,\n 3=max, 4=min 5=absval 6=squareval\n 7=log 8=exp 9=sqrt" int default="0" no +option "operation" t "Type of operation : \n With another image : 0=add, 1=multiply, 2=divide,\n 3=max, 4=min, 5=absdiff, 6=squareddiff, 7=difference, 8=relativ diff\n For 'scalar' : 0=add, 1=multiply, 2=inverse,\n 3=max, 4=min 5=absval 6=squareval\n 7=log 8=exp 9=sqrt 10=EPID" int default="0" no option "pixelValue" - "Default value for NaN/Inf" double default="0.0" no option "setFloatOutput" f "Set output to float pixel type" flag off diff --git a/tools/clitkImageArithmGenericFilter.txx b/tools/clitkImageArithmGenericFilter.txx index e8edf99..1dd236f 100755 --- a/tools/clitkImageArithmGenericFilter.txx +++ b/tools/clitkImageArithmGenericFilter.txx @@ -363,6 +363,14 @@ void clitk::ImageArithmGenericFilter::ComputeImage(Iter1 it, Ite ++ito; } break; + case 10: // exp + static const double c = std::pow(2,16); + while (!it.IsAtEnd()) { + ito.Set(PixelTypeDownCast((c - (double)it.Get())/mScalar)); + ++it; + ++ito; + } + break; default: // error ? std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl; exit(-1); -- 2.47.1