bigimage content to new file
bigimage. This examples uses 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');
Create a mask image from the coarsest resolution level, 3. The mask is true for each pixel whose grayscale (luminance) value is less than 100.
mask = apply(bim,3,@(im)rgb2gray(im)<100);
Write the mask image to a directory called 'maskDir'. The directory must not already exist. Before writing the mask image, check if the directory already exists, and if it does, delete it.
imageDir = 'maskDir'; if exist(imageDir,'dir') rmdir maskDir s; end write(mask,imageDir);
Load the mask image back into the workspace by creating a new
bigimage from the data in the mask directory. The spatial referencing information of the mask is retained.
mask1 = bigimage('maskDir');
Display the original image and the mask image. The spatial referencing matches the original image,
figure bigimageshow(bim); figure bigimageshow(mask1);
filename— File name
File name of written big image data, specified as a string or character vector.
Supported file extensions are
dirname— Directory name
Directory name of written big image data, specified as a string or character vector.
If you write a
bigimage by specifying a
write writes the TIFF files
using the LZW lossless compression scheme.