[MINC-users] mincaverage behaviour

Peter Neelin peter.neelin at gmail.com
Tue Oct 16 22:28:56 EDT 2012


On Oct 16, 2012 3:05 PM, "Johnathon Walls" <Johnathon.Walls at regeneron.com>
wrote:

>    I think perhaps the issue might lie in lines 533-561 here:
>    [1]
https://github.com/BIC-MNI/minc/blob/master/progs/mincaverage/mincaverage.c
>    Where vol_mean[ifile] is included in the determination of vol_total and
>    global_mean (lines 537 and 554), but the value of
>    average_data.norm_factor[ifile] is conditional upon the vol_mean[ifile]
>    being > 0 (otherwise, the norm_factor[ifile] is set to 0.0).
>    Any ideas if this is a bug (though perhaps not in the lines that I am
>    suggesting) or a design decision?  If it's a design decision, can I ask
>    the reasoning? (Maybe I'm not understanding the meaning of world values
>    in minc files?)

Looks like a bug to me. Not sure why I would not have tested for == 0.0 (or
better, abs(mean) > epsilon) - perhaps I copied the test for sum0 > 0
(which does make sense, since sum0 is a count). Remarkable that no one has
found it in the past 17 years.

(Boy, that main() is embarrassingly long! If I were doing a code review I
would definitely have something to say to the kid who wrote that!)

Peter
--
Peter Neelin
peter.neelin at gmail.com


More information about the MINC-users mailing list