Minor improvements, modifications
This commit is contained in:
parent
e08e0284fe
commit
ebb0552866
@ -5,15 +5,27 @@ function runInteractiveFeatureDetectorGUI(od_imgs, scan_parameter_values, file_l
|
||||
numImages = numel(od_imgs);
|
||||
currentFrame = 1;
|
||||
|
||||
%% --- Create figure
|
||||
hFig = figure('Name','Interactive Feature Detector',...
|
||||
'NumberTitle','off','Position',[100 100 1275 800],...
|
||||
'KeyPressFcn',@keyPressCallback);
|
||||
%% --- Create figure ---
|
||||
% Try to find an existing figure by a unique tag
|
||||
hFig = findobj('Type','figure','Tag','InteractiveFeatureDetector');
|
||||
|
||||
if isempty(hFig)
|
||||
% If not found, create a new figure
|
||||
hFig = figure('Name','OD Image Feature Detector', ...
|
||||
'NumberTitle','off', ...
|
||||
'Position',[100 100 1275 800], ...
|
||||
'KeyPressFcn',@keyPressCallback, ...
|
||||
'Tag','InteractiveFeatureDetector'); % <-- unique tag
|
||||
else
|
||||
% If figure exists, bring it to front
|
||||
figure(hFig);
|
||||
clf;
|
||||
end
|
||||
|
||||
%% --- Axes
|
||||
%% --- Axes ---
|
||||
hAx = axes('Parent',hFig,'Position',[0.025 0.1 0.6 0.85]);
|
||||
|
||||
%% --- Frame slider
|
||||
%% --- Frame slider ---
|
||||
hSlider = uicontrol('Style','slider','Min',1,'Max',numImages,'Value',1,...
|
||||
'SliderStep',[1/(numImages-1),10/(numImages-1)],...
|
||||
'Units','normalized','Position',[0.075 0.01 0.5 0.025],...
|
||||
|
||||
@ -6,19 +6,33 @@ function runInteractiveODImageViewer(od_imgs, scan_parameter_values, file_list,
|
||||
% options : struct with fields
|
||||
% .pixel_size, .magnification, .center, .font, .zoom_size, .scan_parameter
|
||||
|
||||
% Figure
|
||||
hFig = figure('Name', 'OD Image Viewer', 'NumberTitle', 'off', 'Position', [50 50 1000 800]);
|
||||
%% --- Create Figure ---
|
||||
% Try to find an existing figure by a unique tag
|
||||
hFig = findobj('Type','figure','Tag','InteractiveImageViewer');
|
||||
|
||||
if isempty(hFig)
|
||||
% If not found, create a new figure
|
||||
hFig = figure('Name','OD Image Viewer', ...
|
||||
'NumberTitle','off', ...
|
||||
'Position', [50 50 1000 800], ...
|
||||
'KeyPressFcn',@keyPressCallback, ...
|
||||
'Tag','InteractiveImageViewer'); % <-- unique tag
|
||||
else
|
||||
% If figure exists, bring it to front
|
||||
figure(hFig);
|
||||
clf;
|
||||
end
|
||||
|
||||
% Get image size
|
||||
%% --- Get image size ---
|
||||
[Ny, Nx] = size(od_imgs{1});
|
||||
|
||||
% Pixel size and axes in μm
|
||||
%% --- Pixel size and axes in μm ---
|
||||
dx = options.pixel_size / options.magnification;
|
||||
dy = dx; % square pixels
|
||||
x = ((1:Nx) - (Nx+1)/2) * dx * 1e6;
|
||||
y = ((1:Ny) - (Ny+1)/2) * dy * 1e6;
|
||||
|
||||
% Display first image
|
||||
%% --- Display first image ---
|
||||
hAx = axes('Parent', hFig);
|
||||
hImg = imagesc(hAx, x, y, od_imgs{1});
|
||||
axis(hAx, 'equal', 'tight')
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
dataSources = {
|
||||
struct('sequence', 'TwoDGas', ...
|
||||
'date', '2025/06/23', ...
|
||||
'runs', [0]) % specify run numbers as a string in "" or just as a numeric value
|
||||
'runs', [300]) % specify run numbers as a string in "" or just as a numeric value
|
||||
};
|
||||
|
||||
options = struct();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user