getBlock
(Not recommended) Read block of bigimage
object
The getBlock
function of the bigimage
object is not
recommended. Use the getBlock
function
associated with the blockedImage
object
instead. For more information, see Compatibility Considerations.
Description
reads the big image data in data
= getBlock(bigimg
,level
,locationWorld
)bigimg
at the specified resolution level,
and returns pixel data for the entire block that contains coordinate
locationWorld
.
Examples
Select and Display bigimage
Block Interactively
Create a bigimage
using a modified version of image "tumor_091.tif" from the CAMELYON16 data set. The original image is a training image of a lymph node containing tumor tissue. The original image has eight resolution levels, and the finest level has resolution 53760-by-61440. The modified image has only three coarse resolution levels. The spatial referencing of the modified image has been adjusted to enforce a consistent aspect ratio and to register features at each level.
bim = bigimage('tumor_091R.tif');
Display the bigimage
by using the bigimageshow
function. Overlay a grid that shows the block boundaries at the finest resolution level.
hb = subplot(1,2,1); bigimageshow(bim,'GridVisible','on','GridLevel',1);
Specify the (x,y) coordinate of a block to display. Get the block containing the coordinate. Add a Point
ROI over the displayed bigimage
at the specified coordinate.
coord = [2500,2500];
blk = getBlock(bim,1,coord);
hp = drawpoint(hb,'Position',coord);
In the figure, display the block next to the entire bigimage
. You can use imshow
to display the block because the block fits in memory and has a single resolution level.
ha = subplot(1,2,2);
imshow(blk,'Parent',ha)
Add a listener to the Point
ROI. When you drag the ROI with the mouse, the figure is updated to show the block containing the current ROI coordinates.
title(hb,'Drag Point to Select Block'); addlistener(hp, ... 'ROIMoved',@(~,~) imshow(getBlock(bim,1,hp.Position),'Parent',ha));
Input Arguments
bigimg
— Big image
bigimage
object
Big image, specified as a bigimage
object.
level
— Resolution level
positive integer
Resolution level, specified as a positive integer that is less than or equal to the
number of resolution levels of bigimg
.
locationWorld
— Coordinate of a point
1-by-2 numeric vector
Coordinate of a point, 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. The position must be a valid
position within bigimg
.
Output Arguments
data
— Pixel data
numeric array
Pixel data, returned as a numeric array of the same data type as the big image,
.bigimg
.ClassUnderlying
Version History
Introduced in R2019bR2021a: getBlock
function is not recommended
Not recommended starting in R2021a
The getBlock
function of the bigimage
object is
not recommended. Use the getBlock
function of the blockedImage
object instead. The
blockedImage
object offers several advantages including extension to N-D
processing, a simpler interface, and custom support for reading and writing nonstandard image
formats.
Although there are no plans to remove the bigimage
object and its
getBlock
function at this time, switch to
blockedImage
to take advantage of the additional capabilities and
flexibility.
See Also
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)