Skip to content

About

Glutamate Imaging Analysis Toolbox, MATLAB implementation

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

GIAnT-MATLAB

GIAnT (Glutamate Imaging Analysis Toolbox) is a MATLAB pipeline for processing glutamate imaging data.

GIAnT_schematic

Install

MATLAB

Tested from MATLAB R2023b onward.

Required toolboxes

  • Parallel Computing Toolbox
  • Image Processing Toolbox
  • Optimization Toolbox
  • Signal Processing Toolbox
  • Statistics and Machine Learning Toolbox

Clone this repository and add it (and its subfolders) to the MATLAB path:

addpath(genpath('/path/to/GIAnT-MATLAB'));

Also add any external packages below to the path (e.g. addpath(genpath(...))).

External packages

  • Fast_Tiff_Write β€” required for motion-correction TIFF writing (Fast_BigTiff_Write). Use commit ddd50c3286ff5b013d1f0478e8a5bd0d60978a75. Do not use a later revision without checking TIFF orientation compatibility (upstream changed orientation after this commit).

    git clone https://github.com/rharkes/Fast_Tiff_Write.git
    cd Fast_Tiff_Write
    git checkout ddd50c3286ff5b013d1f0478e8a5bd0d60978a75
  • NoRMCorre β€” required for the default (StripRegistration) motion-correction path.

  • SLAP2 data reader (only needed for SLAP2 data) β€” add one of:

How to run (default / non-SLAP2)

Typical flow for standard multi-TIFF / ScanImage-style recordings:

  1. buildTrialTable β€” choose a data folder (and optional save folder). Writes trial_table.h5 under the save directory.
  2. StripRegistration β€” select that trial_table.h5 (or pass its path). Writes registered TIFFs and *_ALIGNMENTDATA.h5 under motion_correction/. Requires NoRMCorre and Fast_Tiff_Write on the path.
  3. Optional: annotateROIs β€” draw exclude / soma ROIs; writes annotations.h5.
  4. SILo β€” select the same trial_table.h5 (or its folder). In the parameter GUI, leave isSLAP2 as false (default). Writes experiment_summary.h5 and per_trial_summary.h5 under source_extraction/.

Example (interactive prompts omitted when paths are passed):

buildTrialTable;                          % or buildTrialTable(datadr, savedr)
StripRegistration;                        % or StripRegistration(pathToTrialTable)
% annotateROIs;                           % optional
SILo;                                     % or SILo(pathToTrialTable)  % isSLAP2 = false

How to run (SLAP2)

  1. buildTrialTableSLAP2 β€” builds trial_table.h5 (including slap2_info) for SLAP2 .dat / metadata layouts.
  2. Motion correction β€” choose one:
    • MultiRoiRegistration β€” multi-ROI raster SLAP2
    • BandRegistration β€” band-scan SLAP2
      Requires a SLAP2 reader and Fast_Tiff_Write on the path (NoRMCorre is not used on these paths).
  3. Optional: annotateROIs
  4. SILo β€” in the parameter GUI, set isSLAP2 to true.
buildTrialTableSLAP2;
MultiRoiRegistration;   % or BandRegistration
% annotateROIs;
SILo;                   % isSLAP2 = true

Epoch and analysis trial

For each experiment we break the data into epochs and analysis trials.

Epochs are full experimental sessions that can be aligned with each other (same field of view / ROIs). Analysis trials are contiguous subsets (in time) of an epoch; they may not match experimental trial boundaries exactly.

SLAP2: analysis trials are the experimental trials when multi-trial acquisition wrote one file per trial. For continuous SLAP2 acquisition, the experiment is split into analysis trials of length 200000 lines (~20 s) to help parallelize processing.

Non-SLAP2: the pipeline sets epoch = 1 and treats each selected file as an analysis trial. Those trials must be alignable to one another.

Pipeline outputs

Reading H5 outside MATLAB

GIAnT writes H5 from MATLAB. Dimension tuples in this README match MATLAB size() for each dataset (column-major in memory).

