]> Creatis software - clitk.git/commitdiff
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
authorDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Tue, 4 Dec 2018 07:46:52 +0000 (08:46 +0100)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Tue, 4 Dec 2018 07:46:52 +0000 (08:46 +0100)
cluster_tools/gate_run_submit_cluster.sh
tools/clitkNormalizeImageFilter.ggo
tools/clitkNormalizeImageFilterGenericFilter.txx

index ebb0917d8efff9fc1c044f8394f1f51bdecaf837..6e4b3286242e2de56d0fe56eef426ebc320cf024 100755 (executable)
@@ -96,6 +96,7 @@ test -z "${PARAM}" || echo "param = ${PARAM}" >> "${PARAMFILE}"
 # Copy macros files (for log)
 mkdir ${OUTPUTDIR}/mac
 cp ${MACROFILE} ${OUTPUTDIR}/mac
+cp mac/* ${OUTPUTDIR}/mac/
 files=`grep "control/execute" ${MACROFILE} | cut -d " " -f 2`
 for i in $files
 do
index b67e3b85329ef48e519884ef230d96fa00b761a8..c474c64d86dfd7f9c7163009cbaa589fac188814 100644 (file)
@@ -11,3 +11,4 @@ option "imagetypes"   -       "Display allowed image types"     flag          off
 option "input"         i       "Input image filename"            string        required
 option "output"        o       "Output image filename"           string        required
 option "mask"          m       "Mask input image filename"       string        optional
+option "total_normalisation"           n       "Normalise such as the total is = 1.0"       flag off
\ No newline at end of file
index e6911afde54adce2a07e5a3656d18520ca235b43..ea8773334d2307d99953eab8c0a133690c215bc8 100644 (file)
@@ -144,13 +144,28 @@ namespace clitk
         ito.GoToBegin();
         itm.GoToBegin();
 
+        double total = 0.0;
         while (!ito.IsAtEnd()) {
+          if(itm.Get() == 1) {
+            ito.Set(((float) it.Get() - minImg)/(maxImg-minImg));
+            total += ito.Get();
+          }
+          ++it;
+          ++ito;
+          ++itm;
+        }
+
+        // Normalisation wrt total ?
+        if (mArgsInfo.total_normalisation_flag) {
+          ito.GoToBegin();
+          itm.GoToBegin();
+          while (!ito.IsAtEnd()) {
             if(itm.Get() == 1) {
-                ito.Set(((float) it.Get() - minImg)/(maxImg-minImg));
+              ito.Set(ito.Get()/total);
             }
-            ++it;
             ++ito;
             ++itm;
+          }
         }
         //
         //