ScanImageTiffReader for Matlab

This is a Matlab package for extracting data from Tiff and BigTiff files recorded using ScanImage. It is a very fast tiff reader and provides access to ScanImage-specific metadata. It should read most tiff files, but as of now we don't support compressed or tiled data. It is also available as a Julia, Python, or C library. There's also a command line interface.

Both ScanImage and this reader are products of Vidrio Technologies. If you have questions or need support feel free to submit an issue contact us.

Contents

Downloads

Packages includes mex files built against 64-bit Matlab 2016b (v9.1) and targeting Windows, Linux, and OS X.

TargetVersion
Windows x64Downloadv1.3
OS XDownloadv1.3
LinuxDownloadv1.3

Installation

  1. Download the build for your operating system.
  2. Unzip it.
  3. Copy the +ScanImageTiffReader folder to a location on your Matlab path.

Examples

Import the reader class. A constructed reader represents an open file.

import ScanImageTiffReader.ScanImageTiffReader;

Read a stack

Note that Matlab's ordering of dimensions means the image might be transposed from what you expect. We leave the transpose up to you.

reader=ScanImageTiffReader('./data/resj_00001.tif');
vol=reader.data();
imshow(vol(:,:,floor(size(vol,3)/2)),[]);

Query the api version.

This is useful to know when you need to ask for support.

ScanImageTiffReader.apiVersion()
ans =

    'Version 1.3-9c3423c by Vidrio Technologies <support@vidriotech.com>'

Get some metadata!

meta=reader.metadata();
desc=reader.descriptions();

Per-file metadata

disp(meta(1:1000));
{
  "SI": {
    "TIFF_FORMAT_VERSION": 3,
    "VERSION_MAJOR": "2015",
    "VERSION_MINOR": "4",
    "acqState": "grab",
    "acqsPerLoop": 1,
    "extTrigEnable": 0,
    "hBeams": {
      "beamCalibratedStatus": [0,0,0],
      "beamStatus": [0,0,0],
      "directMode": [0,0,0],
      "enablePowerBox": 0,
      "flybackBlanking": 1,
      "interlaceDecimation": [1,1,1],
      "interlaceOffset": [0,0,0],
      "lengthConstants": ["_Inf_","_Inf_","_Inf_"],
      "powerBoxEndFrame": "_Inf_",
      "powerBoxStartFrame": 1,
      "powerBoxes": {
        "rect": [0.25,0.25,0.5,0.5],
        "powers": ["_NaN_","_NaN_","_NaN_"],
        "name": "",
        "oddLines": 1,
        "evenLines": 1
      },
      "powerLimits": [100,100,100],
      "powers": [1,1,1],
      "pzAdjust": [0,0,0],
      "stackEndPower": ["_NaN_","_NaN_","_NaN_"],
      "stackStartPower": ["_NaN_","_NaN_","_NaN_"],
      "stackUseStartPower": 0,
      "stackUserOverrideLz": 0
    },
    "hChannels": {
      "channelAdcR

Per-frame metadata

disp(desc{1});
frameNumbers = 1
acquisitionNumbers = 1
frameNumberAcquisition = 1
frameTimestamps_sec = 0.000000000
acqTriggerTimestamps_sec = 0.000000000
nextFileMarkerTimestamps_sec = -1.000000000
endOfAcquisition = 0
endOfAcquisitionMode = 0
dcOverVoltage = 0
epoch = [1601  1  1  0  0 25.045]
auxTrigger0 = []
auxTrigger1 = []
auxTrigger2 = []
auxTrigger3 = []
I2CData = {}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

Testing

Tests may need to be modified to point to a file you are interested in. The included tests are very minimal.

See +ScanImageTiffReader/ScanImageTiffReaderTests.m

runtests ScanImageTiffReader
Running ScanImageTiffReader.ScanImageTiffReaderTests
...
Done ScanImageTiffReader.ScanImageTiffReaderTests
__________


ans = 

  1x3 TestResult array with properties:

    Name
    Passed
    Failed
    Incomplete
    Duration
    Details

Totals:
   3 Passed, 0 Failed, 0 Incomplete.
   0.20133 seconds testing time.