Wiki

Clone wiki

UFF / v0.2 / index

UFF v0.2

Index

Note: This version covers channel data only.

Data model

The ultrasound sequence data model is designed following an object-oriented programming phylosophy. A common UFF class forms the base of the model, and all other classes inherit from the UFF class. A UFF class may have other UFF classes as members (or properties in MATLAB).

Reference semantics (known as handle semantics in MATLAB) are applied such that for example a scan sequence may contain the same transmit/receive event multiple times without creating copies of the event. An example use is a color flow map, where each line is acquired multiple times corresponding to repetitions of the same events.

File type and structure

The HDF5 file type is used to store data and parameters. UFF files have the extension .uff. HDF5 allows information to be described in a hierarchical manner akin to that of a class tree.

Model mapped on to HDF5

The UFF describes how to store a data set consisting of one or more of channel data, beamformed data, velocity estimates and more including the sequence used to acquire the data. Each of these corresponds to a UFF class and it is the storage of objects of these classes that are defined here.

It is possible (and the reference code allows) to store UFF objects of other types, e.g., an alternative probe definition, but storing such objects is not defined here, and the reference code provides a warning stating that the resulting file is not compliant.

The convention in the first release is that an HDF5 group corresponds to an object in the model, and an HDF5 dataset corresponds to scalars and arrays of simple data types (note that a string is considered a simple data type). HDF5 compound datasets are not used in the initial release. A group contains one or more named links that point to other groups or datasets. This models the members (MATLAB: properties) of the class and the link names shall be those of the corresponding class members. It is possible for multiple links to point to the same group or dataset mimicking the reference semantics in OOP.

For an array of objects, a link with the name of the class member containing the array points to a group that then contains a link to one group for each array element. These links are named sequentially starting from 1 according to the printf conversion specifier "%08d", i.e., the first element in the array is named "00000001" etc.

An array of a simple data type is stored as a single dataset in the UFF file.

HDF5 attributes are used as follows: For an object and an array of objects, an attribute named "class" contains a text string that is the fully qualified name of the object's class. For an array of objects, an attribute named "array_size" contains an array of 32-bit unsigned integers describing the array's dimensions.

For performance optimizations, it is possible to set a flag that specifies that an object ignores handle semantics when writing it to a UFF file and when reading it back. If used wrongly this may cause a difference between the object in memory and the object in the UFF file. The intention is to be used for objects that are only ever referenced from one place, e.g., the position of a transducer element in a transducer array. The value of this flag is written as an attribute of the HDF5 group with attribute name "shared" with an 8-bit unsigned integer value of 0 if reference semantics are to be ignored and 1 if they are to be respected.

File contents

The file contains a root group with multiple links. The link of primary interest for reading the file is named "uff.channel_data" and points to an object of class uff.channel_data.

Another link is "version" that points to a dataset containing the library version used to write the UFF file. This is stored as a string, and follows the major.minor.patch version numbering scheme.

The two remaining links are "common_objects" and "common_doubles" that link to groups used for performance optimizations when writing and reading files. Note that initial benchmarks indicated writing times in excess of 1 minute for writing a 1024 element matrix probe (just the probe definition, no channel data) without performance optimizations and a few seconds with optimizations.

Updated