[Insight-developers] Problems with precision with MetaImageIO

Kent Williams kent at psychiatry.uiowa.edu
Thu Mar 9 12:11:40 EST 2006


Vamsi ran into something rather nasty in writing out vectors with 
MetaImageIO.  In Insight/Utilities/MetaImageIO/metaObject.cxx, floating 
point values in the MHD file were only written out with 6 digits of 
precision, which wasn't close enough to support the registration 
algorithm he's using.

This patch will fix the problem, and given that the MHDs are free-form 
text files I can't see what it would harm. Should I just check this into 
Insight? Do the MetaImageIO mavens at UNC want to consider the idea?

*** iplFreeware/unpackdir/Insight/Utilities/MetaIO/metaObject.cxx    12 
Dec 2005 09:00:00 -0600    1.44
--- iplFreeware/unpackdir/Insight/Utilities/MetaIO/metaObject.cxx    09 
Mar 2006 09:46:03 -0600   
***************
*** 24,30 ****
    m_WriteStream = NULL;
    m_FileName[0] = '\0';
    m_Event = NULL;
!   m_DoublePrecision = 6;
    }
 
  MetaObject::
--- 24,30 ----
    m_WriteStream = NULL;
    m_FileName[0] = '\0';
    m_Event = NULL;
!   m_DoublePrecision = 12;
    }
 
  MetaObject::
***************
*** 38,44 ****
    m_WriteStream = NULL;
    this->Read(_fileName);
    m_Event = NULL;
!   m_DoublePrecision = 6;
    }
 
  MetaObject::
--- 38,44 ----
    m_WriteStream = NULL;
    this->Read(_fileName);
    m_Event = NULL;
!   m_DoublePrecision = 12;
    }
 
  MetaObject::
***************
*** 53,59 ****
    m_FileName[0] = '\0';
    InitializeEssential(dim);
    m_Event = NULL;
!   m_DoublePrecision = 6;
    }
 
 
--- 53,59 ----
    m_FileName[0] = '\0';
    InitializeEssential(dim);
    m_Event = NULL;
!   m_DoublePrecision = 12;
    }
 
 



More information about the Insight-developers mailing list