[pymvpa] Mask in from_wizard generates no data.

Thomas Nickson thomas.nickson at gmail.com
Thu Dec 4 13:54:23 UTC 2014


I tried the fmri_dataset and get the following error.

---------------------------------------------------------------------------TypeError
                                Traceback (most recent call
last)<ipython-input-138-8ac3004a5d76> in <module>()     53 #Load
dataset     54 #ds = Dataset.from_wizard(rotatedImageData,
targets=metaData['diagnosesT1'], mask=mask)---> 55 ds =
fmri_dataset(rotatedImageData, targets=metaData['diagnosesT1'],
mask=mask)     56      57 #zscore normalise the data
/home/orkney_01/tnickson/Programming/pyVirtualEnv/lib/python2.6/site-packages/mvpa2/datasets/mri.pyc
in fmri_dataset(samples, targets, chunks, mask, sprefix, tprefix,
add_fa)    229     """    230     # load the samples--> 231
imgdata, imghdr, imgtype = _load_anyimg(samples, ensure=True,
enforce_dim=4)    232     233     # figure out what the mask is, but
only handle known cases, the rest
TypeError: 'NoneType' object is not iterable



On Mon, Dec 1, 2014 at 9:56 AM, Thomas Nickson <thomas.nickson at gmail.com>
wrote:

> Hmmmm, not sure how to answer that. They are the same shape but there are
> not 133 copies of the mask but there are of the dataset is that the
> problem? It automatically applies the flattening as well. Is that going to
> be a problem?
>
> Mask and data are of the following types
>
> <type 'numpy.ndarray'>
> <type 'numpy.ndarray'>
>
> There are 217387 elements in the mask.
> There are 902629 elements in one element of the array but the array is 133
> elements long.
>
> I have not tried fmri_dataset. Is this compatible with structural scans?
>
> Tom
>
> On Sat, Nov 29, 2014 at 12:18 PM, Nick Oosterhof <
> n.n.oosterhof at googlemail.com> wrote:
>
>>
>> On 28 Nov 2014, at 14:35, Thomas Nickson <thomas.nickson at gmail.com>
>> wrote:
>>
>> > When I construct a dataset using Dataset.from_wizard() and supply a
>> brain mask all I get in return is a dataset that's all 0.
>> >
>> > I show the code below:
>> >
>> > #get image data reshape and flatten
>> > rotatedImageData = rotateShape(getImageData(DATA_LOCATION))
>> >
>> > #Get mask data
>> > mask = getImageData(MASK)#.nonzero()[0]
>> >
>> > #Load dataset
>> > ds = Dataset.from_wizard(rotatedImageData,
>> targets=metaData['diagnosesT1'], mask=mask)
>>
>> Some ideas:
>> - are the mask and rotatedImageData of compatible shape?
>> - what is the datatype of mask?
>> - how many voxels are non-zero in the mask?
>> - how many voxels are non-zero in rotatedImageData?
>> - have you tried using fmri_dataset instead?
>>
>> If that doesn’t help in resolving the issue, could you provide the data
>> you are using somewhere online so we can try to reproduce the issue.
>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20141204/34144aed/attachment.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list