unravel.cluster_stats.sunburst module#
Use cstats_sunburst
(sunburst
) from UNRAVEL to generate a sunburst plot of regional volumes across all levels of the ABA hierarchy.
- Prereqs:
cstats_summary
generates a valid rev_cluster_index.nii.gz (clusters of significant voxels) viacstats_index
.
- Inputs:
path/rev_cluster_index.nii.gz (e.g., with valid clusters), path/labeled_image.nii.gz, or path/binary_image.nii.gz
path/atlas.nii.gz (Default: atlas/atlas_CCFv3_2020_30um.nii.gz) for applying region IDs to the input image
- Outputs:
path/input_sunburst.csv and [input_path/sunburst_RGBs.csv]
Note
Default sunburst csv location: UNRAVEL/unravel/core/csvs/sunburst_IDPath_Abbrv.csv
Region info csv: CCFv3-2020_info.csv (or use CCFv3-2017_info.csv or provide a custom CSV with the same columns)
- Next steps:
Use input_sunburst.csv to make a sunburst plot or regional volumes in Flourish Studio (https://app.flourish.studio/)
It can be pasted into the Data tab (categories columns = Depth_`*` columns, Size by = Volumes column)
Preview tab: Hierarchy -> Depth to 10, Colors -> paste RGB codes from sunburst_RGBs.csv into Custom overrides
Usage:#
cstats_sunburst -i path/rev_cluster_index.nii.gz [-a atlas/atlas_CCFv3_2020_30um.nii.gz] [-rgb] [-scsv sunburst_IDPath_Abbrv.csv] [-icsv CCFv3-2020_info.csv] [-v]
- unravel.cluster_stats.sunburst.calculate_regional_volumes(img, atlas, atlas_res_in_um)[source]#
Calculate the volumes of labeled regions in the input image.
- Parameters:
img (-) – the input image ndarray.
atlas (-) – the atlas ndarray.
atlas_res_in_um (-) – the atlas resolution in in microns.
- Returns:
a dictionary of region volumes (key = region ID, value = volume in mm^3)
- Return type:
volumes_dict (dict)
- unravel.cluster_stats.sunburst.sunburst(img, atlas, atlas_res_in_um, output_path, sunburst_csv_path='sunburst_IDPath_Abbrv.csv', info_csv_path='CCFv3-2020_info.csv', output_rgb_lut=False)[source]#
Generate a sunburst plot of regional volumes that cluster comprise across the ABA hierarchy.
- Parameters:
img (-) –
atlas (-) –
atlas_res_in_um (-) – the atlas resolution in microns. For example, (25, 25, 25)
output_rgb_lut (-) – flag to output the RGB values for each abbreviation to a CSV file
- Outputs:
CSV file containing the regional volumes for the sunburst plot (input_sunburst.csv)