-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""Functions for generating boilerplate text.""" | ||
|
||
|
||
def describe_atlases(atlases): | ||
"""Build a text description of the atlases that will be used.""" | ||
from smripost_linc.utils.utils import list_to_str | ||
|
||
atlas_descriptions = { | ||
'Glasser': 'the Glasser atlas [@Glasser_2016]', | ||
'Gordon': 'the Gordon atlas [@Gordon_2014]', | ||
'Tian': 'the Tian subcortical atlas [@tian2020topographic]', | ||
'HCP': 'the HCP CIFTI subcortical atlas [@glasser2013minimal]', | ||
'MIDB': ( | ||
'the MIDB precision brain atlas derived from ABCD data and thresholded at 75% ' | ||
'probability [@hermosillo2022precision]' | ||
), | ||
'MyersLabonte': ( | ||
'the Myers-Labonte infant atlas thresholded at 50% probability [@myers2023functional]' | ||
), | ||
} | ||
|
||
atlas_strings = [] | ||
described_atlases = [] | ||
atlases_4s = [atlas for atlas in atlases if str(atlas).startswith('4S')] | ||
described_atlases += atlases_4s | ||
if atlases_4s: | ||
parcels = [int(str(atlas[2:-7])) for atlas in atlases_4s] | ||
s = ( | ||
'the Schaefer Supplemented with Subcortical Structures (4S) atlas ' | ||
'[@Schaefer_2017;@pauli2018high;@king2019functional;@najdenovska2018vivo;' | ||
'@glasser2013minimal] ' | ||
f'at {len(atlases_4s)} different resolutions ({list_to_str(parcels)} parcels)' | ||
) | ||
atlas_strings.append(s) | ||
|
||
for k, v in atlas_descriptions.items(): | ||
if k in atlases: | ||
atlas_strings.append(v) | ||
described_atlases.append(k) | ||
|
||
undescribed_atlases = [atlas for atlas in atlases if atlas not in described_atlases] | ||
for atlas in undescribed_atlases: | ||
atlas_strings.append(f'the {atlas} atlas') | ||
|
||
return list_to_str(atlas_strings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters