classdef roiApp_example < matlab.apps.AppBase
properties (Access = public)
UIFigure matlab.ui.Figure
ImageAxes matlab.ui.control.UIAxes
LoadImageButton matlab.ui.control.Button
projectionDropdown matlab.ui.control.DropDown
roiBackgroundButton matlab.ui.control.Button
end
methods (Access = private)
function createComponents(app)
disp(pwd)
addpath([pwd,'/icons/']);
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.AutoResizeChildren = 'off';
app.UIFigure.Position = [100 100 1500 900];
app.UIFigure.Name = 'ROI drawer App';
app.UIFigure.Resize = 'off';
app.ImageAxes = uiaxes(app.UIFigure);
app.ImageAxes.XTick = [];
app.ImageAxes.XTickLabel = {'[ ]'};
app.ImageAxes.YTick = [];
app.ImageAxes.Position = [1 181 0.45*app.UIFigure.Position(3) 0.45*app.UIFigure.Position(3)];
app.ImageAxes.Interactions = [zoomInteraction, regionZoomInteraction];
app.LoadImageButton = uibutton(app.UIFigure, 'push');
app.LoadImageButton.ButtonPushedFcn = createCallbackFcn(app, @LoadImage, true);
app.LoadImageButton.Position = [20 10 225 22];
app.LoadImageButton.Text = 'Load Tiff stack';
app.projectionDropdown = uidropdown(app.UIFigure);
app.projectionDropdown.ValueChangedFcn = createCallbackFcn(app, @ChangeProjection, true);
app.projectionDropdown.Position = [250 10 225 22];
app.projectionDropdown.Items = {'Min', 'Mean', 'Max'};
app.projectionDropdown.Value = 'Max';
app.roiBackgroundButton = uibutton(app.UIFigure, 'push');
app.roiBackgroundButton.Position = [630 60 75 75];
app.roiBackgroundButton.Text = '';
app.roiBackgroundButton.Tooltip = 'Background';
app.roiBackgroundButton.Icon = imread('icons/background.png');
app.roiBackgroundButton.BackgroundColor = '#e6e6e6';
app.roiBackgroundButton.ButtonPushedFcn = createCallbackFcn(app, @add_background_ROI, true);
app.UIFigure.Visible = 'on';
end
end
methods (Access = public)
function startupFcn(app)
app.ImageAxes.Visible = 'off';
app.ImageAxes.Colormap = gray(256);
axis(app.ImageAxes, 'image');
end
function app = roiApp_example
createComponents(app)
registerApp(app, app.UIFigure)
runStartupFcn(app, @startupFcn)
if nargout == 0
clear app
end
end
function delete(app)
delete(app.UIFigure)
end
end
end