You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the output of print(masker.region_names_) in the following code must be {0: 'Frontal Pole', 1: 'Insular Cortex', 2: 'Inferior Frontal Gyrus, pars triangularis'}, because the region id 5 corresponds to region name "Inferior Frontal Gyrus, pars triangularis" based on the output of print(initial_region_id_names).
The issue with region names was addressed in #4289 (this was mostly due to non-standard atlas outputs.), but it seems the issue is a bit more complicated.
Current behavior & error messages
This is what I got instead:
# Paste the error message here
{0: 'Frontal Pole', 1: 'Insular Cortex', 2: 'Superior Frontal Gyrus'}
Steps and code to reproduce bug
# Paste your code hereimportnumpyasnpfromnilearn.regions.tests.test_signal_extractionimportget_datafromnilearnimportdatasetsfromnilearn.maskersimportNiftiLabelsMaskerfromnibabelimportNifti1Image# func datadataset=datasets.fetch_development_fmri(n_subjects=1)
func_filename=dataset.func[0]
# atlas dataatlas=datasets.fetch_atlas_harvard_oxford('cort-maxprob-thr25-2mm')
# create a mask with 3 regionslabels_data=get_data(atlas.maps)
mask_data= (labels_data==1) + (labels_data==2) + (labels_data==5)
mask_img=Nifti1Image(mask_data.astype(np.int8), atlas.maps.affine)
# Instantiate the masker with label image and label valuesmasker=NiftiLabelsMasker(atlas.maps,
labels=atlas.labels,
mask_img=mask_img,
standardize=True,
keep_masked_labels=False
)
# fit and transform the masker_=masker.fit_transform(func_filename)
# get the region ids and names before and after maskinginitial_region_ids=np.unique(labels_data)
initial_region_id_names= {region_id: atlas.labels[i] fori, region_idinenumerate(initial_region_ids)}
print(initial_region_id_names)
region_ids_after_masking=masker.region_ids_region_names_after_masking=masker.region_names_print(masker.region_ids_)
print(masker.region_names_)
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Operating system
Operating system version
Mac OS Version 13.4 Ventura
Python version
nilearn version
0.10.3
Expected behavior
the output of
print(masker.region_names_)
in the following code must be{0: 'Frontal Pole', 1: 'Insular Cortex', 2: 'Inferior Frontal Gyrus, pars triangularis'}
, because the region id 5 corresponds to region name "Inferior Frontal Gyrus, pars triangularis" based on the output ofprint(initial_region_id_names)
.The issue with region names was addressed in #4289 (this was mostly due to non-standard atlas outputs.), but it seems the issue is a bit more complicated.
Current behavior & error messages
This is what I got instead:
Steps and code to reproduce bug
The text was updated successfully, but these errors were encountered: