[Nexus-developers] data type for binary data
Eugen Wintersberger
eugen.wintersberger at desy.de
Wed Dec 7 09:12:12 GMT 2011
Hi there
I have decided for the moment to H5T_OPAQUE (as a proof of concept).
It is definitely better to use this instead of UInt8.
As Freddie said, a non nexus aware HDF5 application would not be able to
distinguish between a binary dataset and a numeric UInt8 dataset.
I think introducing something like NX_OPAQUE would be a good idea.
In addition I suggest to introduce an attribute for such a field which
holds the MIME-type of the data dumped in the field.
This would make it easier for a program to decide how to process this
data (image, pdf document, ...).
regards
Eugen
On Wed, 2011-12-07 at 01:10 +0000, freddie.akeroyd at stfc.ac.uk wrote:
> Hi Eugen,
>
> I think it would be good if we could use the HDF5 binary type as it properly distinguishes "UInt8" and "binary data", but we would need to add some support into NeXus to handle such data via the API and there are some compatibility issue we need to assess too.
>
> If we change NX_BINARY to Opaque, then a recompiled nexus program that reads a previously written binary array (UInt8) and checked its type was "NX_BINARY" would fail. Similarly a newly compiled program writing NX_BINARY to read in by an hdf5 aware non-nexus program may find that changing from UInt8 to OPAQUE breaks something there. If we think these are likely, then one option is to remove NX_BINARY and add NX_OPAQUE instead - programs using NX_BINARY would then fail to compile and must decide on UInt8 or opaque (purely relinked programs would still work though via the previous UInt8 definition). What do people think?
>
> Regards,
>
> Freddie
>
> -----Original Message-----
> From: nexus-developers-bounces at nexusformat.org [mailto:nexus-developers-bounces at nexusformat.org] On Behalf Of Eugen Wintersberger
> Sent: 05 December 2011 10:15
> To: nexus-developers at nexusformat.org
> Subject: [Nexus-developers] data type for binary data
>
> Hi folks
> I am actually implementing the binary field type for my C++ API.
> According to the Nexus documentation binary data is stored as UInt8
> which has historical reasons.
> HDF5 provides now an opaque data type which indicates already on HDF5
> level that the data is uninterpreted binary. Thus I would rather use
> this data type than UInt8.
> Is this ok according to Nexus or shall I use UInt8 for backward
> compatibility?
>
> regards
> Eugen
>
> _______________________________________________
> NeXus-developers mailing list
> NeXus-developers at nexusformat.org
> http://lists.nexusformat.org/mailman/listinfo/nexus-developers
More information about the NeXus-developers
mailing list