treder / MVPA-Light

Matlab toolbox for classification and regression of multi-dimensional data
MIT License
70 stars 35 forks source link

fmri Data example code from paper #29

Closed geowk closed 2 years ago

geowk commented 2 years ago

Hello,

I tried running the searchlight code with the Haxby dataset using MVPA-Light-Paper code:

https://github.com/treder/MVPA-Light-Paper/blob/master/analysis/classify_Haxby_fMRI.m

When I try to run the *.m file, I get the following error:

` Error using mv_classify (line 218) If any neighbourhood matrix is given, you must specify a matrix for every search dimension

Error in edit_classify_Haxby_fMRI (line 218) [acc_searchlight{n}, res_searchlight{n}] = mv_classify(cfg, face_house_bold{n}, clabel_face_house{n}); `

Not exactly sure what is causing this error. I think it might have something to do with the neighboring assignment. If I run the dataset using the cfg = [] and defaults, then the classification runs.

I wanted to at least try this example and relate that with our current data set. Our current data consists of contrast-maps, size 91x109x91. We want to use searchlight to potentially classify two different groups. n=20 for each group. We'd like obtain a whole-brain searchlight map (with size 91x109x91) containing the accuracy metric within each voxel. Then we'd use permutation tests to get significant p-values.

Any feedback would greatly be appreciated.

Thank you.

g.

treder commented 2 years ago

Hi G., the code was written when a previous version of MVPA Light was around, so I assume this was a compatibility issue. I've now updated the code. Can you please git pull both the MVPA-Light and MVPA-Light-Paper repos and let me know if the problem persists?

geowk commented 2 years ago

Thanks, treder. This is awesome. I downloaded the most recent version of MVPA light and used the updated paper code for a fmri dataset. The problem no longer persists and I can run searchlight successfully.

One additional question about neighbouring? How would I set up the neighbouring matrix if I wanted use a cube around each center voxel instead of adjacent voxels to the center voxel? For example, we'd like to use width of 3 x 3 x 3 voxels which would equate to 27 neighbouring voxels total (including the center voxel) for each voxel in the searchlight.

Thanks again.

g.

treder commented 2 years ago

The default is a cube. E.g. if you use 3 voxels along each x/y/z dimension, your feature space is 3x3x3=27, corresponding to a cube around the center.

geowk commented 2 years ago

Great. Thanks, treder.

I'll official close this issue now. Thanks again.

g.