LabKit MATLAB Workbench

app

Response Review And Stats

Response Review and Stats opens a Nerve Response Analysis result or a segment table, displays the measurements, and exports a clean CSV for review or downstream statistics. Segment tables can also be aligned and measured again with new baseline and noise windows.

Open Response Review And Stats

From the launcher, select Response Review Stats and choose Open. From a source checkout, run:

labkit_ResponseReviewStats_app

Review An Analysis

  1. On Setup, choose an analysis JSON or segment CSV.
  2. The app loads the measurement rows immediately.
  3. If the input contains waveform segments, set the Baseline and Noise windows. Both ranges are expressed in seconds relative to alignment time.
  4. Choose Refresh Metrics when you want to reload the source explicitly.
  5. On Review, inspect the summary and details. Switch the plot between Summary and Aligned.
  6. On Export, choose a folder and select Export Metrics.

Changing either time window recalculates a loaded segment input automatically. For an analysis JSON that already contains measurements, the app reads those measurements rather than recreating unavailable waveform data.

Accepted Inputs

When segments have different time grids, the app interpolates them onto a shared grid. If no interval is specified in code, it uses the median positive source interval. If the timestamps cannot provide one, it uses 0.0001 seconds. When no window is specified, the grid spans the intersection of the time ranges after each segment's alignment-time shift. Samples outside an aligned segment's original range remain NaN.

The selected input is saved as a portable project source. Older projects are upgraded on load.

Project And Session State

The project saves the source, baseline/noise windows, and last export reference. Metric tables, aligned waveforms, and summaries are recalculated from that source after load.

Measurements And Summary

For each aligned segment, the calculation subtracts the baseline mean and reports positive and negative peaks, peak-to-peak amplitude, noise RMS, and SNR. The summary groups rows by pairId when available; otherwise it uses the segment name. Counts are included so exclusions and missing rows remain visible.

Output Files

Export Metrics writes:

Align Segments In MATLAB Code

localTime = (-0.003:0.001:0.012).';
firstValues = zeros(size(localTime));
firstValues(localTime == 0.004) = 2;
firstValues(localTime == 0.008) = -1;
secondValues = 0.8 * firstValues;
segments = struct( ...
    "timeSec", {10 + localTime, 20 + localTime}, ...
    "values", {firstValues, secondValues}, ...
    "name", {"first", "second"}, ...
    "alignTimeSec", {10, 20});
options = struct( ...
    "sampleIntervalSec", 0.001, ...
    "windowSec", [-0.003 0.012], ...
    "baselineWindowSec", [-0.003 -0.001], ...
    "noiseWindowSec", [-0.003 -0.001], ...
    "measurementWindowSec", [0 0.010]);

aligned = response_review_stats.analysisRun.alignSegments(segments, options);
metrics = response_review_stats.analysisRun.measureAlignedSegments( ...
    aligned, options);
summary = response_review_stats.analysisRun.summarizeMetrics(metrics);

Each segment supplies timeSec, values, and name. An optional alignTimeSec shifts that segment to the common zero. aligned.values is a samples-by-segments matrix.

Function Reference

The generated pages for alignSegments and measureAlignedSegments define time-window option shapes and defaults, interpolation and empty-sample behavior, output table columns, failures, examples, and related APIs.

Errors And Limitations

Change history