Skip to content

atlases

tit.plotting.nilearn.atlases

The atlases the Nilearn Visuals slice PDF outlines: label volumes TI-Toolbox ships.

Each key names a file in resources/atlas/, the MNI atlases the repository already ships for ROI picking; resources/atlas/manifest.json (read through :mod:tit.atlas.manifest) records its source, licence and region count. A job reads the file from disk, so no atlas is downloaded at image build or at run time. The keys are what :class:~tit.plotting.nilearn.config.NilearnConfig accepts; saved configs name them.

atlas_path

atlas_path(key: str) -> str

Path to key's label volume in resources/atlas/.

Raises:

Type Description
FileNotFoundError

If the manifest lists no such file on disk.

Source code in tit/plotting/nilearn/atlases.py
def atlas_path(key: str) -> str:
    """Path to *key*'s label volume in ``resources/atlas/``.

    Raises:
        FileNotFoundError: If the manifest lists no such file on disk.
    """
    # Imported here so the table above reads without touching the filesystem
    # (NilearnConfig checks its keys when the server imports it).
    from tit.atlas.constants import mni_resources_dir
    from tit.atlas.manifest import mni_atlas_entry

    file_id = ATLASES[key][1]
    entry = mni_atlas_entry(file_id)
    if entry is None:
        raise FileNotFoundError(f"{file_id} is not in {mni_resources_dir()}")
    return entry["path"]