Hi Lu Feng,<br><br>ah, o.k., your EPI is already normalized. The easiest way would then be to just open it in FSLView, there you have spinboxes (special kind of GUI input boxes) for setting and reading the current voxel-coordinate and right next to it you see the coordinates with qform applied (compare my example image in the attachment).<br>
<br>If this doesn't help, you have to apply your qform to your voxel coordinates. Are you using pynifti? Then you can use the NiftiImage class and the vx2q method. Hope my memory doesn't play tricks on me.<br><br>
Greetings,<br>Thorsten<br><br><div class="gmail_quote">2011/11/10 冯璐 <span dir="ltr"><<a href="mailto:fenglu@fingerpass.net.cn">fenglu@fingerpass.net.cn</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">











<div link="blue" vlink="purple" lang="ZH-CN">

<div>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D" lang="EN-US">Dear Thorsten,<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D" lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D" lang="EN-US">         Thank you for your reply. What I have done may be
something curious. I did slice timing, realignment, coregistering, and normalization
using SPM. Then I changed the .img/.hdr pairs (supplied by SPM) into 4D .nii.gz
files which are more suitable for PyMVPA. For SPM, I can check the MNI
coordinates easily. But for PyMVPA, I don’t know how to check the MNI
coordinates. What I got using <b><i>dataset.mapper.getInId()</i></b> is a
coordinate in the voxel space, I think. I wonder how to change them into the
MNI space.<u></u><u></u></span></p><div class="im">

<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D" lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D" lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span style="font-size:14.0pt;color:#1F497D" lang="EN-US">Best wishes!<u></u><u></u></span></p>

<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span style="font-size:14.0pt;color:#1F497D" lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span style="font-size:14.0pt;color:#1F497D" lang="EN-US">     <i>Lu FENG<u></u><u></u></i></span></p>

<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span style="font-size:14.0pt;color:#1F497D" lang="EN-US"><a href="mailto:fenglu@fingerpass.net.cn" target="_blank">fenglu@fingerpass.net.cn</a><u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D" lang="EN-US"><u></u> <u></u></span></p>

</div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">

<p class="MsoNormal"><b><span style="font-size:10.0pt" lang="EN-US">From:</span></b><span style="font-size:10.0pt" lang="EN-US"> pkg-exppsy-pymvpa-bounces+fenglu=<a href="mailto:fingerpass.net.cn@lists.alioth.debian.org" target="_blank">fingerpass.net.cn@lists.alioth.debian.org</a>
[mailto:<a href="mailto:pkg-exppsy-pymvpa-bounces%2Bfenglu" target="_blank">pkg-exppsy-pymvpa-bounces+fenglu</a>=<a href="mailto:fingerpass.net.cn@lists.alioth.debian.org" target="_blank">fingerpass.net.cn@lists.alioth.debian.org</a>]
<b>On Behalf Of </b>Thorsten Kranz<br>
<b>Sent:</b> 2011</span><span style="font-size:10.0pt">年</span><span style="font-size:10.0pt" lang="EN-US">11</span><span style="font-size:10.0pt">月</span><span style="font-size:10.0pt" lang="EN-US">10</span><span style="font-size:10.0pt">日</span><span style="font-size:10.0pt" lang="EN-US"> 18:06</span></p>
<div><div class="h5"><br>
<b>To:</b> Development and support pf PyMVPA<br>
<b>Subject:</b> Re: [pymvpa] How to export neighborhood relationships of
NiftiDataset?<u></u><u></u></div></div><p></p>

</div><div><div class="h5">

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Hi Lu Feng,<br>
<br>
getting to some voxel-indices to MNI coordinates is a somewhat tricky task.
What you have to do is (assuming you have a EPI-sequence, not structural MRI):<br>
<br>
1) coregister your EPI to a structural image of the same subject<br>
2) normalize the structural image to some standard image, e.g. MNI152T1_2mm as
contained in fsl data<br>
3) apply the concatenated transform EPI->structural an structural->MNI to
the EPI sequence<br>
4) thus you obtain an image that is in "MNI space", e.g. by opening
it in fslview you can find out the MNI coordinates.<br>
<br>
Going to Talairach would be the next step, look at<br>
<br>
<a href="http://imaging.mrc-cbu.cam.ac.uk/imaging/MniTalairach" target="_blank">http://imaging.mrc-cbu.cam.ac.uk/imaging/MniTalairach</a> 
<br>
<br>
for more details.<br>
<br>
But be careful: Talairach is not a 1:1 analogy to MNI, some parts of the
Tal-Brain are much smaller than in MNI. MNI is an average of 152 brains,
Talairach is based on only one example brain.<br>
<br>
You do not have to do steps 3+4, after obtaining the two transforms from EPI to
structural to MNI, you can also manually calculate MNI coordinates from your
voxel coordinates, but I don'T know if you want to do this.<br>
<br>
Greetings,<br>
<br>
Thorsten<br>
<br>
<u></u><u></u></span></p>

