Connectome viewing

Thank you, Francois, for your suggestions, they are really savers!

  1. The smooth slider callback modification works great. The one issue is that since the callback is modified by my script, it has to be restored to defaults before the fig is closed. So I added a callback to do just that:

    set(gcf, 'CloseRequestFcn', @restoreSliderSurfSmooth_Callback); 
    
         function restoreSliderSurfSmooth_Callback(h, ev)
             disp('Handle restored.');
             java_setcb(panelSurface.jSliderSurfSmoothValue, 'MouseReleasedCallback', oldSliderSurfSmooth_Callback);
             bst_figures('DeleteFigure', h)
         end
    

This works well, but if the script throws an error for whatever reason and fig is not closed, the callback is not changed until one does not get out and in in brainstorm, I wonder if there is a way to change and return the original callback quicker (same mouse release).

  1. I followed your suggestion, and indeed VertConn does the trick to find a more suitable scout label center than the centroid/ seed. Here it is:

     [sScouts, ~, ~] = panel_scout('GetScouts');
     for iii = 1:size(sScouts, 1)
         scoutConn = sSurf.VertConn(sScouts(iii).Vertices, sScouts(iii).Vertices);
         scoutConnGraph = graph(scoutConn);
         vertImportance = centrality(scoutConnGraph, 'closeness');  % or 'eigenvector'
         [~, iMaxImportance] = max(vertImportance);
         maxVertex = sScouts(iii).Vertices(iMaxImportance);
         labelCenters(iii).Loc = panel_scout('GetScoutPosition', Vertices, VertexNormals, maxVertex, 0.0004); 
     end
    
  2. I may miss something, but when I change the colorbar for the scouts themselves (from the gui, not script), and I save the changes by closing the figure, I do not seem to be able to restore the original parcellation color, and this propagates to other figures/surfaces for the same subject. It seems that the only way here is to reimport freesurfer anatomy, please advise.

Thank you,
Octavian