Main Content

images.blocked.Adapter class

Package: images.blocked

Adapter interface for blockedImage objects

Description

The images.blocked.Adapter class specifies the interface for block-based reading and writing of array data. Classes that inherit from this interface can be used with blockedImage objects, enabling block-based stream processing of array data.

The images.blocked.Adapter class is a handle class.

Subclassing to Create an Adapter

To implement an adapter, you must implement methods defined in the abstract class.

Required and Optional Methods

DescriptionMethods to Implement
To implement a read-only adapteropenToRead – Open source for reading; getInfo – Gather information about the source; getIOBlock – Get specified I/O block.
To implement an adapter that can write dataThe three read-only methods and: openToWrite – Create and open destination for writing; setIOBlock – Set specified I/O block.
To perform clean up tasks in an adapter (e.g closing file handles)close
(Optional) To enable an adapter to be used in parallel mode in the blockedImage/apply object functionopenInParallelToAppend.
(Optional) To enable the Resume option in the blockedImage/apply object functionalreadyWritten.

Optionally, adapters for single-file destinations can define an 'Extension' property specifying the file extension as a scalar string (e.g. "jpg") to use when automatically creating a destination location. For adapters that store data in a folder, this property must not exist or be set to empty.

Class Attributes

Abstract
true

For information on class attributes, see Class Attributes.

Creation

You cannot instantiate an object of this type directly. Instead, you subclass this interface to create other classes that can be instantiated. The toolbox includes the following adapters. All these adapters support both read and write operations.

All the adapters that work on a per-block basis, such as images.blocked.GenericImageBlocks, can be used with the parallel mode of apply object function.

See Also

Introduced in R2021a