[pymvpa] Loading multiple ROIs with fmri_dataset

Lyam Bailey Lyam.Bailey at Dal.Ca
Tue Aug 13 19:06:55 BST 2019


Dear users,


I am trying to manually load in the PyMVPA tutorial data, instead of using the load_tutorial_data convenience function (as shown here, for example: http://www.pymvpa.org/examples/rsa_fmri.html)<http://www.pymvpa.org/examples/rsa_fmri.html>. I have downloaded the tutorial data and replaced the following lines of code from the example script:

from mvpa2.datasets.sources.native import load_tutorial_data
datapath = pjoin(cfg.get('location', 'tutorial data'), 'haxby2001')
ds = load_tutorial_data(roi=(15, 16, 23, 24, 36, 38, 39, 40, 48))

with the following loop:

data_path = pjoin('haxby2001', 'sub001')
runs = [1,2]

run_datasets = []
targets = SampleAttributes(pjoin(data_path, 'BOLD','task001_run001', 'attributes.txt'))['targets']

for i in runs:
    bold_fname = pjoin(data_path, 'BOLD', 'task001_run00' + str(i), 'bold.nii.gz')
    temp_ds = fmri_dataset(bold_fname, mask=None, targets = targets, chunks = i-1)
    run_datasets.append(temp_ds)

ds = vstack(run_datasets, a=0)


The one thing I'm missing is how to load in multiple ROIs, as in ds = load_tutorial_data(roi=(15, 16, 23, 24, 36, 38, 39, 40, 48)). Is there a way to achieve this with fmri_dataset? Or is there a more appropriate alternative function to fmri_dataset?


Thanks in advance for any advice!

Lyam

---------------------------------------------------------

Lyam Bailey, B.Sc., M.Sc.

Doctoral Student

Department of Psychology & Neuroscience
Dalhousie University

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-exppsy-pymvpa/attachments/20190813/e464df50/attachment.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list