Load Encoding Volumes
This guide covers downloading and loading encoding volumes — a pre-computed 4-D volumetric representation of electrophysiological features on the Allen Common Coordinate Framework (CCF).
S3 Layout
aggregates/atlas/encoding_volumes/{project}/{label}/
└── brainwide_ephys_atlas_{res_um}um.npz 4-D volume (nx, ny, nz, N_features)
Encoding volumes are versioned independently by vintage label (label) and
voxel resolution (res_um, in µm). Available vintages:
|
|
Grid shape |
S3 file |
|---|---|---|---|
|
25 |
(456, 528, 320) |
|
|
50 |
(228, 264, 160) |
|
|
50 |
(228, 264, 160) |
|
Downloading
from pathlib import Path
import numpy as np
from one.api import ONE
from ephysatlas.data import download_encoding_volume
one = ONE()
local_path = Path("/path/to/local/storage")
# res_um omitted -> auto-resolves to the finest resolution available for this label
file_path = download_encoding_volume(local_path, label="2026_W26", one=one)
data = np.load(file_path, allow_pickle=True) # allow_pickle required for feature_names
Pass res_um explicitly to pick a specific resolution when a vintage has more than one:
file_path = download_encoding_volume(local_path, label="2026_W12", res_um=25, one=one)
Loading
The file contains the following arrays (N = number of features for the vintage, e.g. 41 for
2026_W12/2026_W26 and 43 for 2026_W39 — the feature set changed between vintages):
Key |
Shape |
Dtype |
Description |
|---|---|---|---|
|
(nx, ny, nz, N) |
float16 |
4-D volume: x × y × z × features |
|
(N,) |
object |
Feature name strings |
|
(N,) |
float32 |
Per-feature normalisation mean |
|
(N,) |
float32 |
Per-feature normalisation std deviation |
|
(3,) |
int32 |
Volume grid dimensions [nx, ny, nz] |
|
(1,) |
int32 |
Voxel resolution in µm |
vol = data["ephys_atlas_vol"]
feature_names = data["feature_names"]
idx = np.where(feature_names == "rms_ap")[0][0]
rms_ap_volume = vol[..., idx] # (nx, ny, nz) float16
Values are stored in raw (unnormalised) feature units, with 0.0 outside the brain
mask. mean_per_feature / std_per_feature are provided for optional z-scoring —
they are not pre-applied to ephys_atlas_vol.
See also
S3 Data Architecture — complete S3 folder layout
Load Channel Features — channel-level (tabular) features