Back to the main page.

Bug 2997 - implement saturation in ft_sourceplot for surfaces

Reported 2015-11-04 17:59:00 +0100
Modified 2017-11-20 20:14:13 +0100
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P5 normal
Assigned to: Jan-Mathijs Schoffelen
Depends on:
See also:

Robert Oostenveld - 2015-11-04 17:59:28 +0100

Stephen (and others) occasionally run into rendering problems with surface plots due to software openGL. This would be resolved if the surfaces were visualised without opacity. This is implemented in ft_plot_matrix (TFRs) and as of recently also in ft_plot_topo (thanks to Roemer, see bug 2574). I received a mat file from Stephen that I will copy to home/common/matlab/fieldtrip/test/bugxxx.mat

Robert Oostenveld - 2015-11-05 23:31:42 +0100

*** Bug 2955 has been marked as a duplicate of this bug. ***

Stephen Whitmarsh - 2017-05-17 15:10:01 +0200


Robert Oostenveld - 2017-05-17 15:10:50 +0200

who is going to do this?

Jan-Mathijs Schoffelen - 2017-06-27 15:24:09 +0200

(In reply to Robert Oostenveld from comment #3) I guess I am, because I am getting totally annoyed by the fact that rendering is so extremely slow sometimes. As indicated by Roemer in the referenced bug, the code that is in ft_plot_matrix/_topo is not going to help us here, because this allows only for binary masking, i.e. either an alpha value of 0 or an alpha value of 1. I will look into a solution that would generically do a conversion of a rgba matrix into an rgb matrix, where the alpha-column can have any value. I suspect this needs the following to be generic: -allow for a data vector, which needs to be converted into an rgb matrix, given a colormap and a clim -add an alpha column to this rgb matrix based on the specified maskparameter + alphamap + alim -convert this into rgb again in combination with a specified background color-value, which can be other than [1 1 1], or [0 0 0]

Jan-Mathijs Schoffelen - 2017-06-27 15:28:38 +0200

the specs in my previous comment lead to a function with the following api: rgb = bg_rgba2rgb(rgba, bg) % both inputs Nx3 or rgb = bg_rgba2rgb(dat, bg, cmap, clim, alpha, alphamap, alim); % dat = Nx1, bg = Nx3, cmap = Mx3, clim = 1x2, alpha = Nx1, alphamap = string, alim = 1,2

Jan-Mathijs Schoffelen - 2017-07-05 15:23:18 +0200

This has been done.