[pymvpa] Help with map2nifti()

Taku Ito taku.ito1 at gmail.com
Mon Nov 4 17:41:54 UTC 2013


You're right, thank you, I was looking through the incorrect data set - My
original data set (the one I wrote to right after fmri_dataset), has the
following mappers:

In [104]: data[1].a.mapper
Out[104]: ChainMapper(nodes=[FlattenMapper(shape=(59, 69, 59),
auto_train=True, space='voxel_indices'),
StaticFeatureSelection(dshape=(240189,), slicearg=array([False, False,
False, ..., False, False, False], dtype=bool))])

However, after this data set, I constructed a sub-data set by just
selecting certain samples with the target values I wanted, splitting the
datasets accordingly, and then reconcatenating them into a new data set.
 (I then ran the ZScoreMapper() on this new data set, since I only wanted
to Z score the samples I was going to use in the searchlight analysis.)

In [105]: data_stack[1].a.mapper
Out[105]: ZScoreMapper()

Finally, I ran the searchlight analysis which resulted in:
In [106]: res[1].a.mapper
Out[106]: ZScoreMapper()

Would it then be accurate for me to simply use the ChainMapper from the
original data set (exclude the ZScoreMapper from the map2nifti function),
like so:

map2nifti(data[1], res[1].samples)

Or would it be more accurate of me to construct a new ChainMapper which
includes the ZScoreMapper, append it to the ChainMapper of the original
data set, and then re-attribute it to the searchlight output data set?

Thanks again!  This has been a huge hassle, and you've been a great help
(though I realize that much of the troubles were my own carelessness now...
Sorry!).

Taku


On Mon, Nov 4, 2013 at 11:00 AM, Yaroslav Halchenko
<debian at onerussian.com>wrote:

>
> On Mon, 04 Nov 2013, Taku Ito wrote:
>
> >    Oh! �I did in fact have one, though it's the Zscore-mapper (I had
> >    previously thought I checked 'mapper' in res[1].a, but perhaps it
> came out
> >    incorrectly). �Though I realize Z-score mapper probably doesn't have a
> >    reverse mapper, and perhaps that's the issue? �Is there a workaround
> you
> >    may be aware of?
>
> hm -- it should not be just a zscore mapper but rather also the ones
> which lead to that point.  (flattening, feature selection (you had a
> mask, right?)).  please show print ds.a.mapper and if it is indeed only
> zscore -- then a code snippet  which lead to that point.  Inspect also
> either you had a correct mapper right after fmri_dataset
>
> >    Thanks!
>
> >    On Mon, Nov 4, 2013 at 10:48 AM, Yaroslav Halchenko
> >    <[1]debian at onerussian.com> wrote:
>
> >      On Mon, 04 Nov 2013, Taku Ito wrote:
>
> >      > � �Are all datasets supposed to have mappers? �My data set was
> loaded
> >      > � �directly from a NIFTI file, using
> mvpa2.datasets.mri.fmri_dataset,
> >      and
> >      > � �when I loaded it there was no mapper attached,
>
> >      it should be there under .a.mapper ... see e.g.
> >      [2]http://www.pymvpa.org/tutorial_datasets.html#loading-fmri-data
> >      for more information
> >      > though I attributed it
> >      > � �target values and chunks. �In other words, my original data set
> >      also does
> >      > � �not have any mappers. �Should I be manually attributing
> mappers to
> >      my data
> >      > � �set (e.g., the searchlight call or the z-scoring call) and
> attach
> >      all
> >      > � �those mappers as a Chain?
>
> >      let's first figure out if you indeed didn't have any ;-)
> --
> Yaroslav O. Halchenko, Ph.D.
> http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
> Senior Research Associate,     Psychological and Brain Sciences Dept.
> 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
>
> _______________________________________________
> Pkg-ExpPsy-PyMVPA mailing list
> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa
>



-- 
Takuya Ito
Cognitive Control & Psychopathology Laboratory
Washington University in St. Louis

Cole Neuroscience Laboratory (http://www.mwcole.net/)
Center for Molecular and Behavioral Neuroscience (CMBN)
Rutgers-Newark University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20131104/ad7149fe/attachment.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list