<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Dear FT-ers, <br>
<br>
I found an old posting to the mailing list (see below) that never
got answered so my question still holds: given a location I found in
the interpolated source, how do I find back the same location in
.pos of the non-interpolated data?<br>
I can try and go around it by finding the corresponding MNI
coordinates in the interpolated data (which by now I have to do by
hand, so not optimal anyways), and then look for those coordinates
in .pos. But I was wondering, like Cornelius was in his post,
whether there is a neater way to get this information.<br>
<br>
Thanks a lot for the help, <br>
Vitória<br>
<br>
<br>
<div class="moz-forward-container">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb">
<div class="h5">
>>>>>>>>>>>>>><br>
<br>
Hi mailing list,<br>
<br>
I'm still struggling with the conversion of coordinates
between source and<br>
interpolated source space.<br>
For example, if i have the position of a single grid
point how do i get the<br>
corresponding voxel in the interpolated source
structure. Or the other way<br>
around, how to get the grid point which corresponds to a
voxel (e.g the max<br>
voxel) in the interpolated source structure.<br>
<br>
I think this should be a common problem when working
with virtual<br>
electrodes, shouldn't it?<br>
<br>
To make things easier i put together a example with the
data from the<br>
source tutorial where i tried to calculated the grid pos
of the max voxel<br>
in the interpolated source.<br>
<br>
clear all;<br>
load sourcePost_nocon; % source structure
from tutorial<br>
mri = ft_read_mri('Subject01.mri'); % mri of subject01
from tutorial<br>
<br>
sourceNAI = sourcePost_nocon;<br>
sourceNAI.avg.pow = sourcePost_nocon.avg.pow ./
sourcePost_nocon.avg.noise;<br>
sourceNAI=rmfield(sourceNAI,'freq'); % had to remove
that to let<br>
<br>
cfg = [];<br>
cfg.downsample = 2;<br>
cfg.parameter = 'avg.pow';<br>
sourceNAIInt = ft_sourceinterpolate(cfg, sourceNAI ,
mri);<br>
<br>
% Find position of max activity<br>
[dum, maxindx] = max(sourceNAIInt.avg.pow(:));<br>
[xi, yi, zi] = ind2sub(sourceNAIInt.dim, maxindx);<br>
posInt=[xi, yi, zi];<br>
<br>
% Plot interpolated source with position of max activity<br>
cfg = [];<br>
cfg.method = 'ortho';<br>
cfg.funparameter = 'avg.pow';<br>
cfg.locationcoordinates = 'voxel';<br>
cfg.location = posInt; % location of max
activity is marked<br>
correctly.<br>
figure;<br>
ft_sourceplot(cfg,sourceNAIInt);<br>
<br>
% Transform coordinate back to uninterpolated source???<br>
dpos = warp_apply(inv(mri.transform), posInt,
'homogeneous');<br>
<br>
<br>
% Plot uninterpolated source with position aquired from
interpolated source<br>
cfg = [];<br>
cfg.method = 'ortho';<br>
cfg.funparameter = 'avg.pow';<br>
cfg.locationcoordinates = 'voxel';<br>
cfg.location = dpos; % unfortunately
this coordinate is<br>
obviously wrong!!! WHY?<br>
figure;<br>
ft_sourceplot(cfg,sourceNAI);<br>
<br>
<br>
Unfortunately the solution of Jan Mathijs did not work,
nor did mine :(<br>
<br>
Any ideas???<br>
<br>
Cornelius<br>
<br>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
</div>
<br>
</body>
</html>