Centre-IRM-INT / GT-MVPA-nilearn

GT MVPA nilearn from Marseille
3 stars 3 forks source link

SearchLight (nilearn) : voxel resolution and matrix size #16

Open simon-more opened 3 years ago

simon-more commented 3 years ago

Hi all, (sorry for my poor english, french below)

For the Bigraphe project We are using nilearn.decoding.SearchLight

we tried with data pre-processed with SPM and same data pre-processed with fMRIprep.

With data from fMRIprep, output file voxel resolution and matrix size have been changed to the resolution and size of the mask ( res 1x1x1, size 192x256x256)

With data from SPM the output doesn't change size or resolution.

Why searchlight doesn't do the same steps according to pre-proccessing ?

Thanks,

Simon

-----FRENCH------

dans le cadre du projet bigraphe on utilise nilearn.decoding.SearchLight. Probleme, on a une difference de traitement selon si les données ont été pré-traitées par SPM ou fMRIprep. Pour les fichiers prétraités par fMRIprep, en sortie du searchlight, la taille des matrices et la resolution des voxel est calée sur celles du masque. En revanche, Pour les fichiers prétraités par SPM, en sortie, la taille et resolution sont les meme que le fichier en entrée. D'où peut venir ces differences?

Merci, Simon

JeanLucAnton commented 3 years ago

Hi, As said by email, it seems that nilearn relies on the mask used during the GLM analysis in terms of spatial referential and spatial resolution. It is therefore important that the mask in question is of course in the same space but also at the same resolution as the functional data considered. It would therefore be sufficient a priori to modify the GLM analysis masks for everything to be in order. Please keep us informed of the progress of these treatments. Jean-Luc

eliefabiani commented 3 years ago

Hi, Update on this issue. Indeed, during the GLM, the mask resolution has to be at the same resolution that the bold images. Moreover, during the searchlight analysis, the mask has to be also at the same resolution as the beta images coming out from the GLM. When we tried to run the searchlight within the wrong mask (resolution of the T1 111 instead of resolution of the bold images 2.52.52.5) the searchlight took 10 time longer than when we ran the searchlight within the good resolution mask. When we compare for one subject the results of the searchlight within the good and bad resolution mask, it seems that the value of decoding doesn’t change much.

SylvainTakerkart commented 3 years ago

Hi!

Sorry I had not replied earlier... If I remember right, in nilearn, the mask and images do NOT need to be at the same resultion... If one and the others are not at the same resolution, an internal resampling is performed to put everything at the same resolution internally (without us realizing it's happening, except when we get the final output which is at this post-resampling resolution). This is consistent with what you describe: if internally, the data is at a high resolution (i.e probably at the resolution of the T1, whether it's a template or the native one), there are looooooooots more voxels and it therefore takes muuuuuuuch longer...

Next is the question: would it be worth putting the data at the resolution of the anat? (i.e would we gain something by computing much longer?) Well, no, you will never gain any finer-scale resolution because your functional data is at a low resolution...

So conclusion: I agree, the best option is to have a mask that is at the same resolution as the functional data (because i) you save compute time and ii) you don't loose any information)