aslprep.utils.atlas module

Functions for working with atlases.

collect_atlases(datasets, atlases, bids_filters=None)[source]

Collect atlases from a list of BIDS-Atlas datasets.

Selection of labels files and metadata does not leverage the inheritance principle. That probably won’t be possible until PyBIDS supports the BIDS-Atlas extension natively.

Parameters:
  • datasets (dict of str:str or str:BIDSLayout pairs) – Dictionary of BIDS datasets to search for atlases.

  • atlases (list of str) – List of atlases to collect from across the datasets.

  • bids_filters (dict) – Additional filters to apply to the BIDS query. Only the “atlas” key is used.

Returns:

atlas_cache – Dictionary of atlases with metadata. Keys are the atlas names, values are dictionaries with keys:

  • ”dataset”str

    Name of the dataset containing the atlas.

  • ”dataset_path”str

    Path to the dataset containing the atlas.

  • ”image”str

    Path to the atlas image.

  • ”labels”str

    Path to the atlas labels file.

  • ”metadata”dict

    Metadata associated with the atlas.

Return type:

dict

select_atlases(atlases, subset)[source]

Get a list of atlases to be used for parcellation and functional connectivity analyses.

The actual list of files for the atlases is loaded from a different function.

NOTE: This is a Node function.

Parameters:
  • atlases (None or list of str)

  • subset ({“all”, “subcortical”, “cortical”}) – Description of the subset of atlases to collect.

Returns:

List of atlases.

Return type:

list of str