<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p style="margin-top:0; margin-bottom:0">Dear users,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I am trying to manually load in the PyMVPA tutorial data, instead of using the load_tutorial_data convenience function (as shown here, for example:
<a href="http://www.pymvpa.org/examples/rsa_fmri.html" class="OWAAutoLink" id="LPlnk22517" previewremoved="true">
http://www.pymvpa.org/examples/rsa_fmri.html)</a>. I have downloaded the tutorial data and replaced the following lines of code from the example script:
<br>
</p>
<p style="margin-top:0; margin-bottom:0"></p>
<pre><span class="kn" style="font-family:Consolas,Courier,monospace; font-size:10pt">from</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="nn" style="font-family:Consolas,Courier,monospace; font-size:10pt">mvpa2.datasets.sources.native</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="k" style="font-family:Consolas,Courier,monospace; font-size:10pt">import</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">load_tutorial_data</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">datapath</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="o" style="font-family:Consolas,Courier,monospace; font-size:10pt">=</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">pjoin</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">(</span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">cfg</span><span class="o" style="font-family:Consolas,Courier,monospace; font-size:10pt">.</span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">get</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">(</span><span class="s1" style="font-family:Consolas,Courier,monospace; font-size:10pt">'location'</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="s1" style="font-family:Consolas,Courier,monospace; font-size:10pt">'tutorial data'</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">),</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="s1" style="font-family:Consolas,Courier,monospace; font-size:10pt">'haxby2001'</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">)</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">ds</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="o" style="font-family:Consolas,Courier,monospace; font-size:10pt">=</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">load_tutorial_data</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">(</span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">roi</span><span class="o" style="font-family:Consolas,Courier,monospace; font-size:10pt">=</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">(</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">15</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">16</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">23</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">24</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">36</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">38</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">39</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">40</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt"> </span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">48</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">))</span></pre>
<p></p>
<p style="margin-top:0; margin-bottom:0">with the following loop:</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div><span style="font-family:Consolas,Courier,monospace; font-size:10pt"><br>
</span></div>
<div><span style="font-family:Consolas,Courier,monospace; font-size:10pt">data_path = pjoin('haxby2001', 'sub001')</span></div>
<span style="font-family:Consolas,Courier,monospace; font-size:10pt">runs = [1,2]</span><br>
<p></p>
<div><span style="font-family:Consolas,Courier,monospace; font-size:10pt">run_datasets = []</span><br>
<span style="font-family:Consolas,Courier,monospace; font-size:10pt">targets = SampleAttributes(pjoin(data_path, 'BOLD','task001_run001', 'attributes.txt'))['targets']</span><br>
<br>
<span style="font-family:Consolas,Courier,monospace; font-size:10pt">for i in runs:</span><br>
<span style="font-family:Consolas,Courier,monospace; font-size:10pt"> bold_fname = pjoin(data_path, 'BOLD', 'task001_run00' + str(i), 'bold.nii.gz')</span><br>
<span style="font-family:Consolas,Courier,monospace; font-size:10pt"> temp_ds = fmri_dataset(bold_fname, mask=None, targets = targets, chunks = i-1)</span><br>
<span style="font-family:Consolas,Courier,monospace; font-size:10pt"> run_datasets.append(temp_ds)</span><br>
</div>
<div><br>
</div>
<div><span style="font-family:Consolas,Courier,monospace; font-size:10pt">ds = vstack(run_datasets, a=0)</span><br>
</div>
<p></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">The one thing I'm missing is how to load in multiple ROIs, as in
<span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">ds</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="o" style="font-family:Consolas,Courier,monospace; font-size:10pt">=</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">load_tutorial_data</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">(</span><span class="n" style="font-family:Consolas,Courier,monospace; font-size:10pt">roi</span><span class="o" style="font-family:Consolas,Courier,monospace; font-size:10pt">=</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">(</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">15</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">16</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">23</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">24</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">36</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">38</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">39</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">40</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">,</span><span style="font-family:Consolas,Courier,monospace; font-size:10pt">
</span><span class="mi" style="font-family:Consolas,Courier,monospace; font-size:10pt">48</span><span class="p" style="font-family:Consolas,Courier,monospace; font-size:10pt">)).</span> Is there a way to achieve this with fmri_dataset? Or is there a more appropriate
alternative function to fmri_dataset?<br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Thanks in advance for any advice!</p>
<p style="margin-top:0; margin-bottom:0">Lyam<br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="color:rgb(0,0,0); font-family:arial,sans-serif; font-size:12.8px">---------------------------------------------------------</span></p>
<span style="color:rgb(0,0,0)"></span>
<p><span style="color:rgb(0,0,0); font-family:arial,sans-serif; font-size:12.8px"><b>Lyam Bailey, B.Sc., M.Sc. </b></span></p>
<p><span style="color:rgb(0,0,0); font-family:arial,sans-serif; font-size:12.8px"></span><span style="font-family:arial,sans-serif; font-size:12.8px">Doctoral Student</span></p>
<span style="color:rgb(0,0,0)"></span>
<div style="color:rgb(136,136,136); font-family:arial,sans-serif; font-size:12.8px">
<span style="color:rgb(0,0,0)">Department of Psychology & Neuroscience</span></div>
<span style="color:rgb(0,0,0)"></span>
<div style="color:rgb(136,136,136); font-family:arial,sans-serif; font-size:12.8px">
<span style="color:rgb(0,0,0)">Dalhousie University</span></div>
<br>
<p></p>
</div>
</div>
</div>
</body>
</html>