[FieldTrip] reverse source interpolate?

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Thu Jun 28 14:29:40 CEST 2012


Hi Cornelius,

Probably you should use: cfg.locationcoordinates to be 'head'.

Best,

JM

On Jun 28, 2012, at 11:19 AM, Cornelius Abel wrote:

> Hi jan mathijs, hello mailing list,
> 
> thanks for your answer. I think i got your idea with finding the minimum in this squared differences. This should the work with positions of any scaling, right?
> However it gives me strange results when trying to get voxel indices in the "raw" source using voxel indices  aquired from interpolated source.
> But even using the ctf coordinates in mm doesn't work.
> 
> Here is a short script showing what i did, i also attached the necessary mat files.
> 
> greetings, Cornelius
> 
> 
> clear all;
> load testdata.mat;
> 
> % Interpolate source on anatomy
> cfg = [];
> cfg.parameter = 'avg.itc';
> cfg.interpmethod  =  'linear';
> sourceInt = ft_sourceinterpolate(cfg, source,mri);
> 
> % Find position of max voxel in interpolated source
> [maxval, maxindx] = max(sourceInt.avg.itc(:));
> [x,y,z]=ind2sub(size(sourceInt.avg.itc),maxindx);
> pos=[x y z];
> 
> % plot this position in interpolated source 
> figure;
> cfg = [];
> cfg.method        = 'ortho';
> cfg.funparameter  = 'avg.itc';
> cfg.locationcoordinates = 'voxel';
> cfg.location      = pos;
> ft_sourceplot(cfg, sourceInt); 
> 
> % Calculate respective position in 'raw' source struct
> dpos = source.pos - repmat(pos, size(source.pos,1),1);
> [m,ind] = min(sum(dpos.^2,2));
> spos=source.pos(ind,:);
> 
> % Plot position in 'raw' source.
> % This gives not the position of max activity!!!
> figure;
> cfg = [];
> cfg.method        = 'ortho';
> cfg.funparameter  = 'avg.itc';
> cfg.locationcoordinates = 'voxel';
> cfg.location      = spos;
> ft_sourceplot(cfg, source); 
> 
> 
> 
> 2012/6/27 jan-mathijs schoffelen <jan.schoffelen at donders.ru.nl>
> Hi Cornelius,
> 
> There is no need to 'uninterpolate' because the coordinates are already expressed in the correct coordinate system. What you probably want is to find the index to the voxel in the original source-structure closest to your 'hotspot' in the interpolated image.
> This can be achieved by something like this:
> 
> write down the coordinates of your favourite position in the interpolated image (in world coordinates, here I assume that you are still in MEG coordinate system and have not normalized to MNI space), call this pos
> 
> pos = pos./10 (from mm to cm)
> 
> dpos = source.pos - repmat(pos, size(source.pos,1),1);
> [m,ind] = min(sum(dpos.^2,2));
> 
> source is the original source structure.
> ind is the index you are looking for.
> 
> If you have interpolate to the MNI-template grid you need to replace the source.pos with the set of grid positions from your template grid (i.e. expressed in MNI coordinates).
> 
> 
> Cheers,
> 
> JM
> 
> 
> On Jun 27, 2012, at 5:26 PM, cornelius abel wrote:
> 
>> Hello,
>> 
>> does anybody know how to get the uninterpolated source position giving the coordinates aquired after interpolation with an anatomy.
>> In principle i want to get an individual source time course at the position i picked from the interpolated grand average source plot. Therfore i need the corresponding filter and its position in the source structure.
>> 
>> I tried to get the position by applying the inverse transformation matrix of the used anatomy like:
>> pos_before_interpolation=warp_apply(inv(anatomy.transform), position_after_interpolation);
>> 
>> but that did not give usefull results :(
>> 
>> Any ideas how it could be done?
>> 
>> Greetings, Cornelius
>> 
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> Jan-Mathijs Schoffelen, MD PhD 
> 
> Donders Institute for Brain, Cognition and Behaviour, 
> Centre for Cognitive Neuroimaging,
> Radboud University Nijmegen, The Netherlands
> 
> Max Planck Institute for Psycholinguistics,
> Nijmegen, The Netherlands
> 
> J.Schoffelen at donders.ru.nl
> Telephone: +31-24-3614793
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Jan-Mathijs Schoffelen, MD PhD 

Donders Institute for Brain, Cognition and Behaviour, 
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands

Max Planck Institute for Psycholinguistics,
Nijmegen, The Netherlands

J.Schoffelen at donders.ru.nl
Telephone: +31-24-3614793

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120628/1227d0ee/attachment.html>


More information about the fieldtrip mailing list