diff --git a/@Viewer/Viewer.m b/@Viewer/Viewer.m index 2bf4abb08d4b17328d9579a5a6948d085f6e88ff..6b58c95be0fa15eaecf7d1d6010b8650b59aea5e 100644 --- a/@Viewer/Viewer.m +++ b/@Viewer/Viewer.m @@ -66,16 +66,17 @@ classdef Viewer < handle if nDims<=5 switch lower(obj.state) case 'xy' - state_ = [0 0 1 1,0]; + state_ = [0,0,1,1,0]; case 'uv' - state_ = [1 1 0 0,0]; + state_ = [1,1,0,0,0]; case 'ux' - state_ = [1 0 1 0,0]; + state_ = [1,0,1,0,0]; case 'vy' - state_ = [0 1 0 1,0]; + state_ = [0,1,0,1,0]; otherwise error('Unexpected state'); end + state_ = state_(1:nDims); else error('Unexpected number of dimensions in input data'); @@ -83,7 +84,6 @@ classdef Viewer < handle end function range_ = get.range_(obj) - switch lower(obj.range) case 'class' range_ = obj.classRange; @@ -142,7 +142,7 @@ classdef Viewer < handle if obj.validFigure() subind = logical(obj.state); subind(end+1:5) = false; - + coordStr = {'u','v','x','y','c'}; coordStr(subind) = arrayfun(@num2str,obj.curView,'UniformOutput',false); coordStr(~subind) = deal({':'}); @@ -176,6 +176,7 @@ classdef Viewer < handle rangeInd = mod(rangeInd,3)+1; obj.range = obj.validRanges{rangeInd}; end + sz = size(obj.slices); obj.curView = min(sz,max([1,1],curView_)); end @@ -213,5 +214,4 @@ classdef Viewer < handle ~isempty(obj.im)&&isvalid(obj.im); end end -end - +end \ No newline at end of file