Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect percent difference calculation in mincmath? #60

Open
mcvaneede opened this issue Jan 5, 2017 · 2 comments
Open

incorrect percent difference calculation in mincmath? #60

mcvaneede opened this issue Jan 5, 2017 · 2 comments

Comments

@mcvaneede
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants