8.2.1. Parcellations#
Provide functions for parcellation.
- junifer.data.parcellations.list_parcellations()#
List all the available parcellations.
- junifer.data.parcellations.load_parcellation(name, parcellations_dir=None, resolution=None, path_only=False)#
Load a brain parcellation (including a label file).
If it is a built-in parcellaions and file is not present in the parcellations_dir directory, it will be downloaded.
- Parameters:
- name
str
The name of the parcellation. Check valid options by calling
junifer.data.parcellations.list_parcellations()
.- parcellations_dir
str
orpathlib.Path
, optional Path where the parcellations files are stored. The default location is “$HOME/junifer/data/parcellations” (default None).
- resolution
float
, optional The desired resolution of the parcellation to load. If it is not available, the closest resolution will be loaded. Preferably, use a resolution higher than the desired one. By default, will load the highest one (default None).
- path_onlybool, optional
If True, the parcellation image will not be loaded (default False).
- name
- Returns:
Nifti1Image
orNone
Loaded parcellation image.
list
ofstr
Parcellation labels.
pathlib.Path
File path to the parcellation image.
- junifer.data.parcellations.register_parcellation(name, parcellation_path, parcels_labels, overwrite=False)#
Register a custom user parcellation.
- Parameters:
- name
str
The name of the parcellation.
- parcellation_path
str
orpathlib.Path
The path to the parcellation file.
- parcels_labels
list
ofstr
The list of labels for the parcellation.
- overwritebool, optional
If True, overwrite an existing parcellation with the same name. Does not apply to built-in parcellations (default False).
- name
- Raises:
ValueError
If the parcellation name is already registered and overwrite is set to False or if the parcellation name is a built-in parcellation.
8.2.2. Coordinates#
Provide functions for list of coordinates.
- junifer.data.coordinates.list_coordinates()#
List all the available coordinates lists (VOIs).
- junifer.data.coordinates.load_coordinates(name)#
Load coordinates.
- Parameters:
- name
str
The name of the coordinates.
- name
- Returns:
numpy.ndarray
The coordinates.
list
ofstr
The names of the VOIs.
- junifer.data.coordinates.register_coordinates(name, coordinates, voi_names, overwrite=False)#
Register coordinates.
- Parameters:
- name
str
The name of the coordinates.
- coordinates
numpy.ndarray
The coordinates.
- voi_names
list
ofstr
The names of the VOIs.
- overwritebool, optional
If True, overwrite an existing list of coordinates with the same name. Does not apply to built-in coordinates (default False).
- name
8.2.3. Masks#
Provide functions for masks.
- junifer.data.masks.list_masks()#
List all the available masks.
- junifer.data.masks.load_mask(name, resolution=None, path_only=False)#
Load mask.
- Parameters:
- name
str
The name of the mask.
- resolution
float
, optional The desired resolution of the mask to load. If it is not available, the closest resolution will be loaded. Preferably, use a resolution higher than the desired one. By default, will load the highest one (default None).
- path_onlybool, optional
If True, the mask image will not be loaded (default False).
- name
- Returns:
Nifti1Image
orNone
Loaded mask image.
pathlib.Path
File path to the mask image.
- junifer.data.masks.register_mask(name, mask_path, overwrite=False)#
Register a custom user mask.
- Parameters:
- name
str
The name of the mask.
- mask_path
str
orpathlib.Path
The path to the mask file.
- overwritebool, optional
If True, overwrite an existing mask with the same name. Does not apply to built-in mask (default False).
- name
- Raises:
ValueError
If the mask name is already registered and overwrite is set to False or if the mask name is a built-in mask.