Importing OpenfMRI data in PyMVPA

I am just confused how to import data from OpenFMRI in order to process it in the libraries.
A python library named PyMVPA has a function OpenFMRIDataset
Handler for datasets following the layout specifications
but I am not able to define the handle it says to use.

Ahoi hoi @shreya_kapoor,

not sure if I get your question completely, hence just some pointers:

              import mvpa2 # import PyMVPA
              # import OpenfMRI dataset handler
              from mvpa2.datasets.sources import OpenFMRIDataset
              dataset = OpenFMRIDataset('path/to/the/dataset') # create OpenfMRI dataset handler

As OpenfMRI datasets follow the BIDS format (more information wrt BIDS e.g. here) you could also check out other tools like the great pybids python package.

HTH, best, Peer


I guess the main problem is that our PyMVPA OpenFMRIDataset helpers were developed for “classical” openfmri layout, before it was generalized into BIDS, which is the layout in which all current openfmri/openneuro datasets are distributed in.
If you are looking for working with some particular openfmri dataset which has legacy of being available in “classical” openfmri layout, then you could obtain it and PyMVPA should work. Otherwise – we did not yet come up with BIDSDataset heler but as @PeerHerholz pointed out, pybids could probably give you 90% of needed functionality to establish those. Also PRs implementing that in PyMVPA would be very welcomed.

1 Like

Oh damn, I didn’t think about the pre-BIDS-world. Sorry big time for my misleading answer.
Implementing the BIDSDataset helper into PyMVPA would be a nice straightforward project for the upcoming Brainhack Global, eh?


The data I want to wok on is ds000113 on openfmri and it is huge. I want to work with one task from all 32 subjects. I dont know how the part of the data can be downloaded and called into Pymvpa

re “work with data for one task”:

datalad install ///openfmri/ds000113; 
cd ds000113
datalad get BOLD/task001*

would get you data only for the first task

Thanks, I will try and see to it.