Main Content

read

(Removed) Read data from bigimageDatastore

The read function of the bigimageDatastore object has been removed (since R2026a). Use the read function associated with the blockedImageDatastore object instead. For more information, see Version History.

Description

data = read(bigds) returns a batch of data from a big image datastore, bigds. Subsequent calls to the read function continue reading from the endpoint of the previous call.

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

example

Examples

collapse all

Create a bigimage from the sample image "tumor_091R.tif".

bim = bigimage("tumor_091R.tif");

Create a bigimageDatastore object at resolution level 1. Specify a nondefault block size. Set the datastore to read four blocks at a time.

bimds = bigimageDatastore(bim,2,"BlockSize",[512 512],"ReadSize",4)
bimds = 
  bigimageDatastore with properties:

            ReadSize: 4
          BorderSize: [0 0]
           PadMethod: 0
              Images: [1x1 bigimage]
              Levels: 2
           BlockSize: [512 512]
        BlockOffsets: [512 512]
    IncompleteBlocks: 'same'
    BlockLocationSet: [1x1 blockLocationSet]

Read one batch of data from the datastore. Notice that the third block is a partial edge block and has a smaller size than interior blocks

blocks = read(bimds);
blocks=4×1 cell array
    {512x512x3 uint8}
    {512x512x3 uint8}
    {512x316x3 uint8}
    {512x512x3 uint8}

Input Arguments

collapse all

Big image datastore, specified as a bigimageDatastore object.

  • The datastore contains one or more big images, Images, each with Channels number of channels.

  • The datastore reads blocks from each big image at specified resolution levels, Levels.

  • The datastore specifies the number of blocks to read in each batch, ReadSize.

  • The datastore specifies the m-by-n pixel size of blocks to read, BlockSize.

Output Arguments

collapse all

Output data, returned as a cell array with ReadSize elements. Each cell contains an m-by-n-by-Channels numeric array.

Information about output data, returned as a struct containing these fields.

Field NameDescription
LevelResolution level of the data, specified as a 1-by-ReadSize vector of positive integers.
ImageNumberIndex of the big image providing the data, specified as a 1-by-ReadSize vector of positive integers.
BlockStartWorld(x,y) coordinates of the center of the top-left pixel of the data, excluding padding, specified as a ReadSize-by-2 numeric vector. Values are in world-coordinates.
BlockEndWorld(x,y) coordinates of the center of the bottom-right pixel of the data, excluding padding, specified as a ReadSize-by-2 numeric vector. Values are in world-coordinates.
DataStartWorld(x,y) coordinates of the center of the top-left pixel of the data, including padding, specified as a ReadSize-by-2 numeric vector. Values are in world-coordinates.
DataEndWorld(x,y) coordinates of the center of the bottom-right pixel of the data, including padding, specified as a ReadSize-by-2 numeric vector. Values are in world-coordinates.

Version History

Introduced in R2019b

expand all