h5py and other non-MATLAB readers may assume a row-major order for the data. When reading data using Python or other languages, data axes may need to be permuted to match the axis orders listed here.

Trial Table

Each experiment processed with GIAnT first gets a trial_table.h5 file that summarizes relevant file locations and analysis trial structures. The slap2_info group is only populated for SLAP2 experiments. The motion_correction and source_extraction groups are populated by downstream pipeline stages and will only be present once those stages have run. The structure of the trial_table is as below (πŸ—„οΈ file Β· πŸ“ group Β· πŸ”€ string Β· πŸ”’ integer Β· πŸ“ˆ numeric Β· πŸ–ΌοΈ image Β· β˜‘οΈ bool):

πŸ—„οΈ trial_table.h5
 β”œ πŸ”€ datadr
 β”œ πŸ”€ savedr
 β”œ πŸ”€ filename
 β”œ πŸ”’ true_trial_ix
 β”œ πŸ”’ epoch
 β”œ β˜‘οΈ row_major
 β”œ πŸ“ slap2_info
 |  β”œ πŸ“ ref_stack
 |  |  β”” πŸ“ Path{1,2}
 |  |     β”œ πŸ–ΌοΈ IM
 |  |     β”œ πŸ”’ channels
 |  |     β”œ πŸ“ˆ Zs
 |  |     β”” πŸ“ˆ dmdPixel2SampleTransform
 |  β”œ πŸ”’ first_line
 |  β”œ πŸ”’ last_line
 |  β”œ πŸ”’ trial_start_time_inferred
 |  β”” πŸ”’ trial_end_time_from_pc
 β”œ πŸ“ motion_correction
 |  β”œ πŸ”€ fn_reg_ds
 |  β”œ πŸ”€ fn_adata
 |  β”œ πŸ”€ fn_raw
 |  β”œ β˜‘οΈ registration_failed
 |  β”œ πŸ”’ first_line_original
 |  β”” πŸ“ align_params
 β”” πŸ“ source_extraction
    β”œ πŸ“ analysis_params
    β”” πŸ”€ fn_raw

Alignment Data

The motion correction scripts save out a H5 file ending in _ALIGNMENTDATA.h5 that contains the alignment data for each trial. The structure of the alignment data is as below

πŸ—„οΈ <trial_stem>_ALIGNMENTDATA.h5
 β”œ β˜‘οΈ row_major
 β”œ πŸ“ˆ numChannels
 β”œ πŸ“ˆ frametime
 β”œ πŸ“ˆ alignHz
 β”œ πŸ“ˆ motionDSc
 β”œ πŸ“ˆ motionDSr
 β”œ πŸ“ˆ motionDSz           (BandRegistration always; MultiRoiRegistration when refStackTemplate is enabled)
 β”œ πŸ–ΌοΈ meanIM              (StripRegistration and MultiRoiRegistration only; not written by BandRegistration)
 β”œ πŸ“ˆ recNegErr           (StripRegistration and MultiRoiRegistration only; not written by BandRegistration)
 β”œ πŸ“ˆ motionC             (StripRegistration only)
 β”œ πŸ“ˆ motionR             (StripRegistration only)
 β”œ πŸ“ˆ motionZ             (reserved; not written by any current script)
 β”œ πŸ“ˆ brightnessDS        (BandRegistration only)
 β”œ πŸ“ˆ logLikelihoodDS     (BandRegistration only)
 β”œ πŸ”’ DSframes            (SLAP2 only: MultiRoiRegistration and BandRegistration)
 β”œ β˜‘οΈ registrationFailed  (SLAP2 only: MultiRoiRegistration and BandRegistration)
 β”” πŸ“ slap2               (SLAP2 only)
    β”œ πŸ“ˆ onlineMotionXshift
    β”œ πŸ“ˆ onlineMotionYshift
    β”œ πŸ“ˆ onlineMotionZshift
    β”œ πŸ–ΌοΈ varFacDS          (MultiRoiRegistration only)
    β”œ πŸ“ˆ Z_depths          (MultiRoiRegistration only)
    β”œ πŸ”’ cropRow           (MultiRoiRegistration only)
    β”œ πŸ”’ cropCol           (MultiRoiRegistration only)
    β”œ πŸ–ΌοΈ viewC             (MultiRoiRegistration only)
    β”œ πŸ–ΌοΈ viewR             (MultiRoiRegistration only)
    β”œ πŸ”’ trimRows          (MultiRoiRegistration only)
    β”” πŸ”’ trimCols          (MultiRoiRegistration only)

