Extracting aseg atlas timeseries data using fMRIprep + nilearn

Hi there, I would like to extract timeseries ROI data using the freesurfer aseg atlas from fMRIprep preprocessed data.

There isn’t a function to fetch the aseg atlas in nilearn. So i will have to load the aseg.mgz file from the fsaverage folder? or is there an easier way to do this?

Hi @gerardyu - do you already have the outputs of fMRIPrep that you plan to analyze? It may be the case that the solution is even simpler than needing to fetch an atlas; depending on the version and run configuration, fMRIPrep resamples aseg atlas into the participant’s space (see here)

To add on, using the fMRIPrep aseg atlas @psadil mentioned, you would use nilearn.maskers.NiftiLabelsMasker - Nilearn to create a masker based on that atlas, and then fit_transform it on your BOLD image.

i’m guessing that i should be using the *aseg_dseg.nii.gz file (located in the subject’s func folder) for the masker?

i did that, applied fit.transform and i got a timepoints x 42 numpy array. Which is somewhat strange. The *aseg_dseg.nii.gz file contains 87 intensity values (range: 1 to 254), and among them only 24 of such intensity values have at least 1 voxel

shouldnt it be a timepoint x 24 array instead?