Analyze ultrasound BCI signals with leapsea

Organize existing functional ultrasound images, behavioral events and experiment records into an offline decoding task, combining domain experts, literature connectors and analysis skills to produce trial-level evidence.
A team with functional ultrasound recordings has a specific question to answer. Can signals within a defined time window support a classification of movement intention? This workflow starts with authorized, already reconstructed power Doppler sequences. Literature establishes the methodological background. Accuracy, latency and the number of usable trials come from the team's data and actual execution.
Define a replayable offline decoding task
Create a local research task in leapsea and provide image sequences, frame timestamps, behavioral events, session identifiers and experiment notes. One objective is to distinguish leftward and rightward movement intentions using a predefined premovement window. Each prediction should retain the frames and event labels from which it was constructed.
Norman and colleagues' Neuron study demonstrates single-trial movement-intention decoding from functional ultrasound in nonhuman primates. fUS measures hemodynamic changes associated with cerebral blood volume, so response timing matters. This workflow develops an offline method on existing records. Closed-loop latency, stability and device performance require their own execution evidence.
Ask experts to review the signal and evaluation question
Choose the Neural Signal Decoding Expert and request a data dictionary, label definition and session-splitting plan. Where needed, involve the Control and Signal Processing Expert to examine timestamps, sampling intervals and filtering causality. Define their deliverables at the field level. Each trial should point back to its original event row and corresponding image interval.
The expert first establishes the processing stage of the input. Raw radiofrequency or IQ data need an imaging and clutter-rejection pipeline. This example uses reconstructed power Doppler data. Record the reconstruction version, effective frame rate and experimental clock before deciding how to handle motion artifacts, baselines and feature windows.
Domain Expert
Neural Signal Decoding ExpertReview trial definitions, labels and decoding baselines.
Control and Signal Processing ExpertCheck clocks, filters and feature windows.
Skill
- EEG/BCI Decoding and Evaluation
Split by session and inspect data leakage.
- Scientific Plotting
Produce quality checks, event traces and confusion matrices.
Connector
- PubMed
Verify original methods and data-access conditions.
- Academic Literature Aggregation
Find further functional ultrasound research and methods.
Use connectors to check methods and data access
With the PubMed connector enabled and configured, retrieve DOI 10.1016/j.neuron.2021.03.003 and read its methods and data-availability statement. The connector obtains literature evidence, while authorized image files remain in the working directory. The paper states that data and analysis software are available on request. Record which materials the project actually obtained and under what permission.
Save notes on signal type, behavioral task, event definitions and decoding windows. Use the Academic Literature Aggregation connector when additional sources are needed. Record the experimental subjects, recording location, task and window alongside any published result. Acceptance criteria for the current project should be grounded in its own task definition.
Read the skills and build a trial-indexed dataset
Read the EEG/BCI Decoding and Leakage-Resistant Evaluation skill for its splitting, label-review and evaluation rules. Define fUS preprocessing from the actual signal specification. Use Scientific Plotting for quality-control figures. Begin execution by inspecting the file manifest, dimensions, dropped frames, duplicate timestamps and whether events fall inside valid acquisition intervals.
Build an event table indexed by session and trial, retaining cue, preparation, movement-onset and end times. Configure baseline and feature intervals separately. Examine motion artifacts around task events and preserve exclusion reasons and remaining class counts. If clocks cannot be aligned, deliver the alignment diagnosis and missing information before training.
Run a simple baseline before comparing features
Use predefined regions of interest or spatial features selected within the training fold to build a regularized linear classification baseline. Ask the agent to write and run the processing scripts, recording input digests, parameters, seeds and environment versions. Fit scaling, feature selection and dimensionality reduction on the training data in each fold, then apply those transforms to validation data.
For cross-session use, hold out complete sessions. With fewer sessions, grouping complete trials or acquisition blocks can answer a narrower question that must be stated. Keep windows from neighboring frames in the same group. When comparing window lengths, check their end times against the intended prediction time and document temporal dependencies introduced by offline bidirectional filtering.
Inspect predictions and temporal dependencies together
Have the expert review the confusion matrix, balanced accuracy, session-level results and class distribution. Organize uncertainty estimates around independent sessions or blocks. Label permutations should preserve the grouping structure. A control using movement-related covariates can help examine whether predictions depend primarily on motion or acquisition differences.
Report the actual windows and processing times, explaining acquisition duration, compute time and hemodynamic response timing separately. For an unusual session, return to raw frames, event marks and artifact plots. The researcher can then decide whether to collect more data, revise the method or retain the finding, with each decision tied to trial records.
Deliver an analysis package linked to original events
Request the cleaned event table, split manifest, preprocessing and training scripts, trial-level predictions, model configuration and quality-control report as formal artifacts. Predictions should include session, trial, true and predicted labels, the feature window and exclusion status. Scientific Plotting can provide confusion matrices, event-aligned traces and editable figure files.
Retain expert reviews and execution receipts in leapsea so a report can lead to a prediction row and its input trial. Compare alternative methods in research branches under the same frozen split. The workflow guides development. Project outcomes are established by the artifacts actually produced and the checks applied to them.
Start with an explicit deliverable
Attach authorized files and state the available Python environment and compute resources. Select the experts, ask the agent to read the relevant skills and check current connector configuration. Adapt this request to the actual fields and prediction objective.
Build an offline left/right movement-intention decoder from my power Doppler images and behavioral events. Use the Neural Signal Decoding and Control and Signal Processing experts to review clocks and windows, PubMed to check the methods, and the EEG/BCI evaluation and Scientific Plotting skills. First deliver a data dictionary and a session-based split plan, then run in the available environment. Retain fold-specific transforms, trial predictions, confusion matrices and environment records, using actual execution results for every metric.


