From c4f50e772ae64fb7731f6aa3d3f848e6e0b49f18 Mon Sep 17 00:00:00 2001 From: aditiiyer Date: Wed, 10 May 2017 16:23:08 -0400 Subject: [PATCH] goto fn: Added option 'all' to search through all scansets --- CERR_core/CommandLine/runCERRCommand.m | 15 +++++++++++---- CERR_core/Utilities/goto.m | 8 ++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CERR_core/CommandLine/runCERRCommand.m b/CERR_core/CommandLine/runCERRCommand.m index e1d527f8e..7ffec109d 100644 --- a/CERR_core/CommandLine/runCERRCommand.m +++ b/CERR_core/CommandLine/runCERRCommand.m @@ -578,19 +578,26 @@ % Pass variable to "goto" command goto('max') - elseif numWords == 4 - + elseif numWords > 3 + if numWords==4 w4 = word(in_str,4); w4 = str2num(w4); % only numeric data type supported goto(w3,w4) - - else + elseif strcmpi(word(in_str,5),'all') + w4 = word(in_str,4); + w4 = str2num(w4); % only numeric data type supported + w5 = word(in_str,5); + goto(w3,w4,w5) + + else % Get the slice number passed num = str2num(word(in_str,3)); % Pass variable to "goto" command goto('slice',num); + end + end case 'mask' %show a spy mask of values included in an ROI diff --git a/CERR_core/Utilities/goto.m b/CERR_core/Utilities/goto.m index ba0bbe78d..1506f649e 100644 --- a/CERR_core/Utilities/goto.m +++ b/CERR_core/Utilities/goto.m @@ -129,11 +129,19 @@ function goto(command,varargin) val = varargin{1}; hAxis = gca; + if nargin==2 % Find the scan displayed on the current axis scanSet = getAxisInfo(hAxis,'scanSets'); scanTypesC = {planC{indexS.scan}(:).scanType}; scanType = planC{indexS.scan}(scanSet).scanType; scanNumsV = find(strcmpi(scanType,scanTypesC)); + else + if ~strcmp (varargin{2},'all') + return + else + scanNumsV = 1:length(planC{indexS.scan}); + end + end % Loop through scans and slices to find the matching tag %numScans = length(planC{indexS.scan}); for scanNum = scanNumsV