Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

All-GCL Data Manual

1. Downloading the Dataset from Hugging Face

The Hugging Face dataset repository contains a root directory with individual session folders (one per session_id) and a shared Stimuli directory.

To download the entire dataset from the command line, run:

pip install huggingface_hub

hf download --repo-type dataset eulerlab/all-gcl --local-dir /path/to/target

After download the target directory will have the following structure:

/path/to/target/
├── Stimuli/
├── session_Experimenter_1_2022-09-29/
│   ├── experiment_1_LR/
│   │   ├── field_RGC1.nwb
│   │   └── field_RGC2.nwb
│   └── ...
├── session_Experimenter_8_2021-11-30/
│   └── experiment_2_RR/
│       └── field_GCL1.nwb
└── ...

Note that, as an alternative, you can browse the HuggingFace repository and download individual sessions you are interested in. For convenience, the export includes .txt files that show the structure and contents of each field's .nwb file.

2. Dataset Structure Inside Each NWB File

Every field-specific .nwb file follows a consistent organisation under the "Neurodata without borders" standards:

  • Acquisition (TwoPhotonSeries_*) – raw two-photon imaging movies per stimulus presentation.
  • Processing modules
    • rois module with an ImageSegmentation/"ROI masks" plane segmentation describing ROI masks, sizes, and pixel dimensions.
    • spatial module with spatial_locations dynamic table storing ROI and field retinal coordinates.
    • session_info module containing presentation_sequence (chronological stimulus order and start times).
    • Condition_{cond} modules for each condition, populated with:
      • cell_types dynamic table (Baden16 preprocessing references plus classifier outputs).
      • receptive_fields dynamic table (Gaussian RF parameters, temporal RF metrics, split RF metadata; only present for the subsets of data that have seen the whitenoise stimulus).
      • Multiple TimeSeries objects for averages, snippets, traces, and quality metrics per stimulus.
  • Stimulus references – OpticalSeries entries (e.g. movingbar_stimulus) pointing to external HDF5 resources inside the shared Stimuli directory. Paths are stored relative to the NWB file, so the location of the Stimuli directory should not be moved relative to the location of the sessions folders.
  • Lab metadataExperimentMetadata extension storing eye, orientation, setup ID, and experiment number.

For NWB documentation on accessing standard containers consult https://pynwb.readthedocs.io.

3. Reproducing the Original Analysis Table

We offer companion code to reproduce the analysis in our manuscript at https://github.com/eulerlab/all-GCL-manuscript .

To reproduce the original table that was used to produce visualisations and anlyses in the dataset pre-print, run:

python all_gcl_manuscript/read_nwb_table.py /path/to/target \
    --filter-to-match-original \
    --output reconstructed_tables # Optional, saves extracted tables in .pkl and .parquet for later access

Note that en export of the original table in .parquet format is already provided in the dataset repository. When reading the .parquet file, depending on the analysis you want to run, it might be necessary to restore nested lists back to numpy arrays. You can do it with a utility function we provide:

import os

import pandas as pd

from all_gcl_manuscript.utils import restore_numpy_arrays

dataset_path = "/path/to/data/storage"

all_gcl_df = pd.read_parquet(os.path.join(dataset_path, "all_GCL_table.parquet"))
all_gcl_df = restore_numpy_arrays(all_gcl_df)

4. Additional Information in Each NWB File

The export embeds several layers of metadata beyond the original table:

  • Session and experiment metadata – anonymised experimenter identifiers, protocol information, description summarising stimuli.
  • Stimulus presentation log – per-session chronological table (presentation_sequence) useful for studying adaptation and history effects.
  • Cell-type classifier outputs – full probability vectors (probs_per_cluster) and cluster/group/supergroup IDs for every ROI with valid assignments.
  • Receptive-field analytics – Gaussian fits, temporal RF metrics, polarity, split RF indices, relative offsets.
  • Quality indices – chirp/bar quality indices and per-stimulus QI tables.
  • Stimulus-specific traces – averages, snippets, preprocessed traces, trigger times for chirp, moving bar, and noise stimuli, preserving the per-condition granularity used in analyses.
  • Raw imaging movies – for each stimulus presentation, for all sessions where the data was available.

5. Accessing Stimuli, Responses, and Internal Fields

Example: loading an NWB file

from pathlib import Path
from pynwb import NWBHDF5IO

nwb_path = Path("/path/to/session_Arlinghaus_2022-06-14/experiment_1_LR/field_GCL1.nwb")
with NWBHDF5IO(nwb_path, "r") as io:
    nwbfile = io.read()

    # Inspect the available recordings and pick the one you need.
    print(list(nwbfile.acquisition.keys()))

    raw_series = nwbfile.acquisition["TwoPhotonSeries_Cond_C1_chirp_Pres_1"]
    raw_frames = raw_series.data[:]  # (time, height, width)

    condition = nwbfile.processing["Condition_C1"]
    chirp_avg = condition["chirp_60Hz_average"]
    avg_sample = chirp_avg.data[:5, :3]  # first frames × first ROIs

    cell_types = condition["cell_types"].to_dataframe()
    print(cell_types.head())

Example: loading external stimulus movies

Stimulus metadata is stored as OpticalSeries with external_file entries (e.g. Stimuli/chirp/setup_1/...). This was done to avoid redundancy during exporting because across sessions the stimuli used are always similar.

To load the referenced stimulus HDF5:

import h5py

series = nwbfile.stimulus["chirp_stimulus"]
relative_ref = series.external_file[:][0]  # e.g. ../../Stimuli/processed_stimuli.h5/chirp_generic
stim_file_rel, dataset_name = relative_ref.rsplit("/", 1)
stim_file_path = (nwb_path.parent / stim_file_rel).resolve()

with h5py.File(stim_file_path, "r") as stim_file:
    stimulus_frames = stim_file[dataset_name][:]

Example: accessing ROI-level metadata

seg = nwbfile.processing["rois"]["ImageSegmentation"]["ROI masks"]
roi_df = seg.to_dataframe().reset_index().rename(columns={"roi_ids": "roi_id"})

spatial = nwbfile.processing["spatial"]["spatial_locations"].to_dataframe().reset_index(drop=True)
merged = roi_df.merge(
    spatial[["roi_id", "ventral_dorsal_pos_um", "temporal_nasal_pos_um"]],
    on="roi_id",
    how="left",
)
Downloads last month
280