netneurolab / neuromaps

A toolbox for comparing brain maps
https://netneurolab.github.io/neuromaps
Other
250 stars 56 forks source link

To use group-level statistics for parcellated ROIs as input for neuromaps #78

Closed ella09may closed 1 year ago

ella09may commented 2 years ago

Neuromaps is such a great and easy-to-use tool, especially for researchers that are not so good at neuroimaging methodology and deep coding. I installed it and tried the scripts in the document when heard about this toolbox from the preprint paper.

Now I want to apply the 'neuromaps' to my data but get a problem. I performed the recon-all pipeline of FreeSurfer on patients and controls and extracted measures such as volumes from 68 neocortical regions and 14 subcortical regions parcellated with the D-K atlas. These regional brain volumes were further used in some machine learning and statistical testing procedures in R and Python, and I got a case-control statistic for each ROI.

My question is, could I input this region*statistic value vector in 'neuromaps' and further establish associations with brain annotations integrated in 'neuromaps'? I found that 'neuromaps' receives imaging files as input, such as Nifti or Gifiti files. I was wondering if it is possible that provide numeric vector or matrices with ROI labels of some common parcellations such as D-K atlas rather than imaging files? If this procedure is not within the scope of 'neuromaps', are there any recommended ways to transform such numeric matrices into imaging files?

Any help will be appreciated. Qiannan

justinehansen commented 2 years ago

Hi Qiannan,

I'm glad you're finding neuromaps useful to your work, and thanks for reaching out with your question! The quick answer to your question is that you could convert array to image using neuromaps.images.construct_shape_gifti(). neuromaps often expects a tuple of two hemispheres, so it is likely best to split the data into left/right hemispheres first. This function also accepts ROI label names. That said, neuromaps should generally also be able to work with arrays. For example the neuromaps.stats.compare_images() function will take niftis, giftis, or arrays. Could you let me know which function(s) you're using where you're running into this issue? And also which version of neuromaps you're using? (neuromaps.__version__)

Best, Justine