Manual Annotations

In our pipeline, users can manually annotate pixels to exclude from analysis or pixels that correspond to soma, whose signals should be extracted (e.g. single-neuron simultaneous glutamate + calcium imaging). When ROIs are annotated (either in annotateROIs.m or SILo.m), information about the ROIs are saved in the annotations.h5 file. The structure of that file is as below

πŸ—„οΈ annotations.h5
 β”œ β˜‘οΈ row_major
 β”œ β˜‘οΈ coords_zero_indexed
 β”” πŸ“ Path{1,2}
    β”œ πŸ”€ dr
    β”œ πŸ”€ fn
    β”œ πŸ”’ n_rois
    β”” πŸ“ roi_###
       β”œ πŸ”€ type
       β”œ πŸ”€ label
       β”œ πŸ–ΌοΈ mask
       β”œ πŸ“ˆ position (polygon only; nVertices x 2 [y_loc, x_loc] when flagged)
       β”œ πŸ“ˆ center (circle/ellipse; 1 x 2 [y_loc, x_loc] when flagged)
       β”œ πŸ“ˆ semi_axes (ellipse)
       β”œ πŸ“ˆ rotation_angle (ellipse)
       β”” πŸ“ˆ radius (circle)

Experiment Summary

The final step of the pipeline, source extraction (Source Identification by Activity Localization; SILo), outputs an experiment_summary.h5 file which contains the extracted sources as well as other useful data about the experiment. The structure of that file is as follows

πŸ—„οΈ experiment_summary.h5
 β”œ β˜‘οΈ row_major
 β”œ πŸ“ params
 β”” πŸ“ Path{1,2}
    β”œ πŸ“ˆ Z_depths (fastz x 1)
    β”œ πŸ“ sources
    |  β”œ πŸ“ temporal
    |  |  β”œ πŸ“ˆ dF_ls (sources x channels x total frames)
    |  |  β”œ πŸ“ˆ dF_denoised (sources x channels x total frames)
    |  |  β”œ πŸ“ˆ events (sources x channels x total frames)
    |  |  β”œ πŸ“ˆ F0 (sources x channels x total frames)
    |  |  β”” πŸ“ˆ SNR (sources x 1)
    |  β”” πŸ“ spatial
    |     β”œ πŸ–ΌοΈ profiles (sources x fastz x rows x cols)
    |     β”” πŸ“ˆ coords (sources x 3 [z_loc, y_loc, x_loc])
    β”œ πŸ“ user_rois
    |  β”œ πŸ”€ labels (rois x 1)
    |  β”œ πŸ–ΌοΈ mask (rois x fastz x rows x cols)
    |  β”œ πŸ“ˆ Fsvd (rois x channels x total frames)
    |  β”” πŸ“ˆ F (rois x channels x total frames)
    β”œ πŸ“ visualizations
    |  β”œ πŸ–ΌοΈ mean_im (channels x fastz x rows x cols)
    |  β”œ πŸ–ΌοΈ act_im (fastz x rows x cols)
    |  β”” πŸ–ΌοΈ act_im_peaks (sources x 3 [z_loc, y_loc, x_loc])
    β”œ πŸ“ global
    |  β”” πŸ“ˆ F (channels x total frames)
    β”” πŸ“ frame_info
       β”œ πŸ“ˆ offlineXshifts (total frames x 1)
       β”œ πŸ“ˆ offlineYshifts (total frames x 1)
       β”œ πŸ“ˆ offlineZshifts (total frames x 1)
       β”œ πŸ“ˆ onlineXshifts (total frames x 1)
       β”œ πŸ“ˆ onlineYshifts (total frames x 1)
       β”œ πŸ“ˆ onlineZshifts (total frames x 1)
       β”œ πŸ”’ trial_num_frames (trials x 1)
       β”œ πŸ”’ frame_line_idxs (total frames x 1)
       β”” β˜‘οΈ discard_frames (total frames x 1)

