Source map specific orientation

With Brainstorm there is always a way. If you only want to have the same view (zoom and camera angle) for all the figures:

  1. Open all the figures that you need
  2. With the mouse on one figure, set manually the zoom and camera angle.
  3. Copy that view to all the other figures. On the modified figure, right-click on then Figure > Apply this view to all the figures. Or press =

If you want to be able to numerically set the same view.

  1. Open one figure, and set the view (this is done once)
  2. Run this snippet to get all the variables to reproduce the view:
%% 1. Get all variables to reproduce view
% Get Axes handle
hSrcFig = gcf;
hSrcAxes = findobj(hSrcFig, '-depth', 1, 'Tag', 'Axes3D');
% Get view angle
[az,el] = view(hSrcAxes);
% Get cam position
pos = campos(hSrcAxes);          
% Get cam target
tar = camtarget(hSrcAxes);
% Get cam up vector
up = camup(hSrcAxes);
% Get zoom factor
camva = get(hSrcAxes, 'CameraViewAngle');

To apply this same vire to other 3D figures, use those six variables (az, el, pos, tar, up and camva), in this other snippet:

%% 2. Set (apply) those variables to all 3D figures
% Get all figures 3D figures
hAllFig = bst_figures('GetFiguresByType', {'3DViz'});
for i = 1:length(hAllFig)
    % Get Axes handle
    hDestAxes = findobj(hAllFig(i), '-depth', 1, 'Tag', 'Axes3D');
    % Set view angle
    view(hDestAxes, az, el);
    % Set cam position
    campos(hDestAxes, pos);
    % Set cam target
    camtarget(hDestAxes, tar);
    % Set cam up vector
    camup(hDestAxes, up);
    % Set zoom factor
    set(hDestAxes, 'CameraViewAngle', camva);
end
2 Likes