Back to the main page.

Bug 2654 - ft_sourceplot functional image scaling trouble

Reported 2014-07-16 18:13:00 +0200
Modified 2015-02-11 10:40:45 +0100
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P5 normal
Assigned to: Robert Oostenveld
Depends on:
See also:

Philipp Ruhnau - 2014-07-16 18:13:34 +0200

Created attachment 654 plot example with strangely scaled saggital plane Dear ft developers, we just updated our ft version this morning and encountered a strange issue when plotting with ft_sourceplot and using the ortho functionality. as you can see in the screenshot I appended the functional data in one of the three planes (this seems kind of random) is scaled strangely. in my example this did not happen, when i used cfg.location = 'min' (another strange thing...) we will for now just move back to the ft version before (i think that was from last week or so). as I saw that there were a couple of changes in ft_sourceplot, i figured, those who implemented them might be faster in spotting the underlying problem (also I can currently not make it my priority). best p

Robert Oostenveld - 2014-07-17 08:28:52 +0200

Hi Philipp, A change that I recently made in ft_plot_slice affects the 3D position of the slice that is plotted with respect to an intersection of a (cortical) mesh. That is in and some of the commits just before it (it starts with 9706). I recall MATLAB inconsistencies (over versions and platforms) with regards to how something is displayed if it is plotted on exactly the same place in 3D space. Here the anatomical slice and functional slice are in 3D space and you happen to be looking at them from a specific angle. Could you recreate the figure, toggle on the "3d rotate" option, and rotate the upper right subplot? That might reveal that the missing data is displayed just behind anatomical slice. It would help to have the data that you are plotting. Or (if that is too large) the *.fig file. best Robert

Philipp Ruhnau - 2014-07-17 09:47:57 +0200

Dear Robert, find the source structure here and the fig here by using cfg = []; cfg.method='ortho'; cfg.funparameter='powspctrm_avg'; cfg.funcolorlim = [-.1 .1]; ft_sourceplot(cfg, source) i can recreate the problem on our linux server (running Matlab2012a) on my Mac (running Matlab2013a) I cannot recreate the issue... the image looks fine also on the linux server, others had the issue but it seemed to randomly affect different planes. I tried the rotating and did not find any points behind the anatomy. to me it still looks like a scaling thing and not an overlay issue (if you look at my original example you see that the cross-hair moved from one end of the blue blob to the other one) cheers philipp

Robert Oostenveld - 2014-07-17 10:00:45 +0200

for reference: I copied the files to /home/common/matlab/fieldtrip/data/test/bug2654.

Robert Oostenveld - 2014-07-17 10:21:54 +0200

I can reproduce the problem on my macbook pro with matlab2014a. cfg.location = [] and navigating to the center gives incomplete coverage in the sagittal slice. cfg.location = [0 -19 0] jumps to the center immediately and has good coverage. What surprises me is that in the 2nd case (starting from a specified location) that subsequent clicking around does not result in incomplete coverage.

Philipp Ruhnau - 2014-07-17 10:32:41 +0200

very interesting indeed. i also thought the first image was okay when giving no location but then i noticed that the selected spot was on the side of the head so even the bad coverage appeared complete... although when i now think about it it is strange because there should be nothing in the saggital image there. and yeah, that's why I couldn't reproduce at first what the others saw, because somehow the location leads to full coverage. thanks for looking into it p

Robert Oostenveld - 2014-07-17 10:42:19 +0200

if I comment out this section in ft_plot_slice around line 234 % if all(isnan(V(:))) % % the projection plane lies completely outside the box spanned by the data % else % % trim the edges of the projection plane % [sel1, sel2] = tight(V); % V = V (sel1,sel2); % Xi = Xi(sel1,sel2); % Yi = Yi(sel1,sel2); % Zi = Zi(sel1,sel2); % end it does display correctly. So it is not a 3D rendering problem, but an issue with the mask updating. I don't really understand yet how the functional data and mask relate...

Robert Oostenveld - 2014-07-17 10:56:52 +0200

it is not the trimming, but further down. There was a section where the Cdata was being updated, but the X/Y/Zdata (the location of the patches) were not updated correspondingly. this commit fixes it. mac011> svn commit plotting/ft_plot_slice.m Sending plotting/ft_plot_slice.m Transmitting file data . Committed revision 9740.

Philipp Ruhnau - 2014-07-17 11:01:28 +0200

(In reply to Robert Oostenveld from comment #7) awesome

Robert Oostenveld - 2015-02-11 10:40:45 +0100

Closed several bugs that were recently resolved. Please reopen if you are not happy with the resolution.