[hdf-forum] Dataspace sample sizes, units, and labels

Daniel Kahn daniel_kahn at ssaihq.com
Mon Mar 30 17:54:53 EDT 2009


Edwin Bennink wrote:
> Dear HDF forum members,
>
> We are going to use HDF5 for storage of 3D microscopy images and 
> metadata. These are usually 5D arrays (XYZ, time, and channels).
> I was wondering if there's a common way to define the sample sizes, 
> units (e.g. meters, seconds), and dimension labels (e.g. "X", "Y", 
> "Z", "T", etc.) for an HDF5 dataspace. Does HDF5 support these 
> parameters natively? Apart from the 'dimension scales' I couldn't find 
> anything related to this issue in the specs.
>

Edwin,

These topics have come up a few times in public HDF meetings and I 
believe you have come to the correct conclusion, that there are no 
general guidelines in these cases.  As I recall from the meetings, the 
Dimension Scales were designed to support NetCDF4  from Unidata.

So you will likely have to "roll your own".  If you haven't already 
investigated HDF5 attributes as a mechanism to help handle these issues 
I suggest you take a look.  One caveat here, HDF5 attributes can have a 
value of any HDF5 object, but those objects cannot have their own 
attributes.  Thus, for example, if you have a microscope image stored as 
an HDF5 dataset and you wish to attach the sample temperature metadata 
to it is as an attribute you will have no way to then attach a "units" 
attribute to the temperature indicating that it is in Centigrade or 
Kelvin. 

One other point: simply labeling dimensions is different from 
establishing a catalog of valid (and named) dimension extents.  Although 
quite useful for representing the relationships between datasets, a 
named extent catalog is also more complex to implement or define.  The 
systems I know of that have it are NetCDF and HDF-EOS, which were 
designed for earth studies projects (atmospheric, oceanigraphic, etc).  
In the case of NetCDF4 and HDF-EOS5 they are built on top of HDF5, but 
require a second library and have a second API to contend with.

Cheers,
--dan

-- 
Daniel Kahn
Science Systems and Applications Inc.
301-867-2162


----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe at hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe at hdfgroup.org.





More information about the Hdf-forum mailing list