Main Content

openToWrite

Create and open destination for writing

    Description

    openToWrite(obj,destination,info,currentlevel) opens the location specified by the string scalar destination for writing. info is a scalar structure that describes the object. currentlevel is an integer-valued scalar indicating the current level for which data will be written.

    Use this method to prepare the destination for writing. For example, open file handle or create destination folder, or write file header or meta data to the destination. When writing multiresolution (pyramid) images, openToWrite is called for each level before the corresponding level's setIOBlock is called.

    Input Arguments

    collapse all

    Adapter object, specified as an instance of an adapter class that is subclassed from the images.blocked.Adapter class.

    Location to write to, specified as a string scalar or char vector.

    Data Types: char | string

    Structure containing information about source, returned as a structure with these fields.

    FieldDescription
    Size

    An L-by-N integer-valued array representing image size(s);

    For this field and all subsequent fields,L is the number of levels in Source. For a single resolution level image L is 1. N is the number of dimensions in the image.

    IOBlockSizeAn L-by-N integer-valued array representing the smallest unit of data that can be read from the source.
    DatatypeAn L-by-N string array containing the MATLAB datatype for each level.
    InitialValueA scalar value of type specified by Datatype, indicating the initial data value for each level. If the types and values differ for a multiresolution array, this can be a cell array .

    You can optionally return these additional fields.

    Optional FieldDescription
    UserData

    A scalar struct containing additional metadata about the source. This field can be empty.

    WorldStart

    An L-by-N numeric array specifying the starting edge location of the image in world coordinates.L is the number of levels in Source. N is the number of dimensions in the image.

    WorldEnd

    An L-by-N numeric array specifying the ending edge location of the image in world coordinates.L is the number of levels in Source. N is the number of dimensions in the image.

    Image resolution level, specified as an integer-valued scalar.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Introduced in R2021a