Store each block as JPEG file in folder
images.blocked.JPEGBlocks class is an adapter for use with blocked
images. Use this adapter to save an image in a folder with individual JPEG files for each
block. The JPEG format offers lossy compression and usually results in the smallest on-disk
size. The adapter stores the images in a folder which also contains a MAT-file with
information about the image (including image size, blocksize, type). This folder has one
subfolder per resolution level (L1, L2..LN). These subfolders contain JPEG format files for
|Use parallel processing||Yes|
images.blocked.JPEGBlocks class is a
For information on class attributes, see Class Attributes.
adapter = images.blocked.JPEGBlocks() creates an
images.blocked.JPEGBlocks instance for use with a
JPEGQuality— Quality of written image
75(default) | numeric scalar between
Quality of written image, specified as a numeric scalar between 0 and 100. Higher numbers specify better quality (less image degradation due to compression), but the resulting file size is larger.
CompressionMode— JPEG compression mode
JPEG compression mode, specified as the
string scalar or
"Lossless". If you specify
adapter ignores the
Create a blocked image.
bim = blockedImage('tumor_091R.tif');
Write image data to files. Specify the
images.blocked.JPEGBlocks adapter. Choose to write in highest quality. JPG uses lossy compression, so space required is still significantly lower than other formats.
wa = images.blocked.JPEGBlocks(); wa.JPEGQuality = 100; write(bim, "folderOfJPGs", "Adapter", wa);
Create a blocked image from the folder of images. The
blockedImage object automatically picks the appropriate adapter.
bjpeg = blockedImage("folderOfJPGs"); disp(bjpeg.Adapter)
JPEGBlocks with properties: JPEGQuality: 100 CompressionMode: "Lossy" BlockFormat: "jpeg"