[Insight-developers] precision of meta data floating point values in NRRD format
Luis Ibanez
luis.ibanez at kitware.com
Mon Nov 30 07:35:48 EST 2009
Hi Simon,
Thanks a lot for pointing this out and for contributing the fix.
The patch was tested in a build from thrumite.kitware,
and has now been committed:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Utilities/NrrdIO/write.c?root=Insight&r1=1.11&r2=1.12&sortby=date
More details at the bug entry that you reported:
http://www.itk.org/Bug/view.php?id=9975
It will be nice to backport this to the main nrrd library.
Thanks
Luis
----------------------------------------------------
On Sat, Nov 28, 2009 at 12:50 PM, Simon Warfield
<simon.warfield at childrens.harvard.edu> wrote:
> When writing NRRD format images, some numerical precision is currently lost
> when writing out values of the origin and space directions. The NrrdIO
> utility has some functionality to maintain precision, in accessors.c, that
> does this:
> int _nrrdSprintFL(char *s, const FL *v) {
> return airSinglePrintf(NULL, s, "%.8g", (double)(*v)); }
> int _nrrdSprintDB(char *s, const DB *v) {
> return airSinglePrintf(NULL, s, "%.17g", *v); }
>
> However, these routines are not used when writing out some of the meta data.
> The attached version of write.c is patched to write out this double
> precision meta data to 17 decimal places.
> This better represents the true precision of the meta data.
>
> --
> Simon
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
>
More information about the Insight-developers
mailing list