Contenido principal

read

R2026b

Read data from label datastore

Since R2026b

Description

C = read(ds) returns data from a semantic point label datastore or box label datastore. Subsequent calls to the read function continue reading from the endpoint of the previous call.

[C,info] = read(ds) also returns information about the extracted data in info, including metadata.

Input Arguments

collapse all

Input datastore, specified as a semanticPointLabelDatastore or a boxLabelDatastore object.

Output Arguments

collapse all

Output data, returned as a cell array of categorical vectors or an N-by-2 cell array, depending on the type of datastore.

DatastoreOutput Description
semanticPointLabelDatastore

Cell array of P-by-1 categorical vectors, where P is the number of points in the corresponding point cloud. The number of vectors returned is specified by the ReadSize property of the datastore, which determines how many files to read per call.

Each element in a vector assigns a semantic class label to the corresponding point in the point cloud.

boxLabelDatastore

N-by-2 cell matrix, where N is the number of point clouds read. The number of rows returned, N, is specified by the ReadSize property of the datastore, which determines how many rows to read per call.

The first column contains bounding boxes. Each element is an M-by-9 matrix of M cuboid bounding boxes in the format [xcenter,ycenter,zcenter,width,height,depth,rx,ry,rz].

The second column contains the label names corresponding to each bounding box. Each element is an M-by-1 categorical vector of label names.

Information about read data, returned as a structure array. The structure array can contain the following fields.

DatastoreField NameDescription
semanticPointLabelDatastoreFilenameFully resolved path to the semantic point label data file. For datastores whose ReadSize property is greater than 1, Filename is a cell array of file names.
FileSizeTotal file size, in bytes. For datastores whose ReadSize property is greater than 1, FileSize is a vector of file sizes corresponding to each file.
boxLabelDatastoreCurrentIndexStarting position of each read operation of the label data.
ReadSizeReadSize property of the datastore.

Tips

  • read(ds) returns an error if there is no more data in the input datastore, ds. Use hasdata(ds) with read(ds) to avoid the error.

Version History

Introduced in R2026b