]> Creatis software - clitk.git/commitdiff
Add EPID conversion (2^16 - value)/alpha
authordsarrut <dsarrut>
Tue, 29 Mar 2011 14:26:56 +0000 (14:26 +0000)
committerdsarrut <dsarrut>
Tue, 29 Mar 2011 14:26:56 +0000 (14:26 +0000)
tools/clitkImageArithm.ggo
tools/clitkImageArithmGenericFilter.txx

index 4cc5fbdf5557645d44aefe26ff718dc0b889f556..6f4b932c5a6f24f1ddf8f56f43e90d43f660d5ce 100644 (file)
@@ -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
index e8edf99b421c6efa959c6cce2942bc86598892eb..1dd236f1f9e24fb44abd2f83bee7251e0dfc1f13 100755 (executable)
@@ -363,6 +363,14 @@ void clitk::ImageArithmGenericFilter<args_info_type>::ComputeImage(Iter1 it, Ite
       ++ito;
     }
     break;
+  case 10: // exp
+    static const double c = std::pow(2,16);
+    while (!it.IsAtEnd()) {
+      ito.Set(PixelTypeDownCast<double, PixelType>((c - (double)it.Get())/mScalar));
+      ++it;
+      ++ito;
+    }
+    break;
   default: // error ?
     std::cerr << "ERROR : the operation number (" << mTypeOfOperation << ") is not known." << std::endl;
     exit(-1);