Skip to content

Commit

Permalink
Refactor: semicolon.
Browse files Browse the repository at this point in the history
Refactor: flipdims -> flip
  • Loading branch information
btasdelen committed Jun 11, 2022
1 parent 0b81448 commit 6013d74
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
44 changes: 22 additions & 22 deletions arrShow.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
MARKER_COL_REAL= 'yellow'; % default marker color for real valued images
end

properties (Access = private);
properties (Access = private)
updFigCount = 0; % counter for updateFig calls for
% debugging and speed improvements

Expand Down Expand Up @@ -260,8 +260,8 @@

otherwise
error('arrShow:varargin','unknown option [%s]!\n',option);
end;
end;
end
end
clear('option','option_value');
clear('varargin');
% If we don't explicitly delete it here,
Expand Down Expand Up @@ -619,7 +619,7 @@ function refreshRelativesList(obj)
end

if obj.roiExists()
if obj.roi.getSendPositionToggle();
if obj.roi.getSendPositionToggle()
obj.roi.callSendPositionCallback;
end
end
Expand Down Expand Up @@ -787,7 +787,7 @@ function batchExportDimension(obj, dim, filename, createMovie, framerate,...

% loop through all frames in the export dimension
obj.selection.setCurrentVcValue(1);
for i = 1 : dims(dim);
for i = 1 : dims(dim)
if createMovie
obj.exportCurrentImage(vwObj,...
screenshot, includePanels, includeCursor, scrshotPauseTime);
Expand Down Expand Up @@ -917,7 +917,7 @@ function exportCurrentImage(obj, filenameOrVideoWriterObj, screenshot, includePa
return;
end

if exist(filenameOrVideoWriterObj,'file');
if exist(filenameOrVideoWriterObj,'file')
fprintf('Fig. %d: overwriting existing file: %s\n',obj.getFigureNumber, filenameOrVideoWriterObj);
end
end
Expand Down Expand Up @@ -1085,7 +1085,7 @@ function exportImageInfos(obj, filename, appendToFile)

% windowing
cmap = obj.getColormap;
if isnumeric(cmap);
if isnumeric(cmap)
cmap = 'custom';
end

Expand Down Expand Up @@ -1129,7 +1129,7 @@ function exportImageInfos(obj, filename, appendToFile)


% write everything to the text file
for i = 1 : size(text,1);
for i = 1 : size(text,1)
fprintf(fid,'%s\n',text{i});
end

Expand Down Expand Up @@ -1173,7 +1173,7 @@ function exportColorbar(obj, filename)
end

% check if file already exists
if exist(filename,'file');
if exist(filename,'file')
fprintf('Fig. %d: overwriting existing file: %s\n',obj.getFigureNumber(), filename);
end

Expand Down Expand Up @@ -1764,7 +1764,7 @@ function storeColormap(obj, file)
file = [fpath, fname];
end
if ~isempty(file) && ~isa(file,'double')
cm = colormap(obj.fh); %#ok<NASGU> the value is used in the save command
cm = colormap(obj.fh); % the value is used in the save command
save(file,'cm');
end
end
Expand All @@ -1780,7 +1780,7 @@ function loadColormap(obj, file)
end
if ~isempty(file)
cm = load(file,'cm');
if isfield(cm,'cm');
if isfield(cm,'cm')
obj.setColormap(cm.cm);
end
end
Expand Down Expand Up @@ -2566,10 +2566,10 @@ function playButtonCb()

% check, if the image is selected (these lines were sufficient
% in matlab versions prior 2014b)
if strcmp(get(selectedUiObj,'Type'), 'image');
if strcmp(get(selectedUiObj,'Type'), 'image')
bool = true;
imageHandle = selectedUiObj;
elseif(strcmp(get(selectedUiObj,'Type'), 'rectangle'));
elseif(strcmp(get(selectedUiObj,'Type'), 'rectangle'))
% ...and here comes the ugly part:
% try to get the selected image from the childs of the
% parent of the rectangle...
Expand Down Expand Up @@ -2773,7 +2773,7 @@ function createSurfacePlot()
fprintf('Surface plot currently works on single images.\n');
return
end
if isa(imgs,'single');
if isa(imgs,'single')
imgs = double(imgs);
fprintf('Surface plot don''t work with single precision images. Converting to double...\n');
%...this holds true at least for matlab R2013a
Expand Down Expand Up @@ -3405,7 +3405,7 @@ function updFig(obj)

% get the toggle state of 'keep aspect ratio' context menu
% entry
switch get(obj.mbh.aspectRatio,'Checked');
switch get(obj.mbh.aspectRatio,'Checked')
case 'on'
aspectRatio = true;
case 'off'
Expand Down Expand Up @@ -3619,7 +3619,7 @@ function updFig(obj)
end

function errorHandlerInvalidData(obj, ME)
if any(strfind(ME.identifier,'ExpectedFinite')) || ~obj.processingError;
if any(strfind(ME.identifier,'ExpectedFinite')) || ~obj.processingError
% apparently there are invalid values in the data
fprintf('DATA CONTAINS INFINITE VALUES.\nFORCING FULL DATA INSPECTION...');

Expand Down Expand Up @@ -3939,7 +3939,7 @@ function buttonDownCb(obj,src,~)
% check if the current axes has changed
currAxes = get(imageHandle,'Parent');
lastAxes = obj.window.getAxesHandle();
if currAxes ~= lastAxes;
if currAxes ~= lastAxes
% if so:
% delete cursor rectangle from last Axes
ud = get(lastAxes,'UserData');
Expand Down Expand Up @@ -3970,7 +3970,7 @@ function buttonDownCb(obj,src,~)
% check if we did a middle-button click on the image
[bool, imageHandle] = obj.isImageSelected();

if bool && obj.window.getIsEnabled();
if bool && obj.window.getIsEnabled()

% assure that the windowClass is linked to the
% clicked image
Expand Down Expand Up @@ -4001,7 +4001,7 @@ function buttonDownCb(obj,src,~)
end

case 'open' %double click
if obj.window.getIsEnabled();
if obj.window.getIsEnabled()
obj.window.resetWindowing();
obj.mouseMovementMode = 0;
obj.equalizeWindowing();
Expand All @@ -4023,7 +4023,7 @@ function buttonUpCb(obj,src)
if strcmp(get(src,'SelectionType'), 'extend')
% ...and for multiframe views:
% update the windowing of all frames
if obj.window.getIsEnabled();
if obj.window.getIsEnabled()
obj.equalizeWindowing();
end
end
Expand Down Expand Up @@ -4066,7 +4066,7 @@ function mouseMovementCb(obj)
currAxes = get(obj.ih(i),'Parent');
position = get(currAxes,'CurrentPoint');

if arrShow.mouseInsideAxes(position, currAxes);
if arrShow.mouseInsideAxes(position, currAxes)
x = round(position(1,1));
y = round(position(1,2));

Expand Down Expand Up @@ -4203,7 +4203,7 @@ function exportAllGlobalArrayImages()

global asObjs;

if isa(arr,'arrShow');
if isa(arr,'arrShow')
newObj = arr.rebuildObject(varargin{:});
else
if isa(arr,'arrShow2') || isa(arr,'arrShow3')
Expand Down
10 changes: 5 additions & 5 deletions asCursorPosClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
asObj = [];
end

methods (Access = public);
methods (Access = public)
function obj = asCursorPosClass(...
parentFigureHandle,...
parentPanelHandle,...
Expand Down Expand Up @@ -118,7 +118,7 @@ function changePrecisionDlg(obj)
try
num2str(2.3,newPrec);
catch me
if strcmp(me.identifier, 'MATLAB:num2str:fmtInvalid');
if strcmp(me.identifier, 'MATLAB:num2str:fmtInvalid')
fprintf('Invalid precision string format\n');
newPrec = [];
% promt for reenter
Expand Down Expand Up @@ -485,7 +485,7 @@ function updateLayout(obj)
else
if pw > 6
% reduced mode (3 panels)
if obj.complexMode;
if obj.complexMode
createPanel = [1, 0, 0, 1, 1];
% [P, R, I, A, P]
else
Expand All @@ -495,7 +495,7 @@ function updateLayout(obj)
else
if pw > 4
% reduced mode (2 panels)
if obj.complexMode;
if obj.complexMode
createPanel = [1, 0, 0, 1, 0];
% [P, R, I, A, P]
else
Expand All @@ -504,7 +504,7 @@ function updateLayout(obj)
end
else
% single mode (only 1 panel)
if obj.complexMode;
if obj.complexMode
createPanel = [0, 0, 0, 1, 0];
% [P, R, I, A, P]
else
Expand Down
10 changes: 5 additions & 5 deletions asDataClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ function rot90(obj, k)

obj.dat = permute(obj.dat,newOrder);
if k == 1
obj.dat = flipdim(obj.dat,colDims(1));
obj.dat = flip(obj.dat,colDims(1));
else
obj.dat = flipdim(obj.dat,colDims(2));
obj.dat = flip(obj.dat,colDims(2));
end


Expand All @@ -203,7 +203,7 @@ function rot90(obj, k)

function flipDim(obj,dim)
if obj.enableDestrFun
obj.dat = flipdim(obj.dat,dim);
obj.dat = flip(obj.dat,dim);
obj.updFig();
end
end
Expand Down Expand Up @@ -328,7 +328,7 @@ function setDestructiveSelectionString(obj, str)
end

% make sure that there is a semicolon at the end of the string
if ~any(strfind(str,';'));
if ~any(strfind(str,';'))
str = [str,';'];
end

Expand Down Expand Up @@ -691,7 +691,7 @@ function overwriteImageArray(obj, arr)
error('asDataClass:validateImageArray','input dataArrayay has to be at least 2 dimensional');
end

if issparse(dataArray);
if issparse(dataArray)
dataArray = full(dataArray);
end

Expand Down
6 changes: 3 additions & 3 deletions asSelectionClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
otherwise
warning('asSelectionClass:unknownOption',...
'unknown option [%s]!\n',option);
end;
end;
end
end
end


Expand Down Expand Up @@ -213,7 +213,7 @@ function selectVco(obj,selVcoNr)
if retNumAsStr
addr{i} = str;
else
[num,sflag] = str2num(str); %#ok<ST2NM> str is not necessarily a scalar
[num,sflag] = str2num(str); % str is not necessarily a scalar
if sflag == 0
addr{i} = str;
else
Expand Down
4 changes: 2 additions & 2 deletions asValueChangerClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ function setOffset(obj, offs, runUserCb)
% add the offset to the value in the string (to keep the
% actually selected frame constant)
origSel = str2double(origSelStr);
if isnan(origSel);
if isnan(origSel)
% if the current selection cannot be transformed into a
% double, just address the first frame by default
newSel = 1 - offs;
Expand Down Expand Up @@ -788,7 +788,7 @@ function runUserCb(obj)
if nr > obj.max
nr = obj.max;
else
if nr < obj.min;
if nr < obj.min
nr = obj.min;
end
end
Expand Down

0 comments on commit 6013d74

Please sign in to comment.