[MINC-users] autocrop/MincUtilties and step precision

Andrew Janke a.janke at gmail.com
Thu Nov 17 11:51:01 EST 2011


Hi Alex,

> I have stumbled on something I might consider a bug in autocrop;
> although it is somewhat intricate. It turns out that if one uses the
> 'v' specification to for instance expand a volume with a certain
> number of voxels, like so:
>
>   autocrop -isoexpand 1v <in.mnc> <out.mnc>
>
> the actual expansion may be 2 voxels instead of one.

Hrm.

>   $count[$i] = round ($extent->[$i] / $step->[$i] - 1e-6, 1, +1);
>
> thus leaving a tiny bit of slack for precision trouble

To me this seems like an issue with how mincinfo handles values internally.

> PS Re: precision:
>
> $ minc_modify_header -dinsert zspace:step=0.006 test.mnc
> $ mincinfo -attvalue zspace:step test.mnc
> 0.0060000000000000001249
>
> I assume this reflects the inherent precision of the variable storage
> in... HDF5?

This seems to be the same problem as the autocrop issue. I'll punt
that autocrop uses mincinfo internally.  Certainly it makes no
difference if the file is netcdf or HDF5 using your test case.  The
internal value certainly is 0.006:

   mincreshape -dimrange zspace=0,1 \
      -dimrange yspace=0,1 -dimrange xspace=0,1 \
      test.mnc smaller.mnc

   h5dump smaller.mnc | grep 06
                  (0): 0.006


So to me the change needs to be in mincinfo?


a


More information about the MINC-users mailing list