[Insight-developers] Re: Limitation in MetaIO causing problems initkNeuralNetworkFileReader/Writer

Sean McBride sean at rogue-research.com
Tue Aug 21 12:30:47 EDT 2007


On 8/21/07 9:29 AM, kent williams said:

>Looking at the MetIO classes more closely this morning, it appears that it
>already supports binary data output, which doesn't have the limitations that
>The ASCII record type has with respect to data size.
>
>Like the vnl_matlab classes, it needs to take into account machine
>endianness, which right now it ignores.

If you or someone else fixes that, please do not use a TRY_RUN to decide
the endianness, doing so causes major headaches for cross-compiling in
general, and, in particular, building 'universal binaries' on Mac OS X.

The compiler knows the endianness (it is generating assembly, so it
knows all about the CPU); there is no need to make the determination at
configure time.  Alas, I know of no way to query a compiler that works
with every compiler.  #if __BIG_ENDIAN or #if __BIG_ENDIAN__ works on
many, but not all.

Better, when possible, is to use functions like ntohl().

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the Insight-developers mailing list