From af643e8a3562158534b6ff1eb09760d6b13a7d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasser=20Alem=C3=A1n=20G=C3=B3mez?= Date: Thu, 14 Nov 2024 14:35:16 +0100 Subject: [PATCH] Minor changes --- chimera/chimera.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chimera/chimera.py b/chimera/chimera.py index 7bfb673..0b14423 100644 --- a/chimera/chimera.py +++ b/chimera/chimera.py @@ -1217,8 +1217,10 @@ def build_parcellation(self, t1:str, bids_dir:str, out_parc_spam = os.path.join(str(work_dir), fullid + '_atlas-' + atlas_str + '_probseg.nii.gz') out_parc_maxp = os.path.join(str(work_dir), fullid + '_atlas-' + atlas_str + '_dseg.nii.gz') + out_parc_lut = out_parc_maxp.replace('.nii.gz', '.lut') + out_parc_tsv = out_parc_maxp.replace('.nii.gz', '.tsv') - if not os.path.isfile(out_parc_maxp) or force: + if not os.path.isfile(out_parc_maxp) or not os.path.isfile(out_parc_lut) or not os.path.isfile(out_parc_tsv) or force: work_dir.mkdir(parents=True, exist_ok=True) # Detecting the side @@ -1318,12 +1320,12 @@ def build_parcellation(self, t1:str, bids_dir:str, out_parc_maxp) for side_cont, side in enumerate(sides_ids): - vol_indexes = np.array(self.supra_dict[supra][supra][atlas_code][side]['index'])-1 tmp_par_file = os.path.join(work_dir, fullid + '_hemi-' + side + '_atlas-' + atlas_str + '_dseg.nii.gz') files2del.append(tmp_par_file) tmp_parc = cltparc.Parcellation(parc_file=out_parc_maxp) - tmp_parc.index = vol_indexes + 1 + tmp_parc.data = np.round(tmp_parc.data) + tmp_parc.index = np.array(self.supra_dict[supra][supra][atlas_code][side]['index']) tmp_parc.name = self.supra_dict[supra][supra][atlas_code][side]['name'] tmp_parc.color = self.supra_dict[supra][supra][atlas_code][side]['color']