[pymvpa] select mask features

James M. Hughes james.m.hughes at dartmouth.edu
Thu Nov 6 17:58:02 UTC 2008


Hi all,

I'm a bit confused about the API's instructions for using  
MaskedDataset.selectFeaturesByMask, since my code's not working.

Basically, what I have is a NiftiDataset that has a mask already  
applied to it.  I want to create my own new mask by just creating a  
vector of ones and zeros, then apply it to the current data.

Right now, I have

n volumes x m features, (let's say the dataset originally had M  
features, but m < M were chosen after applying one or more prior masks)

so I created a mask with m zeros, then set some number k of them to 1,  
then called the selectFeaturesByMask method on the dataset.  I get the  
following error:

<type 'exceptions.ValueError'>: shape mismatch: objects cannot be  
broadcast to a single shape

which to me implies that my choice of mask size is somehow wrong.

Is there something I'm missing on this?  The API's pretty unclear  
about the specs for the mask, but of course I'm happy to help update  
the documentation to be more specific!

Thanks for your help!

Cheers,
James.



More information about the Pkg-ExpPsy-PyMVPA mailing list