Main Content

readByIndex

Read data specified by index fromrandomPatchExtractionDatastore

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, ininfo.

Input Arguments

collapse all

Random patch extraction datastore, specified as arandomPatchExtractionDatastoreobject.

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

Output Arguments

collapse all

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

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

Field Name Description
RandomPatchRectangles length(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.
ImageIndices length(ind)-by-1 numeric vector that specifies the indices of the read images in the input datastores.
InputImageFilename length(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.
ResponseImageFilename length(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.

Introduced in R2018b