[MINC-users] mincreshape with fillvalue outside image range

Alex Zijdenbos zijdenbos at gmail.com
Thu May 14 13:25:06 EDT 2015


Hi all,

As you probably know, mincreshape will fill points outside of the input
volume using the argument to -fillvalue (default 0). However, I noticed
that if that fillvalue is outside the range of the input volume, it will
show some seemingly erratic (and arguably wrong) behaviour. For example,
generating a volume with only '1' values:

$ minccalc -expression 1
/usr/local/bic/share/mni-models/icbm_avg_152_t1_tal_lin.mnc ones.mnc
$ mincstats -min -max ones.mnc
Min:               1
Max:               1

Now, let's pad that on one side and check the range of the output:

$ mincreshape -start -10,-10,-10 ones.mnc ones_pad.mnc
$ mincstats -min -max ones_pad.mnc
*** mincstats - reported max (0) doesn't equal header (1)
Min:               0
Max:               0

So that is unexpected. Repeating the mincreshape call, this time with
-normalize:

$ mincreshape -normalize -start -10,-10,-10 ones.mnc ones_pad_norm.mnc
$ mincstats -min -max ones_pad_norm.mnc
Min:               1
Max:               1

Still wrong. When you modify the image range in either one of these
mincreshape calls, you get the expected result:

$ mincreshape -start -10,-10,-10 -image_range 0 1 ones.mnc
ones_pad_range01.mnc
$ mincstats -min -max ones_pad_range01.mnc
Min:               0
Max:               1

So, the problem appears to be that mincreshape's fill value (0) falls
outside the input range of the volume, causing some fairly unexpected
behaviour.

It seems to me that in this case, mincreshape should either throw an error
(fillvalue outside image range); or perhaps extend the image range to make
sure it _can_ represent the fill value?

-- A


More information about the MINC-users mailing list