<div>

<p class="MsoNormal"><span lang="EN-US">2011/11/10 </span>冯璐<span lang="EN-US"> <<a href="mailto:fenglu@fingerpass.net.cn" target="_blank">fenglu@fingerpass.net.cn</a>><u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">... I can't understand your words exactly
... I used SPM before and I didn't have to think about the voxel space and MNI
space, etc. Let's move to some practical problems.<br>
<br>
Loading from<br>
        Task1.nii.gz,<br>
I can get<br>
        dataset.samples which is a M*N*P matrix.<br>
Using<br>
        dataset.mapper.getInId(index),<br>
I can get<br>
        a coordinate [z, y, x], x belongs to (0, M), y
belongs to (0, N), z belongs to (0, P).<br>
I have checked the result above.<br>
<br>
Using<br>
       fslhd Task1.nii.gz,<br>
I can get some information may be useful<br>
       qform_name     Aligned Anat<br>
               qform_code    
2<br>
               qto_xyz:1    
 -3.500000  0.000000  -0.000000  76.000000<br>
               qto_xyz:2    
 0.000000  3.500000  -0.000000  -112.000000<br>
               qto_xyz:3    
 0.000000  0.000000  4.000000  -50.000000<br>
               qto_xyz:4    
 0.000000  0.000000  0.000000  1.000000<br>
               qform_xorient
 Right-to-Left<br>
               qform_yorient
 Posterior-to-Anterior<br>
               qform_zorient
 Inferior-to-Superior<br>
               sform_name    
Aligned Anat<br>
               sform_code    
2<br>
               sto_xyz:1    
 -3.500000  0.000000  0.000000  76.000000<br>
               sto_xyz:2    
 0.000000  3.500000  0.000000  -112.000000<br>
               sto_xyz:3    
 0.000000  0.000000  4.000000  -50.000000<br>
               sto_xyz:4    
 0.000000  0.000000  0.000000  1.000000<br>
               sform_xorient
 Right-to-Left<br>
               sform_yorient
 Posterior-to-Anterior<br>
               sform_zorient  Inferior-to-Superior<br>
<br>
Then, how can I change the coordinate into a MNI coordinate or a Talairach
coordinate?<br>
<br>
Sorry for interruption and thanks in advance.<u></u><u></u></span></p>

<div>

<p class="MsoNormal"><span lang="EN-US"><br>
Best wishes!<br>
<br>
    Lu FENG<br>
<a href="mailto:fenglu@fingerpass.net.cn" target="_blank">fenglu@fingerpass.net.cn</a><br>
<br>
-----Original Message-----<br>
From: pkg-exppsy-pymvpa-bounces+fenglu=<a href="mailto:fingerpass.net.cn@lists.alioth.debian.org" target="_blank">fingerpass.net.cn@lists.alioth.debian.org</a>
[mailto:<a href="mailto:pkg-exppsy-pymvpa-bounces%2Bfenglu" target="_blank">pkg-exppsy-pymvpa-bounces+fenglu</a>=<a href="mailto:fingerpass.net.cn@lists.alioth.debian.org" target="_blank">fingerpass.net.cn@lists.alioth.debian.org</a>]
On Behalf Of Yaroslav Halchenko<u></u><u></u></span></p>

</div>

<div>

