CustomParcelApproach#

class neurocaps.typing.CustomParcelApproach[source]#

Bases: dict

Type Definition for the Custom Parcellation Approach.

A TypedDict representing the subkeys (second level keys for “Custom”) for the user-defined deterministic “Custom” parcellation approach. The structure is as follows:

# Lateralized regions
{
    "maps": "path/to/parcellation.nii.gz",
    "nodes": ["LH_Vis1", "LH_Vis2", "LH_Hippocampus", "RH_Vis1", "RH_Vis2", "RH_Vis3", "RH_Hippocampus"],
    "regions": {
        "Visual": CustomRegionHemispheres
        "Hippocampus": CustomRegionHemispheres
    }
}

# Non-lateralized regions
{
    "maps": "path/to/parcellation.nii.gz",
    "nodes": ["Vis1", "Vis2", "Vis3", "Hippocampus"],
    "regions": {
        "Visual": range(3)
        "Hippocampus": [3]
    }
}

# Mixture of lateralized and non-lateralized regions
{
    "maps": "path/to/parcellation.nii.gz",
    "nodes": ["Vis1", "Vis2", "Vis3", "LH_Vis2", "LH_Hippocampus"],
    "regions": {
        "Visual": range(3)
        "Hippocampus": CustomRegionHemispheres
    }
}
Parameters:
  • maps (str) – Path to the Custom parcellation.

  • nodes (list[str]) – List of nodes (ROIs) in the Custom parcellation. Ordered in ascending order of their label ID in the parcellation and must exclude “Background”.

  • regions (dict[str, list[int] | range] or dict[str, CustomRegionHemispheres]) –

    Dictionary mapping the regions to a list integers (or range) representing the index positions of elements in the “nodes” list belonging to the region or a dictionary mapping the region to a dictionary.

    Note

    The use of CustomRegionHemispheres to define lateralized regions (i.e., with “lh” and “rh” keys) is only relevant when calling CAP.caps2plot with the add_custom_node_labels kwarg set to True. This information allows for the creation of simplified axis labels that include hemisphere information. In all other methods, the lateralization structure is ignored.

    Note

    Non-lateralized “regions” is only supported in versions >= 0.30.0.

  • metadata (dict[str, Any]) – Dictionary containing metadata information about the parcellation. This key is purely informational and can be removed, modified, or extended.

See also

CustomRegionHemispheres

Type definition of the Custom hemisphere dictionary for the “regions” subkeys. (See CustomRegionHemispheres Documentation)

ParcelApproach

Type definition representing the structure of the Schaefer, AAL, and Custom parcellation approaches. (See ParcelApproach Documentation)

Note

For additional information, refer to NeuroCAPs Parcellation Documentation