[pymvpa] Strange results from a mapper

Zhen Zonglei zonglei.fsl at gmail.com
Fri Mar 18 02:55:33 UTC 2011


Hi all:

       The following code gives me a very strange result; here, there are 5
ROIs in my maskimg, indexed 1 to 5, respectively. In my mind, the output1
and output2 is right, but output3 is very confusing, why ROI 2 is missing?

The pymvpa I used is ver .5. Could you please help me find the problem?
Thanks in advance.



Best



Zonglei



attr = SampleAttributes(os.path.join(dpath,attributes))

patimg  = nifti.NiftiImage(os.path.join(dpath,pat))

maskimg = nifti.NiftiImage(os.path.join(dpath,'masks',fmask))



rois = np.unique(maskimg.getDataArray())

rois = rois[rois!=0]

pirnt rois => [1, 2, 3, 4,5] # output 1, 5 ROIs, indexed 1 to 5



alldata = fmri_dataset(samples=patimg,targets=attr.targets,

                                chunks=attr.chunks,mask=maskimg)

zscore(alldata)



img = maskimg.copy().getDataArray()

print np.unique(img)  => [0,1, 2, 3, 4,5] # output 2



mask = alldata.mapper[:2].forward1(img) # flatten and feature selection

print np.unique(mask) => [0,1, 3, 4,5] # output 3, where is ROI 2?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20110318/b90394b0/attachment.htm>


More information about the Pkg-ExpPsy-PyMVPA mailing list