simnibs.utils.transformations.atlas2subject

simnibs.utils.transformations.atlas2subject(m2m: str | SubjectFiles, atlas: str, hemi: list[str] | str | tuple = ('lh', 'rh'), split_labels: bool = False, return_ctab: bool = False, return_names: bool = False)

Transform an atlas from fsaverage space to subject space.

Parameters:
  • m2m (str | SubjectFiles) – Output directory of a CHARM run for given subject.

  • atlas (str) – Name of the atlas to map to the subject.

  • hemi (list[str] | str | tuple, optional) – _description_, by default (“lh”, “rh”)

  • split_labels (bool, optional) –

    If true, split the array of labels into a dictionary which maps names to a mask of the vertices with the given label (default = False). For example

    names = [“region A”, “region B”, “region C”, …] label = [1, 3, 2, 1, …]

    to

    {

    “region A”: [1, 0, 0, 1, …], “region B”: [0, 0, 1, 0, …], “region C”: [0, 1, 0, 0, …]

    }

Returns:

A dictionary mapping hemisphere(s) to (1) an array of labels (when split_labels == False), or a dictionary of names to label mask (when split_labels == True).

Return type:

dict