ScanImage 2019 : Where Can a Detailed ScanImage Metadata Specification be Found

Where can a detailed specification for the ScanImage metadata format be found?


The metadata reflects information on all the options selected and otherwise available in ScanImage, for an image acquisition.  All metadata parameters are directly derived from the state of various properties in the ScanImage Application Model (hSI).  Thus the ScanImage API documentation provides a detailed description of all metadata that is stored during an image acquisition. 

For example hSI.hPmts has the following properties available:

SI.hPmts.autoPower
SI.hPmts.bandwidths
SI.hPmts.gains
SI.hPmts.names
SI.hPmts.offsets
SI.hPmts.powersOn
SI.hPmts.tripped

The value for each of these properties will be saved in the metadata.

There are several methods described on this page to access the metadata.

ScanImageTiffReader

Using the tool ScanImageTiffReader is the best option for striping out metadata from your tiff files for post processing operations.  This tool allows the raw image data, metadata and description to be separated into distinct files for down stream data processing scripts.  An example of the type of metadata file that can be generated using ScanImageTiffReader is below.

SI.LINE_FORMAT_VERSION = 1
SI.TIFF_FORMAT_VERSION = 3
SI.VERSION_MAJOR = '2016b'
SI.VERSION_MINOR = '1'
SI.acqState = 'grab'
SI.acqsPerLoop = 100
SI.extTrigEnable = 0
SI.hBeams.beamCalibratedStatus = [true true]
SI.hBeams.directMode = [false false]
SI.hBeams.enablePowerBox = false
SI.hBeams.flybackBlanking = true
SI.hBeams.interlaceDecimation = [1 1]
SI.hBeams.interlaceOffset = [0 0]
SI.hBeams.lengthConstants = [Inf Inf]
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 NaN]
SI.hBeams.powerBoxes.name = ''
SI.hBeams.powerBoxes.oddLines = true
SI.hBeams.powerBoxes.evenLines = true
SI.hBeams.powerLimits = [100 100]
SI.hBeams.powers = [1 1]
SI.hBeams.pzAdjust = [false false]
SI.hBeams.pzCustom = {[] []}
SI.hBeams.stackEndPower = [NaN NaN]
SI.hBeams.stackStartPower = [NaN NaN]
SI.hBeams.stackUseStartPower = false
SI.hBeams.stackUserOverrideLz = false
SI.hChannels.channelAdcResolution = {16 16 16 16}
SI.hChannels.channelDisplay = 1
SI.hChannels.channelInputRange = {[-1 1] [-1 1] [-1 1] [-1 1]}
SI.hChannels.channelLUT = {[25 2728] [0 100] [0 100] [0 100]}
SI.hChannels.channelMergeColor = {'red' 'red' 'red' 'red'}
SI.hChannels.channelName = {'Channel 1' 'Channel 2' 'Channel 3' 'Channel 4'}
SI.hChannels.channelOffset = [229 52 2 103]
SI.hChannels.channelSave = 1
SI.hChannels.channelSubtractOffset = [true true true true]
SI.hChannels.channelType = {'stripe' 'stripe' 'stripe' 'stripe'}
SI.hChannels.channelsActive = 1
SI.hChannels.channelsAvailable = 4
SI.hChannels.loggingEnable = 1
SI.hConfigurationSaver.cfgFilename = ''
SI.hConfigurationSaver.usrFilename = ''
SI.hCycleManager.cycleIterIdxTotal = 0
SI.hCycleManager.cyclesCompleted = 0
SI.hCycleManager.enabled = false
SI.hCycleManager.itersCompleted = 0
SI.hCycleManager.totalCycles = 1
SI.hDisplay.autoScaleSaturationFraction = [0.1 0.01]
SI.hDisplay.channelsMergeEnable = false
SI.hDisplay.channelsMergeFocusOnly = false
SI.hDisplay.displayRollingAverageFactor = 1
SI.hDisplay.displayRollingAverageFactorLock = false
SI.hDisplay.enableScanfieldDisplays = false
SI.hDisplay.lineScanHistoryLength = 1000
SI.hDisplay.renderer = 'auto'
SI.hDisplay.scanfieldDisplayColumns = 5
SI.hDisplay.scanfieldDisplayRows = 5
SI.hDisplay.scanfieldDisplayTilingMode = 'Auto'
SI.hDisplay.scanfieldDisplays.enable = false
SI.hDisplay.scanfieldDisplays.name = 'Display 1'
SI.hDisplay.scanfieldDisplays.channel = 1
SI.hDisplay.scanfieldDisplays.roi = 1
SI.hDisplay.scanfieldDisplays.z = 0
SI.hDisplay.selectedZs = []
SI.hDisplay.showScanfieldDisplayNames = false
SI.hDisplay.volumeDisplayStyle = '3D'
SI.hFastZ.actuatorLag = 0
SI.hFastZ.discardFlybackFrames = false
SI.hFastZ.enable = true
SI.hFastZ.enableFieldCurveCorr = false
SI.hFastZ.flybackTime = 0
SI.hFastZ.hasFastZ = true
SI.hFastZ.nonblockingMoveInProgress = false
SI.hFastZ.numDiscardFlybackFrames = 0
SI.hFastZ.numFramesPerVolume = 10
SI.hFastZ.numVolumes = 10
SI.hFastZ.positionAbsolute = 0.133872
SI.hFastZ.positionTarget = 0
SI.hFastZ.scannerBandwidth = 1000
SI.hFastZ.useArbitraryZs = false
SI.hFastZ.userZs = 0
SI.hFastZ.volumePeriodAdjustment = -0.0006
SI.hFastZ.waveformType = 'sawtooth'
SI.hIntegrationRoiManager.enable = false
SI.hIntegrationRoiManager.enableDisplay = true
SI.hIntegrationRoiManager.integrationHistoryLength = 1000
SI.hIntegrationRoiManager.postProcessFcn = @scanimage.components.integrationRois.integrationPostProcessingFcn
SI.hMotionManager.detectMotionFcn = @scanimage.components.motionCorrection.fftCorr_detectMotionFcn
SI.hMotionManager.enable = false
SI.hMotionManager.gpuAcceleration = false
SI.hMotionManager.motionHistoryLength = 30
SI.hMotionManager.referenceChannel = 1
SI.hMotionManager.referenceImagePreprocessFcn = @scanimage.components.motionCorrection.fftCorr_preprocessFcn
SI.hMotionManager.referenceZ = 0
SI.hMotionManager.showMotionDisplay = false
SI.hMotors.azimuth = 0
SI.hMotors.dimNonblockingMoveInProgress = [false false false]
SI.hMotors.elevation = 0
SI.hMotors.motorFastMotionThreshold = 100
SI.hMotors.motorPosition = [0 0 133.906]
SI.hMotors.motorPositionTarget = [0 0 133.906]
SI.hMotors.motorStepLimit = Inf
SI.hMotors.motorToRefTransform = [NaN NaN NaN;NaN NaN NaN;NaN NaN NaN]
SI.hMotors.motorToRefTransformAbsolute = [NaN NaN NaN;NaN NaN NaN;NaN NaN NaN]
SI.hMotors.motorToRefTransformValid = false
SI.hMotors.nonblockingMoveInProgress = false
SI.hMotors.scanimageToMotorTF = [1 0 0 0;0 1 0 0;0 0 1 0;0 0 0 1]
SI.hMotors.userDefinedPositions = []
SI.hPhotostim.allowMultipleOutputs = false
SI.hPhotostim.autoTriggerPeriod = 0
SI.hPhotostim.compensateMotionEnabled = true
SI.hPhotostim.completedSequences = 0
SI.hPhotostim.logging = false
SI.hPhotostim.monitoring = false
SI.hPhotostim.monitoringSampleRate = 9000
SI.hPhotostim.nextStimulus = 1
SI.hPhotostim.numOutputs = 0
SI.hPhotostim.numSequences = Inf
SI.hPhotostim.sequencePosition = 1
SI.hPhotostim.sequenceSelectedStimuli = []
SI.hPhotostim.status = 'Offline'
SI.hPhotostim.stimImmediately = false
SI.hPhotostim.stimSelectionAssignment = []
SI.hPhotostim.stimSelectionDevice = ''
SI.hPhotostim.stimSelectionTerms = []
SI.hPhotostim.stimSelectionTriggerTerm = []
SI.hPhotostim.stimTriggerTerm = 1
SI.hPhotostim.stimulusMode = 'sequence'
SI.hPhotostim.syncTriggerTerm = []
SI.hPhotostim.zMode = '3D'
SI.hPmts.autoPower = []
SI.hPmts.bandwidths = []
SI.hPmts.gains = []
SI.hPmts.names = []
SI.hPmts.offsets = []
SI.hPmts.powersOn = []
SI.hPmts.tripped = []
SI.hRoiManager.forceSquarePixelation = true
SI.hRoiManager.forceSquarePixels = true
SI.hRoiManager.imagingFovDeg = [-6.75 -6.75;6.75 -6.75;6.75 6.75;-6.75 6.75]
SI.hRoiManager.imagingFovUm = [-101.25 -101.25;101.25 -101.25;101.25 101.25;-101.25 101.25]
SI.hRoiManager.linePeriod = 6.31618e-05
SI.hRoiManager.linesPerFrame = 512
SI.hRoiManager.mroiEnable = false
SI.hRoiManager.pixelsPerLine = 512
SI.hRoiManager.scanAngleMultiplierFast = 1
SI.hRoiManager.scanAngleMultiplierSlow = 1
SI.hRoiManager.scanAngleShiftFast = 0
SI.hRoiManager.scanAngleShiftSlow = 0
SI.hRoiManager.scanFramePeriod = 0.03335
SI.hRoiManager.scanFrameRate = 29.985
SI.hRoiManager.scanRotation = 0
SI.hRoiManager.scanType = 'frame'
SI.hRoiManager.scanVolumeRate = 2.9985
SI.hRoiManager.scanZoomFactor = 1
SI.hScan2D.beamClockDelay = 1.5e-06
SI.hScan2D.beamClockExtend = 0
SI.hScan2D.bidirectional = true
SI.hScan2D.channelOffsets = [229 52 2 103]
SI.hScan2D.channels = {}
SI.hScan2D.channelsAdcResolution = 16
SI.hScan2D.channelsAutoReadOffsets = 0
SI.hScan2D.channelsAvailable = 4
SI.hScan2D.channelsDataType = 'int16'
SI.hScan2D.channelsFilter = 'Bessel'
SI.hScan2D.channelsInputRanges = {[-1 1] [-1 1] [-1 1] [-1 1]}
SI.hScan2D.channelsSubtractOffsets = [true true true true]
SI.hScan2D.fillFractionSpatial = 0.9
SI.hScan2D.fillFractionTemporal = 0.712867
SI.hScan2D.flybackTimePerFrame = 0.001
SI.hScan2D.flytoTimePerScanfield = 0.001
SI.hScan2D.fovCornerPoints = [-13 -7.5;13 -7.5;13 7.5;-13 7.5]
SI.hScan2D.keepResonantScannerOn = false
SI.hScan2D.linePhase = -6.66667e-08
SI.hScan2D.linePhaseMode = 'Nearest Neighbor'
SI.hScan2D.logAverageFactor = 1
SI.hScan2D.logFramesPerFile = Inf
SI.hScan2D.logFramesPerFileLock = false
SI.hScan2D.maxSampleRate = 1.2e+08
SI.hScan2D.name = 'ResScanner'
SI.hScan2D.nominalFovCornerPoints = [-13 -7.5;13 -7.5;13 7.5;-13 7.5]
SI.hScan2D.pixelBinFactor = 1
SI.hScan2D.resonantLimitedFovMode = true
SI.hScan2D.sampleRate = 1.2e+08
SI.hScan2D.scanPixelTimeMaxMinRatio = 2.5
SI.hScan2D.scanPixelTimeMean = 8.79557e-08
SI.hScan2D.scannerFrequency = 7916.17
SI.hScan2D.scannerToRefTransform = [1 0 0;0 1 0;0 0 1]
SI.hScan2D.scannerType = 'Resonant'
SI.hScan2D.settleTimeFraction = 0
SI.hScan2D.simulated = false
SI.hScan2D.trigAcqEdge = 'rising'
SI.hScan2D.trigAcqInTerm = 'PFI1'
SI.hScan2D.trigNextEdge = 'rising'
SI.hScan2D.trigNextInTerm = 'PFI3'
SI.hScan2D.trigNextStopEnable = true
SI.hScan2D.trigStopEdge = 'rising'
SI.hScan2D.trigStopInTerm = 'PFI2'
SI.hScan2D.uniformSampling = false
SI.hScan2D.useNonlinearResonantFov2VoltsCurve = false
SI.hStackManager.framesPerSlice = 1
SI.hStackManager.numSlices = 10
SI.hStackManager.shutterCloseMinZStepSize = 0
SI.hStackManager.slowStackWithFastZ = false
SI.hStackManager.stackReturnHome = true
SI.hStackManager.stackSlicesDone = 0
SI.hStackManager.stackStartCentered = false
SI.hStackManager.stackZEndPos = NaN
SI.hStackManager.stackZStartPos = NaN
SI.hStackManager.stackZStepSize = 40
SI.hStackManager.stageDependentZs = false
SI.hStackManager.zPowerReference = 0
SI.hStackManager.zs = [0 40 80 120 160 200 240 280 320 360]
SI.hUserFunctions.userFunctionsCfg = []
SI.hUserFunctions.userFunctionsOverride = []
SI.hUserFunctions.userFunctionsUsr = []
SI.hWSConnector.enable = false
SI.hWaveformManager.optimizedScanners = {}
SI.imagingSystem = 'ResScanner'
SI.loopAcqInterval = 10
SI.objectiveResolution = 15

 

