<div dir="ltr">I tried the fmri_dataset and get the following error.<br><br><pre><span class="">---------------------------------------------------------------------------</span>
<span class="">TypeError</span>                                 Traceback (most recent call last)
<span class=""><ipython-input-138-8ac3004a5d76></span> in <span class=""><module></span><span class="">()</span>
<span class="">     53</span> <span class="">#Load dataset</span><span class=""></span><span class=""></span>
<span class="">     54</span> <span class="">#ds = Dataset.from_wizard(rotatedImageData, targets=metaData['diagnosesT1'], mask=mask)</span><span class=""></span><span class=""></span>
<span class="">---> 55</span><span class=""> </span>ds <span class="">=</span> fmri_dataset<span class="">(</span>rotatedImageData<span class="">,</span> targets<span class="">=</span>metaData<span class="">[</span><span class="">'diagnosesT1'</span><span class="">]</span><span class="">,</span> mask<span class="">=</span>mask<span class="">)</span><span class=""></span>
<span class="">     56</span> <span class=""></span>
<span class="">     57</span> <span class="">#zscore normalise the data</span><span class=""></span><span class=""></span>

<span class="">/home/orkney_01/tnickson/Programming/pyVirtualEnv/lib/python2.6/site-packages/mvpa2/datasets/mri.pyc</span> in <span class="">fmri_dataset</span><span class="">(samples, targets, chunks, mask, sprefix, tprefix, add_fa)</span>
<span class="">    229</span>     """
<span class="">    230</span>     <span class=""># load the samples</span><span class=""></span><span class=""></span>
<span class="">--> 231</span><span class="">     </span>imgdata<span class="">,</span> imghdr<span class="">,</span> imgtype <span class="">=</span> _load_anyimg<span class="">(</span>samples<span class="">,</span> ensure<span class="">=</span>True<span class="">,</span> enforce_dim<span class="">=</span><span class="">4</span><span class="">)</span><span class=""></span>
<span class="">    232</span> <span class=""></span>
<span class="">    233</span>     <span class=""># figure out what the mask is, but only handle known cases, the rest</span><span class=""></span><span class=""></span>

<span class="">TypeError</span>: 'NoneType' object is not iterable
</pre><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 1, 2014 at 9:56 AM, Thomas Nickson <span dir="ltr"><<a href="mailto:thomas.nickson@gmail.com" target="_blank">thomas.nickson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>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? <br><br></div>Mask and data are of the following types<br><pre><type 'numpy.ndarray'>
<type 'numpy.ndarray'></pre>There are 217387 elements in the mask.<br></div>There are 902629 elements in one element of the array but the array is 133 elements long.<br><br></div>I have not tried fmri_dataset. Is this compatible with structural scans?<br><br></div>Tom<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 29, 2014 at 12:18 PM, Nick Oosterhof <span dir="ltr"><<a href="mailto:n.n.oosterhof@googlemail.com" target="_blank">n.n.oosterhof@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
On 28 Nov 2014, at 14:35, Thomas Nickson <<a href="mailto:thomas.nickson@gmail.com" target="_blank">thomas.nickson@gmail.com</a>> wrote:<br>
<br>
> 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.<br>
><br>
> I show the code below:<br>
><br>
> #get image data reshape and flatten<br>
> rotatedImageData = rotateShape(getImageData(DATA_LOCATION))<br>
><br>
> #Get mask data<br>
> mask = getImageData(MASK)#.nonzero()[0]<br>
><br>
> #Load dataset<br>
> ds = Dataset.from_wizard(rotatedImageData, targets=metaData['diagnosesT1'], mask=mask)<br>
<br>
</span>Some ideas:<br>
- are the mask and rotatedImageData of compatible shape?<br>
- what is the datatype of mask?<br>
- how many voxels are non-zero in the mask?<br>
- how many voxels are non-zero in rotatedImageData?<br>
- have you tried using fmri_dataset instead?<br>
<br>
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.<br>
<br>
<br>
<br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org" target="_blank">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>