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.
Target | Version | |
Windows x64 | Download | v1.3 |
OS X/Linux | Please contact support@mbfbioscience.com with your request! | v1.3 |
Installation
- Download the build for your operating system.
- Unzip it.
- 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('./hostpixelcorr_noavg_00001_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.LINE_FORMAT_VERSION = 1 SI.PREMIUM = true SI.TIFF_FORMAT_VERSION = 4 SI.VERSION_COMMIT = '3baa4b74bec9938bfd4c7403bddbe78f2a0ccd93' SI.VERSION_MAJOR = 2021 SI.VERSION_MINOR = 0 SI.VERSION_UPDATE = 0 SI.acqState = 'grab' SI.acqsPerLoop = 1 SI.errorMsg = '' SI.extTrigEnable = false SI.fieldCurvatureRxs = [] SI.fieldCurvatureRys = [] SI.fieldCurvatureTilt = 0 SI.fieldCurvatureTip = 0 SI.fieldCurvatureZs = [] SI.hBeams.enablePowerBox = false SI.hBeams.errorMsg = '' SI.hBeams.flybackBlanking = true SI.hBeams.interlaceDecimation = 1 SI.hBeams.interlaceOffset = 0 SI.hBeams.lengthConstants = Inf SI.hBeams.name = 'SI Beams' SI.hBeams.powerBoxEndFrame = Inf SI.hBeams.powerBoxStartFrame = 1 SI.hBeams.powerBoxes.rect = [0.25 0.25 0.5 0.5] SI.hBeams.powerBoxes.powers = NaN SI.hBeams.powerBoxes.name = '' SI.hBeams.powerBoxes.oddLines = true SI.hBeams.powerBoxes.evenLines = true SI.hBeams.powerBoxes.mask = [] SI.hBeams.powerFractionLimits = 1 SI.hBeams.powerFractions = 0.2 SI.hBeams.powers = 20 SI
Per-frame metadata
disp(desc{1});
frameNumbers = 1 acquisitionNumbers = 1 frameNumberAcquisition = 1 frameTimestamps_sec = 0.000000000 acqTriggerTimestamps_sec = -0.000064550 nextFileMarkerTimestamps_sec = -1.000000000 endOfAcquisition = 1 endOfAcquisitionMode = 1 dcOverVoltage = 0 epoch = [2021 11 5 9 50 13.560] 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