Main Content

hdfan

Gateway to HDF multifile annotation (AN) interface

Syntax

[out1,...,outN] = hdfan(funcstr,input1,...,inputN)

Description

hdfan is the MATLAB® gateway to the HDF multifile annotation (AN) interface.

[out1,...,outN] = hdfan(funcstr,input1,...,inputN) returns one or more outputs corresponding to the AN function in the HDF library specified by functstr.

There is a one-to-one correspondence between AN functions in the HDF library and valid values for funcstr. For example, hdfan('endaccess',annot_id) corresponds to the C library call ANendaccess(annot_id).

Access Functions

Access functions initialize the interface and provide and terminate access to annotations.

Value of funcstrFunction SyntaxDescription
'start'AN_id = hdfan('start',file_id)

Initializes the multifile annotation interface.

'select'annot_id = hdfan('select',AN_id, index,annot_type)

Selects and returns the identifier for the annotation identified by the given index value and annotation type.

'end'status = hdfan('end',AN_id)

Terminates access to the multifile annotation interface.

'create'annot_id = hdfan('create',AN_id,tag,ref,annot_type)

Creates a data annotation for the object identified by the specified tag and reference number. annot_type can be 'data_label' or 'data_desc'.

'createf'annot_id = hdfan('createf',AN_id,annot_type)

Creates a file label or file description annotation. annot_type can be 'file_label' or 'file_desc'.

'endaccess'status = hdfan('endaccess',annot_id)

Terminates access to an annotation.

Read/Write Functions

Read/write functions read and write file or object annotations.

Value of funcstrFunction SyntaxDescription
'writeann'status = hdfan('writeann',annot_id,annot_string)

Writes the annotation corresponding to the given annotation identifier.

'readann'[annot_string,status] = hdfan('readann',annot_id)

Reads the annotation corresponding to the given annotation identifier;

[annot_string,status] = hdfan('readann',annot_id,max_str_length)

Reads the annotation corresponding to the given annotation identifier. annot_string will not be longer than max_str_length.

General Inquiry Functions

General inquiry functions return information about the annotations in a file.

Value of funcstrFunction SyntaxDescription
'numann'num_annot = hdfan('numann',AN_id,annot_type,tag,ref)

Gets number of annotations of specified type corresponding to given tag/ref pair.

'annlist'[ann_list,status] = hdfan('annlist',AN_id,annot_type,tag,ref)

Gets the list of annotations of given type in the file corresponding to a given tag/ref pair.

'annlen'length = hdfan('annlen',annot_id)

Gets the length of annotation corresponding to the given annotation identifier.

'fileinfo'[nfl,nfd,ndl,ndd,status] = hdfan('fileinfo',AN_id)

Gets number of file label, file description, data label, and data description annotations in the file corresponding to AN_id.

'get_tagref'[tag,ref,status] = hdfan('get_tagref',AN_id,index,annot_type)

Gets the tag/ref pair for the specified annotation type and index.

'id2tagref'[tag,ref,status] = hdfan('id2tagref',annot_id)

Gets the tag/ref pair corresponding to the specified annotation identifier.

'tagref2id'annot_id = hdfan('tagref2id',AN_id,tag,ref)

Gets the annotation identifier corresponding to the specified tag/ref pair.

'atype2tag'tag = hdfan('atype2tag',annot_type)

Gets the tag corresponding to the specified annotation type.

'tag2atype'annot_type = hdfan('tag2atype',tag)

Gets the annotation type corresponding to the specified tag.

Input/Output Arguments

A status or identifier output of -1 indicates that the operation failed.

In general, the input argument annot_type can be one of these values:

  • 'file_label'

  • 'file_desc'

  • 'data_label'

  • 'data_desc'

AN_id refers to the multifile annotation interface identifier.

annot_id refers to an individual annotation identifier.

You must terminate access to all opened identifiers using either hdfan('end',AN_id) or hdfan('endaccess',annot_id). Otherwise, the HDF library might not properly write all data to the file.

Version History

Introduced before R2006a