[Insight-developers] Analyze writer header size incorrect on64-bit system

Thielemans, Kris kris.thielemans at csc.mrc.ac.uk
Tue Jul 24 11:10:44 EDT 2007


Hi Hans
 
you can generally not hope for a correspondence between sizeof(your_structure) and anything file-based. The compiler might do aligning, packing, different sizes of types,... You really have to make sure that when reading/writing, the bits in the file get translated correctly to/from your structure. 
 
as far as size-specific types, there was a discussion about 1 year ago about having itk::int32_t etc (a la http://www.boost.org/libs/integer/cstdint.htm). I don't know if that's in ITK now or not.
 
Kris

________________________________

From: insight-developers-bounces+kris.thielemans=csc.mrc.ac.uk at itk.org on behalf of Hans Johnson
Sent: Tue 24/07/2007 09:58
To: Blezek, Daniel J (GE, Research); ITK
Subject: Re: [Insight-developers] Analyze writer header size incorrect on64-bit system


Dan,

I will not be able to look at it today, but the header is defined in Insight/Utilities/itkExtHdrs/itkAnalyzeDbh.h.  It certainly should be 348 bytes long.  The hdr is a struct that only contains:

int
char
short int
float

types in a structure, and these types should have consistent length on both 64 and 32 bit machines.

The header is well documented regarding the information that is supposed to reside at each byte location.

I may be able to look at this on Thursday if it is not resolved by then.

Hans
-- 
Hans J. Johnson, Ph.D.
Hans-johnson at uiowa.edu

278 GH
The University of Iowa
Iowa City, IA 52241
(319) 353 8587



________________________________

From: "Blezek, Daniel J (GE, Research)" <blezek at crd.ge.com>
Date: Tue, 24 Jul 2007 09:50:11 -0400
To: <insight-developers at itk.org>
Conversation: Analyze writer header size incorrect on 64-bit system
Subject: [Insight-developers] Analyze writer header size incorrect on 64-bit system

Hi all, 

 I tried to write an Analyze file today on a 64 bit system.  The header size was 352 bytes, not 348 as it should be.  Would someone familiar with the code see where it might be writing an 8-byte value rather than a 4-byte value?

Thanks, 
-dan 

Daniel Blezek, PhD 
GE Global Research 
Computer Scientist 

T 518 387 5481 
F 518 387 6981 
D *833-5481 
E blezek at research.ge.com 
www.research.ge.com <file://www.research.ge.com> 

1 Research Circle 
Niskayuna, NY 12309, USA 

General Electric Company 


________________________________

_______________________________________________
Insight-developers mailing list
Insight-developers at itk.org
http://www.itk.org/mailman/listinfo/insight-developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20070724/9f3c42bb/attachment.htm


More information about the Insight-developers mailing list