[pymvpa] Update on Searchlight/MVPA

J la.foma at gmail.com
Wed Feb 24 19:37:49 UTC 2010


Hello,
I fixed the bugs and ran searchlight on my fMRI data in pyMVPA (python2.6,
mac os leopard), however when i attempt to create map2nifti file, it gives
me the following error:

In [31]: dataset.map2Nifti(s1_map).save('searchlight_5mm.nii.gz')
*** ERROR (nifti_image_write_hdr_img2): cannot open output file
'searchlight_5mm.nii.gz'*

I am not sure why that is so.

My code is as follows:
from mvpa.suite import *
import os
from matplotlib.pyplot import figure, show
from mvpa.misc.io.base import SampleAttributes
from mvpa.datasets.nifti import NiftiDataset

if __debug__:
    debug.active += ["SLC"]

attr = SampleAttributes(os.path.join(pymvpa_dataroot,
'attributes_test.txt'))
dataset = NiftiDataset(samples=os.path.join(pymvpa_dataroot,
'time_series_original_run_all.nii.gz'),
                       labels=attr.labels,
                       chunks=attr.chunks,
                       mask=os.path.join(pymvpa_dataroot,
'anatomy_mask.nii.gz'))
detrend(dataset, perchunk=True, model='linear')
zscore(dataset, perchunk=True, baselinelabels=[1], targetdtype='float32')

# choose classifier
clf = LinearCSVMC()

# setup measure to be computed by Searchlight
# cross-validated mean transfer using an Odd-Even dataset splitter
cv = CrossValidatedTransferError(TransferError(clf),
                                 OddEvenSplitter())
s1 = Searchlight(cv, radius=5)
s1_map = s1(dataset)
dataset.map2Nifti(s1_map).save('searchlight_5mm.nii.gz')

--

Thanks in advance for your input.

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20100224/e7b456a3/attachment.htm>


More information about the Pkg-ExpPsy-PyMVPA mailing list