[Insight-developers] Non-ITK question

Johnson, Hans J hans-johnson at uiowa.edu
Fri Mar 11 09:39:51 EST 2011


Brad or any ITK developers,

I'd like to tap into your vast knowledge about standards and "safe" types.  I received a query with regards to upcoming changes to the NIFTI-2 image file format where we are trying to make it 64bit compatible for large data sets.

Would you mind providing me with a quick response regarding the long-term (say 10 years) safety of depending on sizeof(double) being 8 bytes in C?

 We are already allowing C99 for integer types.

Any recommendations so that we maximize maintainability and portability to next generation 128bit computers?

Thanks,
Hans



On 3/11/11 8:24 AM, "rick reynolds" <reynoldr at mail.nih.gov<mailto:reynoldr at mail.nih.gov>> wrote:

Hi Hans,

Have you run into many issues with sizeof(double) being something
other than 8?  The C standard does not specify sizes for float
types, so I want to be sure use of double will be reliable enough.

Thanks,

- rick


Changes to the header
The changes to the NIfTI header structure are the following (also see below for the full header struct):
    - short dim[8] becomes int64_t dim[8]
    - float intent_p1 becomes double intent_p1
    - float intent_p2 becomes double intent_p2
    - float intent_p3 becomes double intent_p3
    - float pixdim[8] becomes double pixdim[8]
    - float vox_offset becomes int64_t vox_offset
    - float scl_slope becomes double scl_slope
    - float scl_inter becomes double scl_inter
    - float cal_max becomes double cal_max
    - float cal_min becomes double cal_min
    - float slice_duration becomes double slice_duration
    - float toffset becomes double toffset
    - float quatern_b becomes double quatern_b
         and similarly for quatern_c, quatern_d, qoffset_x, qoffset_y, qoffset_z
    - float srow_x[4] becomes double srow_x[4]
         and similarly for srow_y[4], srow_z[4]
    - char magic[4] becomes char magic[8]
    - char unused_str[7] is added at the end of the header
    - removing previously unused fields: data_type, db_name, extents, session_error, regular, glmax, glmin
    - reordering of some of the fields to ensure 8-byte alignments for all doubles



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110311/aac2d9bd/attachment.htm>


More information about the Insight-developers mailing list