Skip to content

Latest commit

 

History

History
202 lines (133 loc) · 9.04 KB

commands.markdown

File metadata and controls

202 lines (133 loc) · 9.04 KB

The following commands are available in the mex file.

Command Description
GetVersion Returns the version of the MEXlibCZI mex file.
Open Open a CZI file and return a handle to the document.
GetSubBlockBitmap Read the specified subblock and get the (uncompressed) bitmap.
GetInfo Get information about the specified CZI-document.
GetScaling Retrieve scaling information from the specified document.
GetMultiChannelScalingTileComposite Get a multi-channel composite image from the specified axis-aligned ROI with the specified zoom.
GetSingleChannelScalingTileComposite Get a tile-composite for the specified region-of-interest for the specified plane with the specified zoom-factor.
GetMetadataXml Get the metadata of the specified CZI-document as an XML string.
Close Close the document and free the resources.
GetDefaultDisplaySettings Get the display-settings from the CZI-document.
GetSubBlock Get a handle to a subblock (and return a handle to it).
GetInfoFromSubBlock Get information about a subblock.
GetBitmapFromSubBlock Get the bitmap of a subblock.
GetMetadataFromSubBlock Get the metadata from a subblock.
ReleaseSubBlock Releases a handle for a subblock.
CreateCziWriter Creates a writer object (for writing a CZI document) and returns a handle to it.
AddSubBlock Adds a subblock to the writer object.
CloseCziWriter Closes a writer object and finalizes the CZI-document.

GetVersion

The function returns a struct containing version information. It does not take any arguments. CZIGetInfo sample

Open

The specified file (second argument) is opened, and a handle for the document is returned.

CZIGetInfo sample

GetSubBlockBitmap

argument # type comment
1 integer The handle (as returned from "Open")
2 integer The subblock number

Read the specified subblock and get the (uncompressed) bitmap.

CZIGetInfo sample

GetInfo

Get information about the specified CZI-document. A struct is returned.

CZIGetInfo sample CZIGetInfo sample CZIGetInfo sample

GetScaling

Retrieve scaling information from the specified document. The scaling is given in units of µm. If no information is available, the property will have the value of NaN.

CZIGetInfo sample

GetMultiChannelScalingTileComposite

Get a multi-channel composite image from the specified axis-aligned ROI with the specified zoom.

argument # type comment
1 integer The handle (as returned from "Open")
2 array of numbers The coordinates of the ROI
3 string The plane coordinate
4 number The zoom

CZIGetInfo sample

GetSingleChannelScalingTileComposite

Get a tile-composite for the specified region-of-interest for the specified plane with the specified zoom-factor. zoom is a number between 1 and 0, and the pixel-size of the resulting image will be zoom * w and zoom * h.

argument # type comment
1 integer The handle (as returned from "Open")
2 array of numbers The coordinates of the ROI
3 string The plane coordinate
4 number The zoom

CZIGetInfo sample

GetMetadataXml

Get the metadata of the specified CZI-document as an XML string.

GetMetadataXML example

Close

Close the document and free the resources. The handle is no longer valid.

Close example

GetDefaultDisplaySettings

Get the display-settings from the CZI-document. The function returns a struct.

GetDefaultDisplaySettings example

GetSubBlock

Get a handle to a subblock (and return a handle to it).

argument # type comment
1 integer The handle (as returned from "Open")
2 integer The subblock number

GetSubBlock example

GetInfoFromSubBlock

Get information about a subblock. The function returns a struct.

argument # type comment
1 integer The handle (as returned from "Open")
2 integer The subblock handle (as returned from "GetSubBlock"

GetInfoFromSubBlock example

GetBitmapFromSubBlock

Get the bitmap from the specified subblock. The subblock is decompressed (if necessary) and the bitmap is returned.

argument # type comment
1 integer The handle (as returned from "Open")
2 integer The subblock handle (as returned from "GetSubBlock"

GetBitmapFromSubBlock example

GetMetadataFromSubBlock

Get the XML-metadata from the specified subblock.

argument # type comment
1 integer The handle (as returned from "Open")
2 integer The subblock handle (as returned from "GetSubBlock"

GetMetadataFromSubBlock example

ReleaseSubBlock

Releases a subblock handle. The handle is no longer valid, and the resources are freed.

CreateCziWriter

Creates a writer object (for writing a CZI document) and returns a handle to it.

argument # type comment
1 string The filename.
2 string (optional) Options for creating the file.

For the argument 2, the following options are available:

Option Description
"overwrite" or 'x' Overwrite the file if it exists.

The function returns a handle to the writer object.

CreateCziWriter example

AddSubBlock

Adds a subblock to the writer object.

argument # type comment
1 integer The handle (as returned from "CreateCziWriter")
2 string The coordinate of the subblock (in a string represenation).
3 array of numbers The coordinates of the logical ROI
4 string The pixel type
5 2d or 3d array of numbers The bitmap to be written into the subblock
6 struct (optional) property bag with options for the operation

The following options are available (for argument #6):

Option type Description
"M" integer The value of the M-index
"metadata_xml" string XML metadata to be written to the subblock
"compression" string A string describing the compression to be used for the bitmap. The syntax is as defined here.

AddSubBlock example

AddSubBlock example

CloseCziWriter

Closes a writer object and finalizes the CZI-document.