app
Nerve Response Analysis
Nerve Response Analysis reads the recording list prepared in RHS Preview, finds stimulation events, groups them into trains, and measures compound action potential responses in the assigned channels.
Open Nerve Response Analysis
From the launcher, select Nerve Response Analysis and choose Open. From a source checkout, run:
labkit_NerveResponseAnalysis_app
Analyze A Recording Set
- On Setup, choose the filter JSON created by RHS Preview.
- On Protocol, choose the protocol JSON that assigns channel roles. A protocol is optional, but strongly recommended.
- Set Max recordings or Max duration only when you want a shorter test run. A value of zero means no limit.
- Choose Analyze Filtered Files.
- On Review, inspect the counts and switch the plot between Counts and Issues.
- On Export, choose an output folder and then Export Analysis.
Changing the filter, protocol, or limits clears the previous analysis so that an export cannot silently use outdated settings.
The filter record and optional protocol are saved as distinct portable project sources. Older projects with separate source fields are upgraded on load.
Project And Session State
The durable project stores portable references for the filter record and optional protocol, the two run limits, and the last export paths.
Parsed JSON, analysis tables, issue details, preview selection, log messages, and output-folder convenience are transient session state. Opening a project reparses its JSON sources but does not persist or silently reuse old analysis tables; choose Analyze Filtered Files to calculate them again. If an existing selected JSON file is malformed, project restore stops and preserves the current document. An absent optional protocol remains valid.
What The Analysis Does
For each readable recording, the app selects an event source from the protocol and recording metadata, reads the required waveform, and finds sharp changes using the absolute first difference. A robust noise estimate sets the default detection threshold. Nearby peaks are reduced according to the minimum event spacing, then grouped into trains by their time gaps and train rules.
For every event and response channel, the app measures a pre-event baseline, baseline noise, positive and negative peaks, peak-to-peak amplitude, peak time, latency, and SNR. The response search starts after the pulse-blanking interval to avoid measuring the stimulation artifact itself.
Detection and measurement settings are scientific choices. Confirm that the event source and timing shift match the physical stimulus before interpreting latency.
Output Files
Export Analysis writes:
nerve_response_analysis.json, containing source information, the protocol, events, trains, response measurements, and issues;nerve_response_analysis.labkit.json, containing the selected inputs, run limits, output identity, and result counts.
An unreadable recording or missing channel is recorded in the issues table so that other recordings can still complete.
Detect Events In MATLAB Code
sampleRate = 10000;
timeSec = (0:1/sampleRate:0.12).';
eventSignal = zeros(size(timeSec));
pulseTimes = 0.03 + (0:4).' * 0.01;
eventSignal(round(pulseTimes * sampleRate) + 1) = 5;
eventOptions = struct( ...
"sourceId", "stim", ...
"stimShiftSec", 0, ...
"train", struct("minDetectedPulses", 5));
[events, trains] = ...
nerve_response_analysis.analysisRun.detectEventTrains( ...
timeSec, eventSignal, eventOptions);
timeSec and eventSignal must be equal-length numeric vectors. Options can set the threshold multiplier, minimum score, minimum peak spacing, train gap, minimum pulse count, maximum train duration, isolation rule, and reported stimulus-time shift. With no candidates, the function returns empty tables.
Measure CAP Features In MATLAB Code
metrics = nerve_response_analysis.analysisRun.measureCapMetrics( ...
timeSec, responseSignal, events.timeSec, metricOptions);
metricOptions can set baselineWindowSec, blankingAfterPulseSec, and searchEndAfterPulseSec. The output contains one row per event. If the search window contains no samples, that row is kept with status noSamples.
To process an RHS file or an entire filter record, use nerve_response_analysis.analysisRun.analyzeRecording or nerve_response_analysis.analysisRun.analyzeSession.
Function Reference
The generated pages for detectEventTrains, measureCapMetrics, and analyzeSession document protocol nesting, direct option defaults and legal values, table schemas, units, partial-recording failure policy, and related APIs.
Errors And Limitations
- Time and signal vectors must have the same length.
- A detection peak marks an electrical transition; it is not automatically the physical onset of the delivered stimulus.
- Default timing windows are starting points, not universal physiological constants.
- Missing events produce empty results rather than fabricated measurements.
- Review the issues table before comparing counts across recordings.
Related Functions And Apps
nerve_response_analysis.analysisRun.analyzeSessionnerve_response_analysis.analysisRun.detectEventTrainsnerve_response_analysis.analysisRun.measureCapMetrics- RHS Preview
- Response Review and Stats
Functions And API
Open a function for exact MATLAB syntax, arguments, outputs, behavior, and source.
| Function | Purpose |
|---|---|
nerve_response_analysis.analysisRun.analyzeRecording | Analyze one RHS recording according to a protocol. |
nerve_response_analysis.analysisRun.analyzeSession | Analyze accepted RHS recordings and combine their results. |
nerve_response_analysis.analysisRun.detectEventTrains | Detect pulse candidates and group them into trains. |
nerve_response_analysis.analysisRun.measureCapMetrics | Measure event-locked CAP response features. |
Change history
- 2026-07-20 - App actions require explanatory hover helpfeat | compatible
- 2026-07-19 - App SDK explicit contract replaces the retired UI runtimerefactor | breaking
- 2026-07-17 - Public API help is complete, discoverable, and behavior checkeddocs | compatible
- 2026-07-17 - Project restore distinguishes missing sources from damaged sourcesfix | compatible
- 2026-07-17 - Explicit layout action contractrefactor | compatible
- 2026-07-16 - Core, neurophysiology, and ECG project validation ownershiprefactor | compatible
- 2026-07-16 - Runtime-owned session defaults across App familiesrefactor | compatible
- 2026-07-16 - Nerve Response Analysis uses fixed source identitiesrefactor | compatible
- 2026-07-16 - UI 7 public runtime boundaryrefactor | breaking
- 2026-07-16 - Canonical role-based source collectionsrefactor | compatible
- 2026-07-15 - Runtime V2 lifecycle ownership across the app fleetrefactor | breaking
- 2026-07-13 - Managed scientific and conversion constantsrefactor | compatible
- 2026-07-06 - UI 5 facade redesign, app migration, and plot refreshrefactor | breaking
- 2026-07-03 - CSC export and viewport policyfeat | compatible
- 2026-07-03 - UI groups migrationrefactor | compatible
- 2026-07-03 - Declarative app runtimerefactor | compatible
- 2026-07-01 - Debug sample packsfeat | compatible
- 2026-06-30 - Close guards and caught-exception diagnosticsfeat | compatible
- 2026-06-30 - Output folder promptsfeat | compatible
- 2026-06-28 - App diagnostics and hardened UI workflowsfeat | compatible
- 2026-06-24 - File-panel migrationrefactor | breaking
- 2026-06-23 - Version metadata baselinefeat | compatible