A summary file of per-trial data is also saved as per_trial_summary.h5 for any fields that may vary across analysis trials. The structure of that file is as follows

πŸ—„οΈ per_trial_summary.h5
 β”œ β˜‘οΈ row_major
 β”” πŸ“ Path{1,2}
    β”œ πŸ“ sources
    |  β”œ πŸ“ temporal
    |  |  β”” πŸ“ˆ per_trial_SNR (trials x sources)
    |  β”” πŸ“ spatial
    |     β”œ πŸ–ΌοΈ per_trial_profiles (trials x sources x fastz x rows x cols)
    |     β”” πŸ“ˆ per_trial_coords (trials x sources x 3 [z_loc, y_loc, x_loc])
    β”” πŸ“ visualizations
       β”œ πŸ–ΌοΈ per_trial_mean_im (trials x channels x fastz x rows x cols)
       β”œ πŸ–ΌοΈ per_trial_act_im (trials x fastz x rows x cols)
       β”œ πŸ–ΌοΈ per_trial_act_im_peaks (trials x max_peaks x 3 [z_loc, y_loc, x_loc])
       β”” πŸ”’ per_trial_num_peaks (trials x 1)

Band Registration Lookup Table (intermediate file)

BandRegistration builds this file once per experiment under motion_correction/bandRegLookupTable.h5 and reuses it on subsequent runs.

πŸ—„οΈ bandRegLookupTable.h5
 β”œ πŸ”’ xPre
 β”œ πŸ”’ xPost
 β”œ πŸ”’ yPre
 β”œ πŸ”’ yPost
 β”œ β˜‘οΈ row_major
 β”” πŸ“ Path{1,2}
    β”œ πŸ“ˆ likelihood_means (Y x X x Z x C x nSP)
    β”œ πŸ”’ allSuperPixelIDs (nSP x 1)
    β”œ πŸ”’ sparseMaskInds (N x 2)
    β”œ πŸ”’ zPre
    β”œ πŸ”’ zPost
    β”” πŸ“ˆ fastZ2RefZ

File Field Descriptions

trial_table.h5

Field Size Data type Description
row_major 1 x 1 uint8 Layout flag: 1 = row-major (README sizes match h5py shape); 0 = column-major (MATLAB size()). If absent, assume column-major (0).
datadr 1 x 1 string Data directory location
savedr 1 x 1 string Results directory location
filename nPaths x total trials string (ragged) Relative file name from datadr
true_trial_ix nPaths x total trials integer Trial indices unraveled by epochs
epoch nPaths x total trials integer Epoch numbers
slap2_info β€” group Only saved for SLAP2 experiments
slap2_info/ref_stack/Path{1,2}/IM image dims numeric Reference stack image
slap2_info/ref_stack/Path{1,2}/channels 1 x nChannels numeric Color channels
slap2_info/ref_stack/Path{1,2}/Zs 1 x nZ numeric Z positions
slap2_info/ref_stack/Path{1,2}/dmdPixel2SampleTransform 3 x 3 numeric Transformation matrix
slap2_info/first_line nPaths x total trials integer First line of each trial
slap2_info/last_line nPaths x total trials integer Last line of each trial
slap2_info/trial_start_time_inferred 1 x total trials integer Inferred trial start times
slap2_info/trial_end_time_from_pc 1 x total trials integer Trial end times from PC
motion_correction β€” group Written by motion correction stage
motion_correction/fn_reg_ds nPaths x total trials string Registered + downsampled tif filename
motion_correction/fn_adata nPaths x total trials string Alignment metadata _ALIGNMENTDATA.h5 filename
motion_correction/fn_raw nPaths x total trials string Registered raw-resolution file (StripRegistration only)
motion_correction/registration_failed nPaths x total trials bool Whether registration failed
motion_correction/first_line_original nPaths x total trials integer Original slap2_info/first_line before reVolt adjustment
motion_correction/align_params β€” struct Alignment parameters used
source_extraction β€” group Written by source extraction stage
source_extraction/analysis_params β€” struct Analysis parameters used
source_extraction/fn_raw nPaths x total trials string Raw file source extraction reads from per trial

