-
Notifications
You must be signed in to change notification settings - Fork 2
/
picture_load.m
47 lines (32 loc) · 1.14 KB
/
picture_load.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function picture_load
%% Function to load SEM image (.tif file)
% author: [email protected]
gui = guidata(gcf);
gui.flag.picture_load = 0;
%% Import image
refreshdata(gui.handles.ImpImage1File, 'String');
[filenameimage, pathnameimage] = ...
uigetfile({'*.tif', 'All Image Files'}, 'File Selector');
if isequal(filenameimage, 0)
disp('User selected Cancel');
else
disp(['User selected: ', fullfile(pathnameimage, filenameimage)]);
set(gui.handles.ImpImage1File, 'String', filenameimage);
set(gui.figure.main_window, 'CurrentAxes', gui.axes);
%% Plot
zoom reset;
if filenameimage ~= 0
%cd(pathnameimage);
[gui.picture.rawImages] = imread(fullfile(pathnameimage, filenameimage));
% --- Scale down large images
gui.picture.high = im2uint16(gui.picture.rawImages);
gui.picture.sem_image = imshow(gui.picture.high);
end
gui.config.filenameimage = filenameimage;
gui.config.pathnameimage = pathnameimage;
gui.flag.picture_load = 1;
end
gui.picture.filenameimage_rotated = [];
gui.picture.filenameimage_cropped = [];
guidata(gcf, gui);
end