Back to the main page.

Bug 3231 - Problems with plotting montaged grads in ft_plot_sens

Status NEW
Reported 2017-01-12 13:05:00 +0100
Modified 2017-01-12 13:44:37 +0100
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to:
Depends on:
See also:

Vladimir Litvak - 2017-01-12 13:05:55 +0100

We are getting problems with plotting grads in ft_plot_sens (particularly for Neuromag but the problem might be more general). Error on line 228 'cannot work with balanced gradiometer definition'. This happens every time grad.tra was modified (e.g. by ICA or SSS montage). The old code which didn't plot the fancy squares was quite tolerant to that. Since these cases are getting more and more common I think it would be good to have a fallback option that would just plot sensor position as points as it did before. Vladimir

Robert Oostenveld - 2017-01-12 13:38:28 +0100

there is this section at line 108 which sets the default. I suggest you extend it so that the default is 'point' for balanced grads. if isempty(coilshape) if ft_senstype(sens, 'neuromag') if strcmp(chantype, 'megmag') coilshape = 'point'; % these cannot be plotted as squares else coilshape = 'square'; end elseif ft_senstype(sens, 'meg') coilshape = 'circle'; else coilshape = 'point'; end end

Vladimir Litvak - 2017-01-12 13:42:32 +0100

That won't prevent the crash because that bit of code runs for all Neuromag grads irrespective of coilshape

Vladimir Litvak - 2017-01-12 13:44:37 +0100

I could just specify 'coilshape', 'point' in my code if that wasn't the case.