[Insight-developers] precision of meta data floating point values in NRRD format

Gordon L. Kindlmann glk at uchicago.edu
Mon Nov 30 09:13:41 EST 2009


Hello,

Luis, thanks for committing this.

On Nov 30, 2009, at 6:35 AM, Luis Ibanez wrote:

> 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.

Yes, I agree.  It has been too long since the NrrdIO in ITK has been  
synchronized with the nrrd library in Teem, which is my fault.   
Volunteers for working on this are welcome to email me for info about  
what's involved.

Thanks,
Gordon

>
>
>     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