Hello Valentin,<br><br>Thanks for the reply.<br><br>I'm including the requested info:<br>PyMVPA 0.4.3 on Fedora 10 x86_64.<br><br>Here is the relevant part of the script:<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
blockavged_dataset = NiftiDataset(samples=niftiFile,<br> labels=attrs.labels, chunks=attrs.chunks, labels_map={'cat1': 0, 'cat2': 1, 'cat3': 2, 'cat4': 3, 'cat5': 4},<br>
mask=maskFile)<br><br> # remove first category from dataset<br> blockavged_dataset = blockavged_dataset.selectSamples(N.array([l != 0 for l in blockavged_dataset.labels],<br> dtype='bool'))<br>
<br> """Create a dissimilarity matrix based on the labels of the data points<br> in our test dataset. This will allow us to see if there is a correlation<br> between any given searchlight sphere and the experimental conditions."""<br>
<br> # create dissimilarity matrix using the 'confusion' distance<br> # metric<br> dsm = DSMatrix(blockavged_dataset.labels, 'confusion') </blockquote><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
#<br> # Run Searchlight<br> #<br><br> # choose classifier<br> dsmetric = DSMDatasetMeasure(dsm, 'pearson', 'pearson')<br><br> for radius in [6.4,9.6]:<br><br> # tell which one we are doing<br>
print "Running searchlight with radius: %.2fmm..." % (radius)<br><br> # setup Searchlight with a custom radius<br> # radius has to be in the same unit as the nifti file's pixdim<br> # property.<br>
sl = Searchlight(dsmetric, radius=radius)<br><br> # run searchlight on example dataset and retrieve error map<br> sl_map = sl(blockavged_dataset)<br></blockquote><br><br>Thank you,<br>Michael<br><br>
<br><div class="gmail_quote">On Sun, Dec 13, 2009 at 3:43 PM, Valentin Haenel <span dir="ltr"><<a href="mailto:valentin.haenel@gmx.de" target="_blank">valentin.haenel@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Dear Micheal,<br>
<br>
could you please post pymvpa version, operating system, and the script you are<br>
using (if possible).<br>
<br>
The sphere size might not be the issue, since the searchlight will have less<br>
features at the edges of the brain, but its hard to tell from the error<br>
message alone.<br>
<br>
thanks.<br>
<br>
V-<br>
<br>
* Michael W. Cole <<a href="mailto:mwcole@gmail.com" target="_blank">mwcole@gmail.com</a>> [091213]:<br>
<div><div></div><div>> I am trying to run a searchlight analysis based on the searchlight_dsm.py<br>
> example. I'm doing a 4-way classification with 2-voxel radius spheres.<br>
><br>
> It will run for a few spheres, then crash with this error:<br>
><br>
> Traceback (most recent call last):<br>
> File "<stdin>", line 1, in <module><br>
> File "pymvpa_script1.py", line 154, in <module><br>
> sl_map = sl(blockavged_dataset)<br>
> File "/usr/lib64/python2.5/site-packages/mvpa/measures/base.py", line 105,<br>
> in __call__<br>
> result = self._call(dataset)<br>
> File "/usr/lib64/python2.5/site-packages/mvpa/measures/searchlight.py",<br>
> line 108, in _call<br>
> measure = self.__datameasure(sphere)<br>
> File "/usr/lib64/python2.5/site-packages/mvpa/measures/ds.py", line 47, in<br>
> __call__<br>
> test_mat = N.asarray([in_vec, dset_vec])<br>
> File "/usr/lib64/python2.5/site-packages/numpy/core/numeric.py", line 230,<br>
> in asarray<br>
> return array(a, dtype, copy=False, order=order)<br>
> ValueError: setting an array element with a sequence.<br>
><br>
> I've found that the spheres that work have 1830 values each in in_vec and<br>
> dset_vec, but the sphere it crashes on only has 1540 values. I'm not sure if<br>
> this is related to the crash or not.<br>
><br>
> Any ideas on how to get around this error?<br>
><br>
> Thanks in advance!<br>
><br>
> Michael<br>
><br>
><br>
> --<br>
> Michael W. Cole, Ph.D.<br>
> Post-doctoral researcher<br>
> Cognitive Control & Psychopathology Lab<br>
> Washington University in St. Louis<br>
<br>
</div></div><div><div></div><div>> _______________________________________________<br>
> Pkg-ExpPsy-PyMVPA mailing list<br>
> <a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org" target="_blank">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
> <a href="http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
<br>
<br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org" target="_blank">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Michael W. Cole, Ph.D.<br>Post-doctoral researcher<br>Cognitive Control & Psychopathology Lab<br>Washington University in St. Louis<br>