Skip to content

Commit

Permalink
Adding the methods to parcelate the cerebellum using the SUIT atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasser Alemán Gómez committed Nov 6, 2024
1 parent 0630c3c commit 34a2f88
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 36 deletions.
16 changes: 8 additions & 8 deletions chimera/chimera.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def __init__(self, parc_code,
else:
self.suprafolder = os.path.join(chim_dir, 'config', 'supraregions')

self.parc_dict, self.supra_dict = _load_parcellations_info(parc_json=parc_dict_file, supra_folder=supra_folder)
self.parc_dict, self.supra_dict = load_parcellations_info(parc_json=parc_dict_file, supra_folder=supra_folder)

#### Filtering the parcellation dictionary according to the parcellation code ####
supra_names = list(self.parc_dict.keys())
Expand Down Expand Up @@ -969,7 +969,7 @@ def build_parcellation(self, t1:str, bids_dir:str,
aseg_parc.adjust_values()

# Creating the parcellation for the extra regions
extra_parc = _create_extra_regions_parc(aparc=nii_image)
extra_parc = create_extra_regions_parc(aparc=nii_image)

# Remove the nifti file
os.remove(nii_image)
Expand Down Expand Up @@ -1736,7 +1736,7 @@ def build_parcellation(self, t1:str, bids_dir:str,
del chim_parc

# Loading the JSON file containing the available parcellations
def pipeline_info(pipe_json:str=None):
def _pipeline_info(pipe_json:str=None):
"""
Load the JSON file containing the pipeline configuration.
Expand Down Expand Up @@ -1766,7 +1766,7 @@ def pipeline_info(pipe_json:str=None):

return pipe_dict

def set_templateflow_home(tflow_home: str='local'):
def _set_templateflow_home(tflow_home: str='local'):
"""
Setting up the templateflow home directory.
Expand Down Expand Up @@ -1805,7 +1805,7 @@ def set_templateflow_home(tflow_home: str='local'):

return updated_tflow_home

def mix_side_prop(st_dict: dict, boolsort: bool = True):
def _mix_side_prop(st_dict: dict, boolsort: bool = True):
"""
Method to mix all the properties for a specific supra-region and a specific method.
Expand Down Expand Up @@ -2040,7 +2040,7 @@ def create_extra_regions_parc(aparc:str, offset:int=5000):
return rh_tmp_parc


def build_args_parser():
def _build_args_parser():

formatter = lambda prog: argparse.HelpFormatter(prog, max_help_position=52)

Expand Down Expand Up @@ -2253,7 +2253,7 @@ def build_args_parser():


parcodes = args.parcodes[0].split(sep=',')
parc_dict, supra_dict = _load_parcellations_info()
parc_dict, supra_dict = load_parcellations_info()
supra_reg_names = list(parc_dict.keys())
n_supra = len(supra_reg_names)

Expand Down Expand Up @@ -2339,7 +2339,7 @@ def print_availab_parcels(reg_name=None):
"""

data, supra_dict = _load_parcellations_info()
data, supra_dict = load_parcellations_info()

if reg_name is None:
supra_keys = data.keys()
Expand Down
62 changes: 34 additions & 28 deletions chimera/config/supraregions/Cerebellum.tsv
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
supraregion method hemi index name color
Cerebellum F lh 8 cer-lh-cerebellum #e69422
Cerebellum F rh 47 cer-rh-cerebellum #e69422
Cerebellum R lh 1 cer-lh-i_iv #049494
Cerebellum R rh 2 cer-rh-i_iv #049494
Cerebellum R lh 3 cer-lh-v #fabe77
Cerebellum R rh 4 cer-rh-v #fabe77
Cerebellum R lh 5 cer-lh-vi #a018ce
Cerebellum R mid 6 cer-mid-vermis_vi #ff5733
Cerebellum R rh 7 cer-rh-vi #a018ce
Cerebellum R lh 8 cer-lh-crus_i #34a853
Cerebellum R mid 9 cer-mid-vermis_crus_i #33ff57
Cerebellum R rh 10 cer-rh-crus_i #34a853
Cerebellum R lh 11 cer-lh-crus_ii #dfe6fc
Cerebellum R mid 12 cer-mid-vermis_crus_ii #5733ff
Cerebellum R rh 13 cer-rh-crus_ii #dfe6fc
Cerebellum R lh 14 cer-lh-viib #16394f
Cerebellum R mid 15 cer-mid-vermis_viib #a3e635
Cerebellum R rh 16 cer-rh-viib #16394f
Cerebellum R lh 17 cer-lh-viiia #c3f7e4
Cerebellum R mid 18 cer-mid-vermis_viiia #a1ff33
Cerebellum R rh 19 cer-rh-viiia #c3f7e4
Cerebellum R lh 20 cer-lh-viiib #ffd9b3
Cerebellum R mid 21 cer-mid-vermis_viiia #ffa533
Cerebellum R rh 22 cer-rh-viiib #ffd9b3
Cerebellum R lh 23 cer-lh-ix #ff33a1
Cerebellum R mid 24 cer-mid-vermis_ix #a3e635
Cerebellum R rh 25 cer-rh-ix #ff33a1
Cerebellum R lh 26 cer-lh-x #ffbe0b
Cerebellum R mid 27 cer-mid-vermis_x #9a031e
Cerebellum R rh 28 cer-rh-x #ffbe0b
Cerebellum S lh 1 cer-lh-i_iv #049494
Cerebellum S rh 2 cer-rh-i_iv #049494
Cerebellum S lh 3 cer-lh-v #fabe77
Cerebellum S rh 4 cer-rh-v #fabe77
Cerebellum S lh 5 cer-lh-vi #a018ce
Cerebellum S mid 6 cer-mid-vermis_vi #ff5733
Cerebellum S rh 7 cer-rh-vi #a018ce
Cerebellum S lh 8 cer-lh-crus_i #34a853
Cerebellum S mid 9 cer-mid-vermis_crus_i #33ff57
Cerebellum S rh 10 cer-rh-crus_i #34a853
Cerebellum S lh 11 cer-lh-crus_ii #dfe6fc
Cerebellum S mid 12 cer-mid-vermis_crus_ii #5733ff
Cerebellum S rh 13 cer-rh-crus_ii #dfe6fc
Cerebellum S lh 14 cer-lh-viib #16394f
Cerebellum S mid 15 cer-mid-vermis_viib #a3e635
Cerebellum S rh 16 cer-rh-viib #16394f
Cerebellum S lh 17 cer-lh-viiia #c3f7e4
Cerebellum S mid 18 cer-mid-vermis_viiia #a1ff33
Cerebellum S rh 19 cer-rh-viiia #c3f7e4
Cerebellum S lh 20 cer-lh-viiib #ffd9b3
Cerebellum S mid 21 cer-mid-vermis_viiia #ffa533
Cerebellum S rh 22 cer-rh-viiib #ffd9b3
Cerebellum S lh 23 cer-lh-ix #ff33a1
Cerebellum S mid 24 cer-mid-vermis_ix #a3e635
Cerebellum S rh 25 cer-rh-ix #ff33a1
Cerebellum S lh 26 cer-lh-x #ffbe0b
Cerebellum S mid 27 cer-mid-vermis_x #9a031e
Cerebellum S rh 28 cer-rh-x #ffbe0b
Cerebellum S lh 29 cer-lh-dentate #4c4c4c
Cerebellum S rh 30 cer-rh-dentate #4c4c4c
Cerebellum S lh 31 cer-lh-interposed #7f7f7f
Cerebellum S rh 32 cer-rh-interposed #7f7f7f
Cerebellum S lh 33 cer-lh-fastigial #b2b2b2
Cerebellum S rh 34 cer-rh-fastigial #b2b2b2

0 comments on commit 34a2f88

Please sign in to comment.