<trial_stem>_ALIGNMENTDATA.h5

Field Size Data type Description
row_major 1 x 1 uint8 Layout flag: 1 = row-major (README sizes match h5py shape); 0 = column-major (MATLAB size()). If absent, assume column-major (0).

Top-level fields written by all three motion correction scripts: numChannels, frametime, alignHz, motionDSc, motionDSr. meanIM and recNegErr are written by StripRegistration.m and MultiRoiRegistration.m but not by BandRegistration.m. motionC/motionR are written only by StripRegistration.m; DSframes/registrationFailed by both SLAP2 scripts (MultiRoiRegistration.m and BandRegistration.m); brightnessDS/logLikelihoodDS by BandRegistration.m only. The slap2 group is only populated for SLAP2 experiments.

Field Size Data type Description
numChannels 1 x 1 integer Number of channels in the recording
meanIM channels x rows x cols single Per-channel mean of motion-corrected frames (not written by BandRegistration)
frametime 1 x 1 numeric Seconds per downsampled frame
alignHz 1 x 1 numeric Frame rate (Hz) at which alignment was performed
motionDSc 1 x nDSframes numeric Inferred column shift per downsampled frame
motionDSr 1 x nDSframes numeric Inferred row shift per downsampled frame
motionDSz 1 x nDSframes numeric Inferred Z shift per downsampled frame; always written by BandRegistration; written by MultiRoiRegistration only when refStackTemplate is enabled; never written by StripRegistration
recNegErr 1 x nDSframes numeric Per-frame reconstruction error; standard alignment QC metric and used for motion censoring (not written by BandRegistration)
brightnessDS nDSframes x channels numeric (BandRegistration only) Per-channel brightness/scaling factor at the selected motion shift
logLikelihoodDS nDSframes x 1 numeric (BandRegistration only) Peak log-likelihood of the motion match per downsampled frame
motionC 1 x nFrames numeric Column shift upsampled to raw frame rate (StripRegistration only)
motionR 1 x nFrames numeric Row shift upsampled to raw frame rate (StripRegistration only)
motionZ 1 x nFrames numeric (reserved; not written by any current script) Z shift upsampled to raw frame rate
DSframes 1 x nDSframes integer Line indices of each downsampled frame (SLAP2 only: MultiRoiRegistration and BandRegistration)
registrationFailed 1 x 1 bool Whether registration failed for this trial (SLAP2 only: MultiRoiRegistration and BandRegistration)
slap2 β€” group Only saved for SLAP2 experiments
slap2/varFacDS rows x cols x nDSframes numeric (MultiRoiRegistration only) Variance factor; multiply pixel intensity to get a value proportional to its variance
slap2/Z_depths fastz x 1 numeric (MultiRoiRegistration only) Imaged Z depths from microscope metadata
slap2/cropRow 1 x 1 integer (MultiRoiRegistration only) Row offset to add to ROIs to index into original recording
slap2/cropCol 1 x 1 integer (MultiRoiRegistration only) Column offset to add to ROIs to index into original recording
slap2/viewC (rows+2Β·maxshift) x (cols+2Β·maxshift) numeric (MultiRoiRegistration only) Column interpolation grid for remapping into saved tiff space
slap2/viewR (rows+2Β·maxshift) x (cols+2Β·maxshift) numeric (MultiRoiRegistration only) Row interpolation grid for remapping into saved tiff space
slap2/trimRows 1 x nTrimRows integer (MultiRoiRegistration only) Row indices used to remap images from the datafile into saved tiff space
slap2/trimCols 1 x nTrimCols integer (MultiRoiRegistration only) Column indices used to remap images from the datafile into saved tiff space
slap2/onlineMotionXshift 1 x nDSframes numeric Online motion-correction X shift from the microscope
slap2/onlineMotionYshift 1 x nDSframes numeric Online motion-correction Y shift from the microscope
slap2/onlineMotionZshift 1 x nDSframes numeric Online motion-correction Z shift from the microscope

