Main Content

getRegion

(Removed) Read arbitrary region of bigimage object

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

Description

data = getRegion(bigimg,level,regionStartWorld,regionEndWorld) reads the big image data in bigimg at the specified resolution level. The function returns all pixels whose extents touch or lie within the bounds of the rectangular region specified by regionStartWorld and regionEndWorld, inclusive.

example

Examples

collapse all

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

bim = bigimage("tumor_091R.tif");

Define a rectangular region by specifying the starting and ending coordinates in the horizontal and vertical direction relative to the finest resolution level.

xyStart = [2100 1800];
xyEnd = [2600 2300];

Get the region of the bigimage at each resolution level.

imL1 = getRegion(bim,1,xyStart,xyEnd);
imL2 = getRegion(bim,2,xyStart,xyEnd);
imL3 = getRegion(bim,3,xyStart,xyEnd);

Display the three regions in a montage. The finest resolution level is on the left and the coarsest resolution level is on the right.

montage({imL1,imL2,imL3},Size=[1 3], ...
    BorderSize=5,BackgroundColor="w");

Input Arguments

collapse all

Big image, specified as a bigimage object.

Resolution level, specified as a positive integer that is less than or equal to the number of resolution levels of bigimg.

Top-left coordinates of the rectangular region to read, specified as a 1-by-2 numeric vector of the form [x y]. The location is specified in world coordinates, which are the pixel locations relative to the highest resolution level.

Bottom-right coordinates of the rectangular region to read, specified as a 1-by-2 numeric vector of the form [x y]. The location is specified in world coordinates, which are the pixel locations relative to the highest resolution level.

Output Arguments

collapse all

Pixel data, returned as a numeric array of the same data type as the big image, bigimg.ClassUnderlying.

Version History

Introduced in R2019b

expand all