Atlas utilities¶
Includes function to obtain information on standard atlases, coordinates, etc.
- sekupy.utils.atlas.find_roi_center(img, roi_value)[source]¶
This function gives the x,y,z coordinates of a particular ROI using the given segmented image and the image level value used to select the ROI.
- sekupy.utils.atlas.get_aal_coords(fname)[source]¶
Function used to obtain coordinates of the ROIs contained in the AAL90 atlas. The atlas used is the 2mm nifti version of the atlas.
- Parameters:
fname (string) – The path of the atlas to be used.
- Returns:
coords – The array containing n xyz coordinates in MNI space, one for each unique value of the atlas
- Return type:
n x 3 numpy array
- sekupy.utils.atlas.get_atlas90_info(background='black')[source]¶
Utility function used to load informations about the atlas used
- Parameters:
background (string | {'black', 'white'}) – A string used to build colors for plots.
- Returns:
names (list of string) – The list of ROI names.
colors (list of string) – The list of colors used in other functions
index_ (list of int) – How node values should be ordered if the atlas has another order (used to separate left/right in the atlas90)
coords (list of tuple (x,y,z)) – Coordinates of the ROI center (used in plot_connectomics)
networks (list of string) – The list of network names.
- sekupy.utils.atlas.get_atlas_info(atlas_name='findlab')[source]¶
This function is used to obtain information on different atlases.
- Parameters:
atlas_name (str, optional ('findlab', 'aal_meg', 'atlas90')) – atlas name to get information
- Returns:
labels : names of nodes (n_nodes, string array) colors : colors of each node representing some classification node_idx : order of nodes for plot purposes coords : MNI coordinates of nodes networks : name of networks the node belongs to node_angles : angles for circular plot
- Return type:
List of informations of the atlas
- sekupy.utils.atlas.get_findlab_coords()[source]¶
Function used to obtain coordinates of the networks contained in the findlab atlas. The atlas used is the 2mm nifti version of the atlas.
- Returns:
coords – The array containing n xyz coordinates in MNI space, one for each unique value of the atlas
- Return type:
n x 3 numpy array
- sekupy.utils.atlas.where_am_i(fname)[source]¶
This function is used to find the ROI name in a mask file using AFNI whereami.
- Parameters:
fname (string,) – The complete filename of the mask.
- Returns:
table – The list has a lenght equal to the number of ROIs contained in the file Elements of the list: (x, y, z): coordinates of ROI’s center of mass. label: name of the brain area closest to the center of mass num: number of voxels included in the ROI value: value of the ROI in the input file
- Return type: