cedalion.data package

Module contents

Cedalion datasets and utility functions.

cedalion.data.get(fname: str | Path) → Path[source]

Returns the absolute path to a file under cedalion/data/.

class cedalion.data.AtlasFiles(basedir: Path, nifti: Path, labels_json: Path)[source]

Bases: object

Paths for a bundled atlas volume and label lookup.

basedir: Path[source]
nifti: Path[source]
labels_json: Path[source]
cedalion.data.get_aal3_atlas_files() → AtlasFiles[source]

Return paths to the bundled AAL3 atlas volume and label lookup.

cedalion.data.get_brodmann_atlas_files() → AtlasFiles[source]

Return paths to the bundled Brodmann atlas volume and label lookup.

cedalion.data.get_ninja_cap_probe()[source]

Load the fullhead Ninja NIRS cap probe.

cedalion.data.get_ninja_uhd_cap_probe()[source]

Load the fullhead Ninja NIRS ultra HD cap probe.

cedalion.data.get_snirf_test_data()[source]
cedalion.data.get_colin27_segmentation(downsampled=False)[source]

Retrieves the Colin27 segmentation dataset, based on Holmes et al. [HHC+98].

cedalion.data.get_colin27_parcel_file()[source]

Retrieves the Colin27 headmodel, based on Holmes et al. [HHC+98].

cedalion.data.get_icbm152_segmentation()[source]
cedalion.data.get_icbm152_parcel_file()[source]

Retrieves the ICBM headmodel parcellation.

cedalion.data.get_fingertapping() → Recording[source]

Retrieves a finger tapping recording in BIDS format.

Data is from Luke and McAlpine [LM21a]

cedalion.data.get_fingertappingDOT(
crs: str = 'digitized',
) → Recording[source]

Retrieves a finger tapping DOT example dataset from the IBS Lab.

cedalion.data.get_fingertapping_snirf_path() → Path[source]
cedalion.data.get_multisubject_fingertapping_snirf_paths()[source]
cedalion.data.get_multisubject_fingertapping_path() → Path[source]
cedalion.data.get_photogrammetry_example_scan()[source]
cedalion.data.get_fingertappingDOT_photogrammetry_scan()[source]
cedalion.data.get_lumo_testdataset()[source]
cedalion.data.get_artinis_testdataset()[source]
cedalion.data.get_kernel_testdataset()[source]
class cedalion.data.ExampleProbe(geo3d, meas_list, amp)[source]

Bases: ExampleProbe

Probe geometry, measurement list and amplitudes of an example dataset.

geo3d[source]

Optode and landmark positions.

meas_list[source]

Measurement list.

amp[source]

Amplitude time series. For probes without recordings (ninja caps), a one-sample time series with the channels of the measurement list.

cedalion.data.get_example_probe(
name: str,
max_channel_distance: Annotated[Quantity, '[length]'] | None = None,
) → ExampleProbe[source]

Probe of one of cedalion’s example datasets, prepared for registration.

These are the probes for which get_precomputed_fluence() and get_precomputed_sensitivity() provide forward models. Compared to the raw datasets, landmark labels are normalized and missing landmarks are added, so that every probe can be registered to the standard head models.

Parameters:
  • name – One of EXAMPLE_PROBES.

  • max_channel_distance – Only for "lumo_testdataset": drop channels with larger source-detector distances. Defaults to 3.5 cm.

Returns:

The probe geometry, measurement list and amplitude time series.

cedalion.data.get_precomputed_fluence(dataset: str, head_model: str) → Path[source]

Precomputed forward model results for examples and documentation.

Parameters:
  • dataset – “fingertapping” or “fingertappingDOT”

  • head_model – “colin27” or “icbm152”

Returns:

A Path object pointing to the fluence file.

cedalion.data.get_precomputed_sensitivity(
dataset: str,
head_model: str,
) → DataArray[source]

Precomputed sensitivities for examples and documentation.

Parameters:
  • dataset – “fingertapping”, “fingertappingDOT”, “nn22_resting”, “ninja_cap_56x144”, “ninja_uhd_cap_164x496”

  • head_model – “colin27” or “icbm152”

Returns:

The precomputed sensitivity (Adot) matrix

cedalion.data.get_nn22_resting_state() → Recording[source]
cedalion.data.get_snirf2bids_example_dataset() → tuple[Path, Path][source]

A dataset for demonstrating the snirf2bids notebook.

Returns:

The path to the downloaded dataset directory and the path to the mapping file with changes that the user would do manually.

cedalion.data.get_fieldtrip_colin27_landmarks() → Annotated[DataArray, DataArraySchema(dims='label', coords='label', 'label', 'type')][source]
cedalion.data.get_spa_fnirs() → Recording[source]
class cedalion.data.HeadModelFiles(
basedir: pathlib.Path,
mask_files: dict[str, str],
landmarks_ras_file: str,
brain_vertex_coordinates: str,
scalp_surface_obj: str,
brain_surface_obj: str,
freesurfer_surface_obj: str,
inflated_surface_obj: str,
parcel_colors: str,
voxel_to_vertex_mapping: str,
)[source]

Bases: object

basedir: Path[source]
mask_files: dict[str, str][source]
landmarks_ras_file: str[source]
brain_vertex_coordinates: str[source]
scalp_surface_obj: str[source]
brain_surface_obj: str[source]
freesurfer_surface_obj: str[source]
inflated_surface_obj: str[source]
parcel_colors: str[source]
voxel_to_vertex_mapping: str[source]
load_parcel_colors()[source]
load_voxel_to_vertex_mapping()[source]
load_brain_vertex_coordinates()[source]
cedalion.data.get_colin27_headmodel_files() → HeadModelFiles[source]

Retrieve the Colin27 head model files.

The Colin27 atlas (Holmes et al. [HHC+98]) was further processed with FreeSurfer (Fischl [Fis12]) to produce cortical surface meshes, parcellations (Schaefer et al. [SKG+18]), and voxel-to-vertex mappings used in cedalion’s DOT pipeline.

cedalion.data.get_icbm152_headmodel_files() → HeadModelFiles[source]

Retrieves the ICBM-152 segmentation dataset.

The ICBM1-52 atlas (Fonov et al. [FEB+11]) was further processed with FreeSurfer (Fischl [Fis12]) to produce cortical surface meshes, parcellations (cite:t:Schaefer2018), and voxel-to-vertex mappings used in cedalion’s DOT pipeline.

cedalion.data.get_colin27_freesurfer_directory() → Path[source]

Return the path to the FreeSurfer recon-all output for the Colin27 atlas.

The Colin27 MRI (Holmes et al. [HHC+98]) was processed with FreeSurfer’s recon-all pipeline (Fischl [Fis12]) to generate cortical surface reconstructions used in cedalion’s DOT head modelling.

cedalion.data.get_icbm152_freesurfer_directory() → Path[source]

Return the path to the FreeSurfer recon-all output for the ICBM-152 atlas.

The ICBM-152 MRI was processed with FreeSurfer’s recon-all pipeline (Fischl [Fis12]) to generate cortical surface reconstructions used in cedalion’s DOT head modelling.

cedalion.data.get_atlas_files(atlas: str) → tuple[Path, Path][source]

Return atlas volume and label files.

Parameters:

atlas – Name of the atlas. One of "aal3" or "brodmann".

Returns:

A tuple (fname_volume, fname_labels) with paths to the NIfTI volume and the JSON label file.