Allen Institute - Visual Behavior - Optical Physiology
Allen Institute - Visual Behavior - Optical Physiology. Neurophysiology / NWB data on the DANDI Archive (6015 assets, 1.4 TB). License: spdx:CC-BY-4.0.
- Category
- Neuroscience
- Provider
- Garrett, Marina
- License
- spdx:CC-BY-4.0
- DOI
- 10.48324/dandi.000711/0.231121.1730
- Hosted on
- Amazon S3, bucket dandiarchive/dandisets/000711, us-east-2
- Access
- Free and public. No account with the data provider is needed.
- Source
- https://dandiarchive.org/dandiset/000711
Data structure and loading code
Fields
assets.jsonld[] | path, contentSize, encodingFormat (application/x-nwb), contentUrl[api download url, s3 blob url], digest… |
dandiset.jsonld | name, description, license, doi, citation, contributor[], assetsSummary{numberOfBytes, numberOfFiles, numberOfSubjects… |
nwb_version [image] | 2.6.0 |
general/subject [image] | age=P89D; description=A visual behavior subject with a LabTracks ID; genotype=Vip-IRES-Cre/wt;Ai148(TIT2L-GC6f-ICL-tTA2)… |
acquisition/ [image] | v_in (TimeSeries), v_sig (TimeSeries) |
processing/licking [image] | licks:TimeSeries |
processing/rewards [image] | autorewarded:TimeSeries, volume:TimeSeries |
processing/running [image] | dx:TimeSeries, speed:TimeSeries, speed_unfiltered:TimeSeries |
processing/stimulus [image] | timestamps:TimeSeries |
intervals/ [image] | grating_presentations (125 rows: active, duration, end_frame, flashes_since_change, id, image_name, image_set… |
stimulus/presentation [image] | grating:IndexSeries |
stimulus/templates [image] | grating |
nwb_version [image+ophys] | 2.6.0 |
general/subject [image+ophys] | age=P225D; description=A visual behavior subject with a LabTracks ID; genotype=Sst-IRES-Cre/wt;Ai148(TIT2L-GC6f-ICL-tTA2… |
acquisition/ [image+ophys] | EyeTracking (EllipseEyeTracking), v_in (TimeSeries), v_sig (TimeSeries) |
processing/eye_tracking_rig_metadata [image+ophys] | eye_tracking_rig_metadata:OphysEyeTrackingRigMetadata |
processing/licking [image+ophys] | licks:TimeSeries |
processing/ophys [image+ophys] | corrected_fluorescence:Fluorescence, demixed_trace:Fluorescence, dff:DfOverF, event_detection:OphysEventDetection… |
processing/rewards [image+ophys] | autorewarded:TimeSeries, volume:TimeSeries |
processing/running [image+ophys] | dx:TimeSeries, speed:TimeSeries, speed_unfiltered:TimeSeries |
and 5 more
Files
Allen Visual Behavior 2-photon (Garrett et al. 2023 / Visual Behavior Ophys): change-detection task. *_image.nwb files are behavior-only training sessions; *_image+ophys.nwb files add the imaging (dF/F, events, ROI masks).
What the mount contains: /mnt/archive/0.231121.1730/{assets.jsonld, assets.yaml, collection.jsonld, dandiset.jsonld, dandiset.yaml} and /mnt/archive/draft/{same five}. NOTHING ELSE. The 6,015 data files (1.5 TB) are content-addressed blobs at s3://dandiarchive/blobs/<a>/<b>/<uuid>, resolved per asset from assets.jsonld (contentUrl[1]) or via the DANDI API; the bucket is public (anonymous read).
Logical layout (asset paths):
sub-<subject>/sub-<subject>_ses-<session>[_probe-<id>][_<kind>].nwb
kinds: image x4,079, image+ophys x1,936
extensions: .nwb x6,015
subjects: 107 (from paths; DANDI says 107); sessions per subject up to 132
file sizes: min 49 MB, median 196 MB, max 3.4 GB
species: Mus musculus - House mouse
approach: microscopy approach; cell population imaging
technique: analytical technique; surgical technique
NWB neurodata types across assets: ImagingPlane, OpticalChannel, PlaneSegmentation, ProcessingModule
license: spdx:CC-BY-4.0; DOI 10.48324/dandi.000711/0.231121.1730
Probed files (h5py over S3, 2026-09-09):
sub-486737/sub-486737_ses-20191018T144135_image.nwb (49 MB, image, 4,079 such files): NWB 2.6.0; acquisition v_in, v_sig; processing licking, rewards, running, stimulus; intervals grating_presentations, trials; units 0
sub-524158/sub-524158_ses-20201028T102855_image+ophys.nwb (228 MB, image+ophys, 1,936 such files): NWB 2.6.0; acquisition EyeTracking, v_in, v_sig; processing eye_tracking_rig_metadata, licking, ophys, rewards, running, stimulus; intervals Natural_Images_Lum_Matched_set_ophys_H_2019_presentations, natural_movie_one_presentations, spontaneous_presentations, trials; units 0Example file: sub-486737/sub-486737_ses-20191018T144135_image.nwb — 49 MB at s3://dandiarchive/blobs/26d/ae3/26dae389-0884-4c51-8c6c-732c66a06c05; NWB 2.6.0; "TRAINING_0_gratings_autorewards_15min"
Load the data
import json, os, glob, collections
M = os.environ.get("SCIGANTIC_MOUNT_PATH", "/mnt/archive")
# The mount holds ONLY the dandiset metadata; the NWB files are content-addressed blobs elsewhere in the
# public dandiarchive bucket. assets.jsonld maps each logical path to its blob URL.
versions = sorted(d for d in os.listdir(M) if os.path.isdir(f"{M}/{d}"))
ver = "0.231121.1730" if "0.231121.1730" in versions else versions[-1]
assets = json.load(open(f"{M}/{ver}/assets.jsonld"))
assets = assets.get("@graph", assets) if isinstance(assets, dict) else assets
print(f"version {ver}: {len(assets)} assets, {sum(a.get('contentSize', 0) for a in assets)/1e9:.1f} GB")
def blob_key(a):
return next((u.split(".s3.amazonaws.com/", 1)[1] for u in a.get("contentUrl", []) if ".s3.amazonaws.com/" in u), None)
import re
def kind(path): # BIDS-style suffix = last "_" token without a "-"; none => bare "session" file
if not path.endswith(".nwb"): return os.path.splitext(path)[1] or "other"
toks = os.path.basename(path).rsplit(".", 1)[0].split("_")
suffix = toks[-1] if len(toks) > 1 and "-" not in toks[-1] else "session"
return ("probe-" if any(t.startswith("probe-") for t in toks) else "") + suffix
kinds = collections.Counter(kind(a["path"]) for a in assets)
print("file kinds:", dict(kinds))
# Open the smallest NWB of one kind lazily over anonymous S3 (h5py + s3fs; nothing is downloaded whole).
nwbs = sorted((a for a in assets if kind(a["path"]) == "image+ophys"), key=lambda a: a.get("contentSize", 0))
a = nwbs[0] if nwbs else sorted(assets, key=lambda a: a.get("contentSize", 0))[0]
key = blob_key(a); print("opening", a["path"], f"({a['contentSize']/1e6:.0f} MB) ->", key)
import h5py, s3fs
fs = s3fs.S3FileSystem(anon=True)
f = h5py.File(fs.open(f"dandiarchive/{key}", "rb", block_size=4 * 1024 * 1024), "r")
txt = lambda v: v.decode() if isinstance(v, bytes) else v
print("nwb", f.attrs.get("nwb_version"), "|", txt(f["session_description"][()]))
print("subject:", {k: txt(f["general/subject"][k][()]) for k in f["general/subject"]} if "general/subject" in f else "-")
print("acquisition:", list(f["acquisition"].keys())[:12])
print("processing:", {m: list(f["processing"][m].keys())[:8] for m in f["processing"]} if "processing" in f else {})
print("intervals:", list(f["intervals"].keys()) if "intervals" in f else [], "| units:", f["units/id"].shape[0] if "units" in f else 0)
# The same file through pynwb (preinstalled), still lazy:
from pynwb import NWBHDF5IO
io = NWBHDF5IO(file=f, mode="r", load_namespaces=True)
nwb = io.read(); print(nwb.identifier, "|", nwb.session_start_time)
print(nwb.intervals["Natural_Images_Lum_Matched_set_ophys_H_2019_presentations"].to_dataframe().head())Written for a Scigantic notebook, where /mnt/archive is the mounted dataset.
Analyze this dataset without downloading it
On Scigantic, Allen Institute - Visual Behavior - Optical Physiology opens in a hosted JupyterLab notebook with the data already mounted, so you can read files where they are stored instead of copying them first. Each notebook includes an AI assistant that can see the mounted files and write and run analysis code. Open the dataset page to launch a notebook, or browse the full catalog.