[MINC-users] mincreshape with fillvalue outside image range

Robert D. Vincent robert.d.vincent at mcgill.ca
Thu May 14 13:31:47 EDT 2015


I agree that the existing behavior is incorrect. I think extending the
range to include the fill value would be reasonable here.

On Thu, May 14, 2015 at 1:25 PM, Alex Zijdenbos <zijdenbos at gmail.com> wrote:

> 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
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>


More information about the MINC-users mailing list