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
Decoding
Mapping which brain regions carry information about a behavioral or experimental
variable, using cross-validated multivariate models.
-

This example maps which parts of a fUSI recording carry information about how fast a rat is moving with a searchlight: a small cross-validated model run over the local neighborhood of every voxel. Unlike a GLM, which asks voxel by voxel whether one voxel's signal tracks the regressor, the searchlight asks whether the local pattern around each voxel can predict it, picking up information carried jointly by neighboring voxels rather than by any one alone.
Searchlight decoding of a continuous variable