Skip to content

Commit

Permalink
Updated montage('regioncenters') to support flexible orientations
Browse files Browse the repository at this point in the history
  • Loading branch information
bogpetre committed Jan 30, 2024
1 parent aab9325 commit 12c931a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
7 changes: 6 additions & 1 deletion CanlabCore/@region/montage.m
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@
end

if dozoom
zoom_in_on_regions(o2, obj, 'axial'); % hard-coded for now, could change orientation...must make flexible in canlab_results_fmridisplay
wh = ismember(varargin,{'axial','saggital','coronal'});
if any(wh)
zoom_in_on_regions(o2, obj, varargin{wh});
else
zoom_in_on_regions(o2, obj, 'axial');
end
end

drawnow
Expand Down
28 changes: 21 additions & 7 deletions CanlabCore/Visualization_functions/canlab_results_fmridisplay.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
outlinecolor = [0 0 0];
splitcolor = {[0 0 1] [0 .8 .8] [1 .4 .5] [1 1 0]}; % {[0 0 1] [.3 .6 .9] [.8 .3 0] [1 1 0]}; % more straight orange to yellow: {[0 0 1] [0 1 1] [1 .5 0] [1 1 0]}
montagetype = 'compact';
orientation = 'axial';
doverbose = true;
%overlay='SPM8_colin27T1_seg.img';
% overlay = 'fmriprep20_template.nii.gz';
Expand Down Expand Up @@ -240,12 +241,6 @@
varargin(wh) = [];
end

wh = strcmp(varargin, 'blobcenters');
if any(wh), montagetype = varargin{find(wh)}; varargin(wh) = []; end

wh = strcmp(varargin, 'regioncenters');
if any(wh), montagetype = varargin{find(wh)}; varargin(wh) = []; end

wh = strcmp(varargin, 'full hcp');
if any(wh), montagetype = varargin{find(wh)}; varargin(wh) = []; end

Expand All @@ -267,6 +262,26 @@
wh = strcmp(varargin, 'allslices');
if any(wh), montagetype = varargin{find(wh)}; varargin(wh) = []; end

% if these are run before coronal/saggital arguments are parsed they will
% overwrite the blob/regioncenters argument, so run these last.
wh = strcmp(varargin, 'blobcenters');
if any(wh)
if ismember(montagetype,{'coronal','saggital'})
orientation = montagetype;
end
montagetype = varargin{find(wh)};
varargin(wh) = [];
end

wh = strcmp(varargin, 'regioncenters');
if any(wh)
if ismember(montagetype,{'coronal','saggital'})
orientation = montagetype;
end
montagetype = varargin{find(wh)};
varargin(wh) = [];
end

wh = strcmp(varargin, 'noverbose');
if any(wh), doverbose = false; end

Expand Down Expand Up @@ -329,7 +344,6 @@
% onerowstr = [];
% if length(cl) < 20, onerowstr = 'onerow'; end

orientation = 'axial';

% Make a grid - determine subplots
nr = floor(sqrt(length(cl)));
Expand Down

0 comments on commit 12c931a

Please sign in to comment.