Changing colormaps in script for open topomap or surface/source images

Hello BS forum,
Maybe these are newbie questions others users have resolved?
Any hints appreciated, this is about the small issue of modifying various colormap settings for normal open BS-figures from command line. It looks like perhaps mistake(s) on my end are leading to no apparent update of BS-figures in some cases?. Brief details below.

This command works from command line with an open EEG topomap BS-figure which was generated by clicking on an object in BS datatree:
bst_colormaps('SetColormapName', 'EEG', "cmap_dory");

This command doesn't seem to work from command line with an open EEG surface BS-figure which was generated by clicking on an object in BS datatree:
bst_colormaps('SetColormapName', 'source', "cmap_dory");

This following commands don't seem to work for either an open topomap BSfigure
global GlobalData; GlobalData.Colormaps.eeg = SColorMaptoLoadup ;
or open surfaces BSfigure:
global GlobalData; GlobalData.Colormaps.source = SColorMaptoLoadup ;

*Small extra question: is it okay to delete GlobalData after invoking and changing it? Presumably not ?

Thank you for any thoughts!

Here's just for confirmation whats loaded in with the GlobalData attempted change mentioned above.

SColorMaptoLoadup = 
struct with fields:
Name: 'cmap_mandrill'
                CMap: [256×3 double]
    isAbsoluteValues: 0
           isRealMin: 0
     DisplayColorbar: 1
             MaxMode: 'local'
            MinValue: []
            MaxValue: []
    UseStatThreshold: 0
            Contrast: 0
          Brightness: 0

bst_colormaps('SetColormapName', 'source', "cmap_dory");

Only use single quotes ' instead of double quotes ".
This should work (it works on my end), but only if the data type of data represented is really of the type 'source'. It could also be 'stat1' or 'stat2'. Right-click on the figure to see what colormap types are available.

global GlobalData; GlobalData.Colormaps.eeg = SColorMaptoLoadup ;

This is not going to work, indeed. It would not update the figures.
You need to use only the functions available in bst_colormaps.

Merci Francois, will followup up with any resulting questions after some testing.

Hello, this is just a confirmation, thank you.

bst_colormaps('SetColormapName', 'source', 'cmap_dory');
works fine

  1. With an open non-stats surface figure
    or
  2. Without an open non-stats figure...and then clicking figure open to see changed colormaps