Main Content

readByIndex

Read data specified by index from randomPatchExtractionDatastore

Description

data = readByIndex(patchds,ind) returns a subset of observations from a random patch extraction datastore, patchds. The desired observations are specified by indices, ind.

[data,info] = readByIndex(patchds,ind) also returns information about the observations, including metadata, in info.

Input Arguments

collapse all

Random patch extraction datastore, specified as a randomPatchExtractionDatastore object.

Indices of observations, specified as a vector of positive integers.

Output Arguments

collapse all

Observations from the datastore, returned as a table with length(ind) number of rows.

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

Field NameDescription
RandomPatchRectangleslength(ind)-by-4 numeric matrix. Each row specifies the size and position of the patch in the format [xywidthheight]. The elements define the x- and y-coordinate of the top left corner, and the width and height of the patch.
ImageIndiceslength(ind)-by-1 numeric vector that specifies the indices of the read images in the input datastores.
InputImageFilenamelength(ind)-by-1 cell array that specifies the fully resolved path containing the path string, name of the file, and file extension of each input image.
ResponseImageFilenamelength(ind)-by-1 cell array that specifies the fully resolved path containing the path string, name of the file, and file extension of each response image or pixel label image.

Version History

Introduced in R2018b