[pymvpa] 3D images with NiftiDataset?

Michael Hanke michael.hanke at gmail.com
Thu Sep 18 17:50:40 UTC 2008

On Thu, Sep 18, 2008 at 10:23:18AM -0400, Yaroslav Halchenko wrote:
> > I've been mucking about trying to get NiftiDataset to grab my images (3d 
> > maps of beta weights from a GLM) and mask but keep running into this error:
> > ValueError: The mask dataspace shape [(54, 65, 53)] is not compatible 
> > with the shape of the provided data samples [(65, 53)].
> Could you try adding another leading dimension in the data samples? like
> data[N.newaxis, :]
In terms of the samples array yes, but not for NiftiDataset. ATM it can
only digest NiftiImage objects and filenames as 'sample' arguments. So,
if you want to stick with NiftiDataset (which is a good idea IMHO) you
have to come up with a merged NiftiImage somehow. You could add an axis
to each beta image and recreate a new NiftiImage for each single beta
image, feed this into NiftiDataset and merge the datasets afterwards --
but this is a unnecessary complicated IMHO.



GPG key:  1024D/3144BE0F Michael Hanke
ICQ: 48230050

More information about the Pkg-ExpPsy-PyMVPA mailing list