bandRegLookupTable.h5

BandRegistration writes this cached lookup table to motion_correction/ on the first run and loads it on later runs. XY search limits (xPre, yPre, etc.) are shared across paths; per-path superpixel and reference-stack data live under Path{n} (one group per DMD, in trial-table path order). Y, X, and Z are the row, column, and reference-stack Z dimensions of the motion search cube (yPre + yPost + 1, etc.).

Field Size Data type Description
row_major 1 x 1 uint8 Layout flag: 1 = row-major (README sizes match h5py shape); 0 = column-major (MATLAB size()). If absent, assume column-major (0).
xPre 1 x 1 numeric Maximum column shift searched before the reference position (pixels); equals align_params.maxshiftXY
xPost 1 x 1 numeric Maximum column shift searched after the reference position (pixels); equals align_params.maxshiftXY
yPre 1 x 1 numeric Maximum row shift searched before the reference position (pixels); equals align_params.maxshiftXY
yPost 1 x 1 numeric Maximum row shift searched after the reference position (pixels); equals align_params.maxshiftXY
Path{n} β€” group One group per imaging path (DMD)
Path{n}/likelihood_means Y x X x Z x C x nSP single Precomputed expected superpixel mean intensity in the padded reference stack at each displacement in the search cube, per channel and superpixel; used as the template for Poisson or correlation motion inference
Path{n}/allSuperPixelIDs nSP x 1 numeric Unique superpixel keys for this path: superPixIdx * 100 + zIdx (integration-mode pixels only when integrationOnly is true)
Path{n}/sparseMaskInds N x 2 numeric Sparse ROI definition: column 1 = linear DMD pixel index (rows x cols x numFastZs layout); column 2 = superpixel index (1 … nSP)
Path{n}/zPre 1 x 1 numeric Maximum reference-stack Z shift searched before the matched plane (planes); capped by align_params.maxshiftZ and available reference Z planes
Path{n}/zPost 1 x 1 numeric Maximum reference-stack Z shift searched after the matched plane (planes); capped similarly to zPre
Path{n}/fastZ2RefZ numFastZs x 1 numeric Maps each imaged fast-Z index to the nearest reference-stack Z plane index (used when sampling likelihood_means)

annotations.h5

annotations.h5 is written by annotateROIs.m and by SILo.m (when drawUserRois=true).
String fields are stored as UTF-16 code units (uint16) for robust MATLAB/Python compatibility.

Indexing conventions. New files set /coords_zero_indexed to 1 and store position/center as 0-indexed [y_loc, x_loc] (row, column), matching image axis order. Legacy files without this flag use MATLAB images.roi convention: 1-indexed [x, y] (column, row).

Field Size Data type Description
row_major 1 x 1 uint8 Layout flag: 1 = row-major (README sizes match h5py shape); 0 = column-major (MATLAB size()). If absent, assume column-major (0).
coords_zero_indexed 1 x 1 uint8 When 1, position/center are 0-indexed [y_loc, x_loc]; when absent or 0, legacy 1-indexed [x, y]
Path{n} β€” group One group per imaging path in trial-table order
Path{n}/dr 1 x nChars uint16 Motion-correction directory used while drawing these ROIs
Path{n}/fn 1 x nChars uint16 Trial stem used when displaying ROI GUI
Path{n}/n_rois 1 x 1 uint32 Number of saved ROI entries for this path
Path{n}/roi_###/type 1 x nChars uint16 ROI geometry type: polygon, circle, or ellipse
Path{n}/roi_###/label 1 x nChars uint16 User label (e.g., SOMA)
Path{n}/roi_###/mask rows x cols uint8 Binary ROI mask in image coordinates (1 = included pixel)
Path{n}/roi_###/position nVertices x 2 double Polygon vertices [y_loc, x_loc] when coords_zero_indexed=1, else legacy [x, y]
Path{n}/roi_###/center 1 x 2 double Circle/ellipse center [y_loc, x_loc] when coords_zero_indexed=1, else legacy [x, y]
Path{n}/roi_###/semi_axes 1 x 2 double Ellipse semi-axes lengths (ellipse only)
Path{n}/roi_###/rotation_angle 1 x 1 double Ellipse rotation angle in degrees (ellipse only)
Path{n}/roi_###/radius 1 x 1 double Circle radius (circle only)

