Command Line Interface


The command line tool is designed to make inspecting files simple. It also allows extraction of the image data into a raw file.

Basic Commands
Command Description
ScanImageTiffReader descriptions Print all image descriptions.
with descriptions --frame <id> Print one image description.
ScanImageTiffReader metadata Print the ScanImage metadata.
ScanImageTiffReader data Print the raw image data as a byte stream.
ScanImageTiffReader help Print detailed help for a sub-command.


From the command line:


will output a basic help message:

Usage: ScanImageTiffReader <command> [<args>]

These are the available commands:
   descriptions     Extract the contents of a the image description tag(s).
                    If you do not specify which frame, then all the image
                    descriptions are output.
          image     Do stuff with image data.
       metadata     Extract the ScanImage metadata section from the file.
           help     Print detailed help for the specified sub-command.


Each sub-command has it’s own arguments. The available sub-commands are listed below.

help <subcommand>

Returns more detailed information for each sub-command.

descriptions [--frame <index>] <input tiff> [<output file>]

Extract header data. ScanImage stores (a lot) of information about the state of the microscope in each frame. This command will extract all the information for all the frames. If you use --frame only that frame’s header will be output.

metadata <input tiff> [<output file>]

Extracts the metadata section. ScanImage stores some non-frame varying data in the Tiff file, which is what this command extracts.

Historically, this data has had several different formats. Some are human readible text, but some are binary formats that are difficult to interpret outside of Matlab. ScanImage provides a matlab-specific tool for decoding the binary formats.

image bytes <input file>

Return the size of the raw image data in bytes.

image raw <input file> <output file>

Write raw bytes to an output file for the entire volume. The pixels are written in row-major order (C-style), so for an array with dimensions [w,h,d] the index of a pixel at (x,y,z) is x+y*w+z*w*h.

image shape <input file>

Print the dimensions and pixel type of the volume in the tiff stack.