[MINC-users] autocrop/MincUtilties and step precision

Alex Zijdenbos zijdenbos at gmail.com
Thu Nov 17 12:22:09 EST 2011


Hi Andrew,

Yes I agree. Many scripted tools use 'mincinfo -attvalue' for getting
at parameters, so if (in this case) mincinfo reports
0.0060000000000000001249 while hd5dump reports 0.06 exactly, I would
say the problem is with mincinfo. Of course a 1e-20 precision is
hardly sensical for most applications, but clearly when you start to
do math with these values it can still bite you.

Would it make sense to limit the precision with which mincinfo
-attvalue reports output? Either 'hard', or under user control?
Equivalent to the -m option to hd5dump perhaps (e.g., something like
"mincinfo -fp_format '%.6f' -attvalue xspace:step ...")?

-- A

On Thu, Nov 17, 2011 at 11:51 AM, Andrew Janke <a.janke at gmail.com> wrote:
> 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
> _______________________________________________
> 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