<div dir="ltr"><div><div><div><div><div>Hi Shane,<br><br></div>I agree with Nick, I would use AFNI's 3dresample command. Make sure to use the -master flag followed by the name of your fMRI data, e.g., <br><br>3dresample -master bold.nii -prefix rois_in_fmri_space -inset your_ROI_filename_here.nii<br>

<br>(you may get an error with gzipped data... if so first gzip -d bold.nii.gz)<br></div><br>Then AFNI's 3dAFNItoNIFTI command will get the resultant file into NIFTI format for you:<br></div><br>3dAFNItoNIFTI rois_in_fmri_space+orig.<br>

<br></div>If you cannot install AFNI on your local machine, you could always install the Neurodebian virtual machine: <a href="http://neuro.debian.net/vm.html">http://neuro.debian.net/vm.html</a><br><br></div>Cheers,<br>
Derek<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 31, 2013 at 8:46 PM, Shane Hoversten <span dir="ltr"><<a href="mailto:shanusmagnus@gmail.com" target="_blank">shanusmagnus@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Howdy -<br>
<br>
Let me preface this msg by saying that I only _barely_ know what I'm<br>
doing.  This will probably become evident immediately.<br>
<br>
In an experiment whose data I'm trying to analyze, I'd like to<br>
localize the analysis based on the results of various masks, including<br>
Brodmann masks created with the wfu pickatlas tool<br>
(<a href="http://fmri.wfubmc.edu/software/PickAtlas" target="_blank">http://fmri.wfubmc.edu/software/PickAtlas</a>).  I can use these masks in<br>
the course of univariate analyses with SPM despite the fact that the<br>
masks have different numbers of voxels than do our acquired volumes --<br>
the NIFTI headers apparently contain enough info to match up the mask<br>
and the volumes in physical space, and SPM just does the right thing,<br>
which was a pleasant surprise.<br>
<br>
But now I'd like to use these masks with PyMVPA.  I've been working<br>
through the tutorials with the Haxby dataset, and part 2 of the<br>
tutorial demonstrates loading the Haxby BOLD data with a mask, like<br>
so:<br>
<br>
ds = fmri_dataset(os.path.join(path, 'bold.nii.gz'),<br>
mask=os.path.join(path, 'mask_vt.nii.gz'))<br>
<br>
As it happens, the shape of the voxel matrix for this BOLD data, and<br>
for this mask, are the same.  That's a luxury we don't have in our<br>
dataset, but I crossed my fingers and tried to load one of our volumes<br>
with the mask, but to no avail.  I got this error:<br>
<br>
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mvpa2/mappers/flatten.pyc<br>
in _forward_data(self, data)<br>
    103             raise ValueError("FlattenMapper has not been<br>
trained for data "<br>
    104                              "shape '%s' (known only '%s')."<br>
--> 105                              % (str(sshape), str(oshape)))<br>
    106         ## input matches the shape of a single sample<br>
    107         #if sshape == oshape:<br>
<br>
ValueError: FlattenMapper has not been trained for data shape '(91,<br>
109, 91)' (known only '(96, 96, 37)').<br>
<br>
The (91,109,91) are the dimensions of the masks produced by wfu<br>
pickatlas; our data is the (96, 96, 37).  So my question is, how does<br>
one deal with these situations?  I've googled as best as I'm able but<br>
haven't found the issue addressed.  Can anyone point me in a good<br>
direction?<br>
<br>
Thanks very much,<br>
<br>
S<br>
<br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">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>