[pymvpa] Mapping event structure from text file to fMRI dataset
Yaroslav O Halchenko
yoh at onerussian.com
Fri Aug 16 15:26:09 BST 2019
On Thu, 15 Aug 2019, Lyam Bailey wrote:
> Dear users
> I have an fMRI dataset comprising 113 volumes (from a single run). I would
> like to map information about events during the fMRI run - experimental
> condition and onset time - to the dataset. The events structure is stored
> in a .txt file with four columns: run#, experimental condition, unique
> stimulus, and onset time. It looks something like this
> 0 Y porch 12.030224
> 0 Y victory 15.530834
> 0 P kingdom 19.031396
> 0 Y evening 22.531978
> I've tried to map this info to the fMRI dataset in the following way:
> bold_fname = 'path_to_fMRI_dataset'
> exp_data = pd.read_csv("path_to_txt", delimiter='\t', header = None)
> exp_data.columns = ['run','condition','word','onset']
> ds = fmri_dataset(bold_fname, targets = None)
> ds.sa.time_coords = exp_data.onset
> ds.sa.targets = exp_data.condition
so you have an event related design. The most straightforward approach
would be first to fit GLM to your conditions.
Have a look at http://www.pymvpa.org/tutorial_eventrelated.html
--
Yaroslav O. Halchenko
Center for Open Neuroscience http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419
WWW: http://www.linkedin.com/in/yarik
More information about the Pkg-ExpPsy-PyMVPA
mailing list