BIC-MNI / minc-tools

Basic minc-tools from former minc repository
Other
30 stars 25 forks source link

incorrect percent difference calculation in mincmath? #60

Open mcvaneede opened 7 years ago

mcvaneede commented 7 years ago

In this line: https://github.com/BIC-MNI/minc-tools/blob/master/progs/mincmath/mincmath.c#L689

the percent difference is calculated as: 100.0 * (value1 - value2) / value1;

should that not be: 100.0 * (value2 - value1) / value1;

?

mcvaneede commented 7 years ago

As an example, running:

mincmath -pd file_with_1.2_values.mnc file_with_1.4_values.mnc out.mnc

will produce an output file with -16.66 values, instead of the expected 16.66.

gdevenyi commented 4 years ago

Hrm this does seem like the wrong way. The issue with "fixing" this is if anything depends on the wrong implementation. @vfonov thoughts?