Examples
These examples show how to use ConfUSIus on real data, with an emphasis on
workflows you can run and adapt in your own analyses.
Each example starts from a plain Python script and is rendered as a notebook-style
page with code, outputs, and downloadable source files.
Getting Started
First steps with ConfUSIus: loading a recording, working with Xarray-backed data,
and building simple summaries and visualizations.
-

This example demonstrates how to use ConfUSIus to load and handle fUSI data as DataArray instances. We will use a small subset of the Nunez-Elizalde 2022 dataset and use a few basic Xarray operations to inspect, subset, and summarize the data.
ConfUSIus and Xarray 101
Registration
Aligning fUSI recordings across sessions, subjects, or to a reference anatomy with
ConfUSIus's volume registration tools.
-

This example shows how to align two power Doppler images acquired from the same subject in different sessions. We use register_volume with a rigid transform, which is appropriate when the imaged anatomy is the same but the probe placement differs slightly between the two recordings.
Registration of two sessions from the same subject
-

This example shows how to correct volume-to-volume brain motion in one fUSI recording with register_volumewise. For this example, we use a short subset of an open-field 2D+t recording from the Cybis Pereira 2026 dataset. After volumewise registration, we inspect three things that are useful in practice:
Motion correction of a single recording
-

This example shows the full workflow for aligning a single-slice fUSI recording to one of ConfUSIus's Allen-space fUSI templates: fetch the recording and the template, initialize and refine the registration, inspect diagnostic overlays, resample the Allen Mouse Brain Atlas onto the recording's native grid, and save the aligned atlas for reuse.
Register a recording to an Allen fUSI template
Decomposition
Extracting spatiotemporal structure from fUSI recordings using dimensionality reduction
techniques such as PCA, FastICA, and NMF.
-

This example shows how to use principal component analysis (PCA) to decompose a fUSI recording into principal axes of variance.
PCA on a single fUSI recording
-

This example shows how to use FastICA to decompose a fUSI recording into independent components.
FastICA on a single fUSI recording
-

This example shows how to use non-negative matrix factorization (NMF) to decompose a fUSI recording into non-negative spatial maps and their associated non-negative time courses. It complements the PCA and FastICA examples in the same gallery.
NMF on a single fUSI recording
Functional Connectivity
Computing functional connectivity (FC) measures from fUSI data using brain region
parcellations or data-driven approaches.
-

This example shows an end-to-end regional functional connectivity (FC) analysis: briefly register a single-slice fUSI recording to an Allen-space template, bring the Allen Mouse Brain Atlas into the recording's native space, extract region-averaged signals, and visualize their pairwise correlation with plot_matrix.
Atlas-based region correlation matrix
-

This example computes voxel-wise seed-based functional connectivity maps: register a single-slice fUSI recording to an Allen-space template, bring an Allen Mouse Brain Atlas into the recording's native space, pick four atlas regions of interest as seeds, and correlate each seed's signal against every voxel with SeedBasedMaps. Each resulting map is displayed with plot_stat_map, using the resampled Allen reference volume as background.
Atlas-based seed connectivity maps
GLM
Fit voxel-wise General Linear Models to fUSI recordings to map stimulus-driven
activation.
-

The General Linear Model (GLM) is the workhorse of task-based neuroimaging analysis. It treats every voxel independently and asks a simple question: how much of this voxel's time course can be explained by the experimental paradigm, once we account for nuisance signals such as slow drifts and physiological noise? Fitting that model voxel-by-voxel turns a fUSI recording into a statistical map that highlights where the brain responded to the stimulus.
First-level GLM analysis of fUSI data
-

This example reproduces the lagged-GLM analysis reported by Cybis Pereira et al. 2026, which uses functional ultrasound imaging of a freely moving rat exploring an open field with its body position tracked from video. Unlike the block-design task in the First-level GLM analysis of fUSI data example, the regressor of interest is a continuous variable measured throughout the recording, the animal's locomotion speed, and we ask at every voxel how much of the power Doppler time course tracks it at different lags.
Lagged first-level GLM analysis of fUSI data with a continuous regressor