experiment_summary.h5

SILo.m writes experiment_summary.h5 in source_extraction/. Dimensions use one total frames axis for all trials from that path stitched in time.

Indexing conventions. Pixel/plane coordinates in sources/spatial/coords and related peak/coordinate fields are written in 0-indexed (HDF5/Python) convention as [z_loc, y_loc, x_loc], matching image axis order (fastz, rows, cols). z_loc is the 0-based index into the fastz axis of profiles; y_loc/x_loc are row/column centroids in [0, dim-1]. A few fields are kept 1-indexed to retain SLAP2 data conventions.

Field Size Data type Description
row_major 1 x 1 uint8 Layout flag: 1 = row-major (README sizes match h5py shape); 0 = column-major (MATLAB size()). If absent, assume column-major (0).
params β€” struct Analysis parameters (SILo params struct). params/activityChannel is 1-indexed into the recording's numChannels channels β€” use it to pick the glutamate channel from any channels x … dataset in this file (e.g., global/F, sources/temporal/dF_ls)
Path{n} β€” group One group per imaging path
Path{n}/Z_depths fastz x 1 numeric Z depths per imaging plane (SLAP2 only)
Path{n}/frame_info β€” group Trial and frame bookkeeping for stitched time series
Path{n}/frame_info/offlineXshifts total frames x 1 numeric Offline registration X shift per frame
Path{n}/frame_info/offlineYshifts total frames x 1 numeric Offline registration Y shift per frame
Path{n}/frame_info/offlineZshifts total frames x 1 numeric (optional) Offline registration Z shift per frame; written only when 3D alignment was performed
Path{n}/frame_info/onlineXshifts total frames x 1 numeric (SLAP2 only) online X shift per frame
Path{n}/frame_info/onlineYshifts total frames x 1 numeric (SLAP2 only) online Y shift per frame
Path{n}/frame_info/onlineZshifts total frames x 1 numeric (SLAP2 only) online Z shift per frame
Path{n}/frame_info/trial_num_frames trials x 1 integer Number of frames contributed by each analysis trial
Path{n}/frame_info/frame_line_idxs total frames x 1 integer Raw line (SLAP2) or frame (other microscopes) index for each frame in the stitched series. 1-indexed to keep SLAP2 line indexing convention
Path{n}/frame_info/discard_frames total frames x 1 bool or uint8 Frame excluded from analysis (e.g., motion censoring)
Path{n}/visualizations β€” group Static images for QC and publication
Path{n}/visualizations/mean_im channels x fastz x rows x cols numeric Mean registered image per channel / Z slice
Path{n}/visualizations/act_im fastz x rows x cols numeric Activity / localization summary image (single contrast)
Path{n}/visualizations/act_im_peaks sources x 3 numeric Activity image peak locations used to seed matrix factorization [z_loc, y_loc, x_loc], 0-indexed; from exptSummary.sources row/column coordinates, z_loc fixed at 0
Path{n}/global β€” group Whole-field signals
Path{n}/global/F channels x total frames numeric Fluorescence traces over the field (one column per channel)
Path{n}/user_rois β€” group Traces from manually drawn ROIs (when present)
Path{n}/user_rois/labels rois x 1 string User-defined ROI labels
Path{n}/user_rois/mask rois x fastz x rows x cols uint8 or bool Stacked binary masks for each user ROI
Path{n}/user_rois/Fsvd rois x channels x total frames numeric ROI signals after SVD / projection step (if used)
Path{n}/user_rois/F rois x channels x total frames numeric Raw or baseline-corrected ROI fluorescence
Path{n}/sources β€” group SILo-detected sources
Path{n}/sources/spatial β€” group Spatial fingerprints and locations
Path{n}/sources/spatial/profiles sources x fastz x rows x cols numeric Spatial component / pixel weights per source, averaged across trials with footprints
Path{n}/sources/spatial/coords sources x 3 numeric Source centers per row: [z_loc, y_loc, x_loc], 0-indexed, computed as the footprint-weighted centroid of the averaged profiles
Path{n}/sources/temporal β€” group Frame-by-frame source activity
Path{n}/sources/temporal/dF_ls sources x channels x total frames numeric Least-squares Ξ”F (absolute or scaled)
Path{n}/sources/temporal/dF_denoised sources x channels x total frames numeric Denoised Ξ”F
Path{n}/sources/temporal/events sources x channels x total frames numeric Deconvolved source events
Path{n}/sources/temporal/F0 sources x channels x total frames numeric Baseline estimate used for normalization
Path{n}/sources/temporal/SNR sources x 1 numeric (optional) Signal-to-noise ratio metric; only written when extraction emits per-source SNR

