<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Dear <span>Yaroslav</span>,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks so much for the quick reply. I tried implementing this with:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div><span style="font-family: Consolas, Courier, monospace;">fa_fname = {a: "haxby2001/sub001/masks/25mm/%s.nii.gz" % a for a in ["vt, hoc"]}</span><br>
<div><span style="font-family: Consolas, Courier, monospace;">temp_ds = fmri_dataset(bold_fname, mask=None, targets = targets, add_fa=fa_fname, chunks = int(i)-1)</span><br>
<br>
</div>
The code ran without errors, however when I continued through the example RSA script (<a href="http://www.pymvpa.org/examples/rsa_fmri.html" class="OWAAutoLink" id="LPlnk792018" previewremoved="true">http://www.pymvpa.org/examples/rsa_fmri.html</a>) the dissimilarity
 matrices appeared <u>very</u> different to those generated when using load_tutorial_data. I experimented with
<br>
</div>
<span style="font-family: Consolas, Courier, monospace;">fa_fname = {a: "haxby2001/sub001/masks/25mm/%s.nii.gz" % a for a in ["<span style="background-color: rgb(255, 255, 0);">white</span>"]}</span><br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">...and this turned out to generate exactly the same results. I also get the same results with add_fa = None. So I get the feeling that add_fa is not actually being implemented. Can you see a problem in the way I've called
 fmri_dataset?</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks again,</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>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Pkg-ExpPsy-PyMVPA <pkg-exppsy-pymvpa-bounces+lyam.bailey=dal.ca@alioth-lists.debian.net> on behalf of Yaroslav O Halchenko <yoh@onerussian.com><br>
<b>Sent:</b> Tuesday, August 13, 2019 4:59:53 PM<br>
<b>To:</b> pkg-exppsy-pymvpa@alioth-lists.debian.net <pkg-exppsy-pymvpa@alioth-lists.debian.net><br>
<b>Subject:</b> Re: [pymvpa] Loading multiple ROIs with fmri_dataset</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
On Tue, 13 Aug 2019, Lyam Bailey wrote:<br>
<br>
>    Dear users,<br>
<br>
>    I am trying to manually load in the PyMVPA tutorial data, instead of using<br>
>    the load_tutorial_data convenience function (as shown here, for example:<br>
>    <a href="http://www.pymvpa.org/examples/rsa_fmri.html">http://www.pymvpa.org/examples/rsa_fmri.html</a>). I have downloaded the<br>
>    tutorial data and replaced the following lines of code from the example<br>
>    script:<br>
<br>
>  from mvpa2.datasets.sources.native import load_tutorial_data<br>
>  datapath = pjoin(cfg.get('location', 'tutorial data'), 'haxby2001')<br>
>  ds = load_tutorial_data(roi=(15, 16, 23, 24, 36, 38, 39, 40, 48))<br>
<br>
>    with the following loop:<br>
<br>
>    data_path = pjoin('haxby2001', 'sub001')<br>
>    runs = [1,2]<br>
<br>
>    run_datasets = []<br>
>    targets = SampleAttributes(pjoin(data_path, 'BOLD','task001_run001',<br>
>    'attributes.txt'))['targets']<br>
<br>
>    for i in runs:<br>
>        bold_fname = pjoin(data_path, 'BOLD', 'task001_run00' + str(i),<br>
>    'bold.nii.gz')<br>
>        temp_ds = fmri_dataset(bold_fname, mask=None, targets = targets,<br>
>    chunks = i-1)<br>
>        run_datasets.append(temp_ds)<br>
>    ds = vstack(run_datasets, a=0)<br>
<br>
>    The one thing I'm missing is how to load in multiple ROIs, as in ds  = <br>
>    load_tutorial_data(roi=(15,  16,  23,  24,  36,  38,  39,  40,  48)). Is<br>
>    there a way to achieve this with fmri_dataset? Or is there a more<br>
<br>
fmri_dataset has  an argument:<br>
<br>
add_fa : dict or None<br>
  Optional dictionary with additional volumetric data that shall be stored<br>
  as feature attributes in the dataset. The dictionary key serves as the<br>
  feature attribute name. Each value might be of any type supported by the<br>
  'mask' argument of this function<br>
<br>
so you could point to any ROI masks/index volumes and get them assigned to a .fa <br>
<br>
$> python -c 'import mvpa2.suite as mv ; print(mv.fmri_dataset("mvpa2/data/haxby2001/sub001/BOLD/task001_run001/bold_25mm.nii.gz", add_fa={a: "mvpa2/data/haxby2001/sub001/masks/25mm/%s.nii.gz" % a for a in ["brain", "gray", "vt"]}))'<br>
<Dataset: 121x600@int16, <sa: time_coords,time_indices>, <fa: brain,gray,voxel_indices,vt>, <a: imgaffine,imghdr,imgtype,mapper,voxel_dim,voxel_eldim>><br>
<br>
<br>
-- <br>
Yaroslav O. Halchenko<br>
Center for Open Neuroscience     <a href="http://centerforopenneuroscience.org">http://centerforopenneuroscience.org</a><br>
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755<br>
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419<br>
WWW:   <a href="http://www.linkedin.com/in/yarik">http://www.linkedin.com/in/yarik</a>       
<br>
<br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
Pkg-ExpPsy-PyMVPA@alioth-lists.debian.net<br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a></div>
</span></font></div>
</body>
</html>