<div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US">Sent: 2011</span>年<span lang="EN-US">11</span>月<span lang="EN-US">8</span>日<span lang="EN-US"> 20:55<br>
To: Development and support pf PyMVPA<br>
Subject: Re: [pymvpa] How to export neighborhood relationships of NiftiDataset?<br>
<br>
axes and direction depend on how they are stored in your specific<br>
Nifti -- and those could vary since we do not deduce physical<br>
orientation of the volume anyhow from qform.<br>
<br>
On Tue, 08 Nov 2011, </span>冯璐<span lang="EN-US"> wrote:<br>
<br>
> I think that is what I need.<br>
> So array([0, 0, 1]) is the coordinate in the voxel space. X from 0 to max:
right->left; Y from 0 to max: posterior->anterior; Z from 0 to max:
inferior->superior ??<br>
<br>
<br>
> Best wishes!<br>
<br>
>      Lu FENG<br>
> <a href="mailto:fenglu@fingerpass.net.cn" target="_blank">fenglu@fingerpass.net.cn</a><br>
<br>
> -----Original Message-----<br>
> From: pkg-exppsy-pymvpa-bounces+fenglu=<a href="mailto:fingerpass.net.cn@lists.alioth.debian.org" target="_blank">fingerpass.net.cn@lists.alioth.debian.org</a>
[mailto:<a href="mailto:pkg-exppsy-pymvpa-bounces%2Bfenglu" target="_blank">pkg-exppsy-pymvpa-bounces+fenglu</a>=<a href="mailto:fingerpass.net.cn@lists.alioth.debian.org" target="_blank">fingerpass.net.cn@lists.alioth.debian.org</a>]
On Behalf Of Yaroslav Halchenko<br>
> Sent: 2011</span>年<span lang="EN-US">11</span>月<span lang="EN-US">8</span>日<span lang="EN-US"> 13:35<br>
> To: Development and support pf PyMVPA<br>
> Subject: Re: [pymvpa] How to export neighborhood relationships of
NiftiDataset?<br>
<br>
> so we are talking about 0.4.x series of pymvpa (in 0.6 AKA mvpa2 voxel<br>
> indices are explicitly stored in feature attributes of a dataset):
 so I<br>
> guess you are looking for:<br>
<br>
> In [10]: from mvpa.tests.tests_warehouse import datasets<br>
> In [11]: datasets['3dsmall'].mapper.getInId(0)<br>
> Out[11]: array([0, 0, 1])<br>
<br>
> ?<br>
<br>
> On Tue, 08 Nov 2011, </span>冯璐<span lang="EN-US"> wrote:<br>
<br>
> >    Dear experts,<br>
<br>
<br>
<br>
> >             I  know that
 using NiftiDataset.map2Nifti()  or other  functions<br>
> >    like mapForward()  or mapReverse(),  we
 can deal  with  either 2D  or  3D<br>
> >    dataset freely. But I wonder how to export the
neighborhood  relationships<br>
> >    of the volume.  Briefly, I</span><span lang="EN-US">��</span><span lang="EN-US">d
like  to have a  transformation matrix or  a<br>
> >    list of  coordinations  for each  voxel.
 I need  this  if I  go  on  with<br>
> >    processing by other tools instead of PyMVPA.<br>
<br>
> >             Thanks in advanceJ<br>
<br>
<br>
<br>
> >    Best wishes!<br>
<br>
<br>
<br>
> >         Lu FENG<br>
<br>
> >    <a href="mailto:fenglu@fingerpass.net.cn" target="_blank">fenglu@fingerpass.net.cn</a><br>
<br>
<br>
<br>
> >    __________ Information from ESET NOD32 Antivirus,
version of virus<br>
> >    signature database 6532 (20111010) __________<br>
<br>
> >    The message was checked by ESET NOD32 Antivirus.<br>
<br>
> >    [1]<a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
<br>
> > References<br>
<br>
> >    Visible links<br>
> >    1. <a href="http://www.eset.com/" target="_blank">http://www.eset.com/</a><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>
--<br>
=------------------------------------------------------------------=<br>
Keep in touch                  
                  <a href="http://www.onerussian.com" target="_blank">www.onerussian.com</a><br>
Yaroslav Halchenko                 <a href="http://www.ohloh.net/accounts/yarikoptic" target="_blank">www.ohloh.net/accounts/yarikoptic</a><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>
<br>
<u></u><u></u></span></p>

</div>

</div>

<p class="MsoNormal"><span lang="EN-US">__________ Information from ESET NOD32
Antivirus, version of virus signature database 6616 (20111109) __________<u></u><u></u></span></p>

<div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US"><br>
The message was checked by ESET NOD32 Antivirus.<u></u><u></u></span></p>

</div>

<p class="MsoNormal"><span lang="EN-US"><a href="http://www.eset.com" target="_blank">http://www.eset.com</a><u></u><u></u></span></p>

<div>

<div>

<p class="MsoNormal"><span lang="EN-US"><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><u></u><u></u></span></p>

</div>

</div>

</div>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

</div></div><p><span lang="EN-US">__________ Information from ESET NOD32 Antivirus, version
of virus signature database 6617 (20111110) __________<u></u><u></u></span></p><div class="im">

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p><span lang="EN-US">The message was checked by ESET NOD32 Antivirus.<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p><span lang="EN-US"><a href="http://www.eset.com" target="_blank">http://www.eset.com</a><u></u><u></u></span></p>

</div></div>

 <br><br>__________ Information from ESET NOD32 Antivirus, version of virus signature database 6617 (20111110) __________<div class="im"><br><br>The message was checked by ESET NOD32 Antivirus.<br><br><a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
 </div></div>


<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>