bytestohdf [-llabel] [-uunits] [-fformat] [-ccoordsys]
[-shdrbytes] [-oofile] nx ny nz
bytestohdf reads a stream of bytes from the standard input, and saves the bytes as an HDF Scientific Dataset representing a single 3D grid. The X, Y, and Z dimensions of the grid are given by nx, ny, and nz.
The following options exist:
Note that in HDF Datasets, the Z index varies fastest. This means that successive planes of data (defined by adjacent blocks in the input file) represent slices in planes of constant X. The X dimension is thus the number of slices present, rather than the (perhaps more intuitive) Z dimension.
Note that this program expects data in C language array order, that is, with the last array dimension varying fastest. If the input datastream was written from a Fortran language array, in which the first index varies fastest, the translation process will change the coordinate system of the data from right handed to left handed (or vice versa).
will read xdim*ydim*zdim bytes from the filename specified as infile and output an HDF file of the given name outfile containing the data.bytestohdf -ooutfile xdim ydim zdim < infile
A dataset consisting of 100 planes of data, each plane being 200 by 300 voxels, would be arranged in the input file as a series of 100 blocks of data, each block representing a plane. Each block in turn would consist of 200 rows of data, each 300 data elements long. The appropriate bytestohdf command to convert such a dataset to HDF format would be:
bytestohdf -ooutfile.hdf 100 200 300 < infile.raw