<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Dear Hassan,<br></div><div class="gmail_default" style="font-family:verdana,sans-serif">to my knowledge ft_sourcemovie works only with sources estimated using MNE.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif">What you can do is exctrating the source time course (for example using ft_sourcedescriptives) and then plot each frame and create your own movie using the matlab function getframe.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Here is a sample code:<br><br>%%% Extract source timecourse with ft_sourcedescriptives<br><br>%%% source is the output of ft_sourceanalysis with method lcmv<br><br>cfg = [];<br>cfg.projectmom = 'yes';<br>cfg.fixedori = 'over_trials';<br>source_timecourse = ft_sourcedescriptives(cfg,source);<br><br><br>Npos = size(source.pos,1);<br>Ntime = length(source.time);<br><br>source_timecourse.avg.momint = nan(Npos,Ntime);<br><br><br>idx = find(source_timecourse.inside);<br><br>for i = 1:length(idx)<br> index = idx(i);<br> source_timecourse.avg.momint(index,:) = source_timecourse.avg.mom{index};<br><br>end<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">%% Interpolate each time point of interest<br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br> for tt = 1:length(source_timecourse.time) % full trial length or you can select a time window of interest<br> <br> <br> src = source_timecourse;<br> src.time = source_timecourse.time(:,tt);<br> <br> src.avg.momint = source_tc.avg.momint(:,tt); % here you may just leave the time course as it is, or square it or normalize it by a baseline etc etc<br> <br> <br> <br> cfg = [];<br> cfg.parameter = 'momint';<br> sourceInt{tt} = ft_sourceinterpolate(cfg, src, mri); % mri is the mri of your subject or a template mri<br> <br> clear src<br>end<br><br><br><br>%% Plot on surface ( if you want you can set the colorlimt to be the same in each frames so you will be able to see changes in the "amplitude" as well)<br><br><br>for tt = 1:length(sourceInt{tt})<br> <br><br> cfg = [];<br> cfg.method = 'surface';<br> cfg.funparameter = 'momint';<br> cfg.funcolormap = 'hot';<br> ft_sourceplot(cfg, sourceInt{tt})<br> drawnow<br> Frames(tt) = getframe; % get the current frame and store it<br> <br> <br> <br>end<br><br>%% Show movie<br>figure<br>movie(Frames,1)<br><br><br>%% Save movie (frames) in AVI format<br><br>writerObj = VideoWriter('Movie.avi'); % Name it.<br>%writerObj.FrameRate = 60; % How many frames per second.<br>open(writerObj);<br><br>for tt=1:size(Frames,2)<br> <br> writeVideo(writerObj, Frames(tt));<br> %end<br> <br>end<br>hold off<br>close(writerObj); % Saves the movie.<br><br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Hope this helps :)<br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Best,<br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Debora<br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 12, 2016 at 6:35 PM, Hassan Aleem <span dir="ltr"><<a href="mailto:ha438@georgetown.edu" target="_blank">ha438@georgetown.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Does anyone have an example of how to use ft_sourcemovie to look at source localization across time with the 'lcmv' method. would be greatly appreciated. Thanks!<br></div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><div><div><div><div><div><font face="verdana,sans-serif"><br>Debora Desideri</font><font face="verdana,sans-serif">, PhD Student<br></font></div></div><font face="verdana,sans-serif">BNP Lab - Neurology Department<br></font></div><font face="verdana,sans-serif">University Hospital Tübingen<br></font></div><font face="verdana,sans-serif">Eberhard Karls University Tübingen<br></font></div><font face="verdana,sans-serif">Hoppe-Seyler Str. 3<br></font></div><font face="verdana,sans-serif">D-72076 Tübingen<br></font></div><font face="verdana,sans-serif">Tel: +49 7071/29 80478<br></font><div><div><div><font face="verdana,sans-serif"><br></font></div></div></div></div></div></div></div>
</div>