{
"RoiGroups": {
"imagingRoiGroup": {
"ver": 1,
"classname": "scanimage.mroi.RoiGroup",
"name": "Default Imaging ROI Group",
"rois": {
"ver": 1,
"classname": "scanimage.mroi.Roi",
"name": "Default Imaging Roi",
"zs": 0,
"scanfields": {
"ver": 1,
"classname": "scanimage.mroi.scanfield.fields.RotatedRectangle",
"name": "Default Imaging Scanfield",
"centerXY": [0,0],
"sizeXY": [13.5,13.5],
"rotationDegrees": 0,
"enable": 1,
"pixelResolutionXY": [512,512],
"pixelToRefTransform": [
[0.0263671875,0,-6.763183594],
[0,0.0263671875,-6.763183594],
[0,0,1]
],
"affine": [
[13.5,0,-6.75],
[0,13.5,-6.75],
[0,0,1]
]
},
"discretePlaneMode": 0
}
},
"photostimRoiGroups": null,
"integrationRoiGroup": {
"ver": 1,
"classname": "scanimage.mroi.RoiGroup",
"name": "",
"rois": {
"_ArrayType_": "double",
"_ArraySize_": [1,0],
"_ArrayData_": null
}
}
}
}

opentif

ScanImage ships with a metadata extraction tool called 'opentif' that can be accessed from the Matlab prompt within the scanimage folder: scanimage.util.opentif.
This tools displays in detail all metadata parameters. See the example below for usage.

For example, type: '[metadata,Aout,imgInfo] = scanimage.util.opentif('c:\Temp\file_00002TEST.tif');', substituting your tif file name.
The metadata is placed in the 'metadata' output variable. You can drill down into the details of the metadata by clicking on the header.scanimage variable, header.scanimage.SI, and so on, in your Matlab workspace.

Other less extensive options are:

  1. The MatLab 'Tiff' command can be used: Tiff('c:\Temp\file_00002TEST.tif')

  2. The MatLab 'imgInfo' command can be used: 'infinfo' and open up the resultant variable in your workspace.

    For example, type 'info = imfinfo('c:\Temp\file_00002TEST.tif');', substituting your tif file, and open up the 'info' variable in your MatLab workspace.