per_trial_summary.h5

SILo.m writes per_trial_summary.h5 alongside experiment_summary.h5 in source_extraction/. The trial axis matches trial_table.h5 (all analysis trials); trials without alignment or source-extraction data are left as NaN in the corresponding slices.

Indexing conventions. Same as experiment_summary.h5: coordinate fields use 0-indexed [z_loc, y_loc, x_loc] (image axis order: fastz, rows, cols); z_loc is the 0-based fastz index, currently always 0.

Field Size Data type Description
row_major 1 x 1 uint8 Layout flag: 1 = row-major (README sizes match h5py shape); 0 = column-major (MATLAB size()). If absent, assume column-major (0).
Path{n} β€” group One group per imaging path
Path{n}/visualizations β€” group Per-trial static images for QC
Path{n}/visualizations/per_trial_mean_im trials x channels x fastz x rows x cols numeric Trial-aligned mean registered image per channel / Z slice
Path{n}/visualizations/per_trial_act_im trials x fastz x rows x cols numeric Trial-aligned activity / localization summary image
Path{n}/visualizations/per_trial_act_im_peaks trials x max_peaks x 3 numeric Per-trial detected peak locations [z_loc, y_loc, x_loc], 0-indexed, NaN-padded when a trial has fewer than max_peaks; from exptSummary.peaks with trial alignment offsets applied
Path{n}/visualizations/per_trial_num_peaks trials x 1 integer Number of valid peaks per trial; use to slice per_trial_act_im_peaks without scanning for NaNs
Path{n}/sources β€” group Per-trial SILo source data (when sources were extracted)
Path{n}/sources/spatial β€” group Per-trial spatial fingerprints and locations
Path{n}/sources/spatial/per_trial_profiles trials x sources x fastz x rows x cols numeric Spatial component / pixel weights per source per trial
Path{n}/sources/spatial/per_trial_coords trials x sources x 3 numeric Source centers per trial: [z_loc, y_loc, x_loc], 0-indexed (same convention as experiment_summary.h5 coords)
Path{n}/sources/temporal β€” group Per-trial source metrics
Path{n}/sources/temporal/per_trial_SNR trials x sources numeric Per-source SNR for each analysis trial

Citation

If you use GIAnT, please cite:

Xie, M. E., Friedrich, J., Wirsching, E., Shibu, C. J., Seyedolmohadesin, M., Ouellette, N., Wang, T., Svoboda, K., Charles, A. S., & Podgorski, K. GIAnT: a Glutamate Imaging Analysis Toolbox.

Machine-readable citation metadata is in CITATION.cff.

About

Glutamate Imaging Analysis Toolbox, MATLAB implementation

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages