Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge recommended changes from paper review #47

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified +agg/ui_slider2.mlapp
Binary file not shown.
19 changes: 12 additions & 7 deletions +tools/load_imgs.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% the input string, FD. For example, the sample images can be loaded using
% IMGS = load_imgs('images').
%
% IMGS = load_imgs(FD,N) loads the images specified by array N. By
% IMGS = load_imgs(FD, N) loads the images specified by array N. By
% default, N spans 1 to the number of images in the given folder. For
% example, the 2nd and 3rd images can be loaded using N = [2,3]. This
% allows for partial loading of larger data sets for batch processing.
Expand Down Expand Up @@ -95,13 +95,18 @@

%-- Get file information -------------------------------------------------%
while flag == 0
dir_start = 'images'; % initial directory to look for images
dir_start = 'images'; % initial directory to look for images

% Browse or get file information.
if isempty(fd) % if no folder, user browses for images (tif,jpg)
if isempty(fd) % if no folder, user browses for images (tif,jpg)
[fname, folder] = uigetfile({'*.tif;*.jpg;*.png', 'TEM image (*.tif;*.jpg)'}, ...
'Select Images', dir_start, 'MultiSelect', 'on');
else % if folder is given, get all tif files in the folder

elseif isfile(fd) % then a single filename is given
[folder, fname, ext] = fileparts(fd);
fname = [fname, ext];

else % if folder is given, get all tif files in the folder
t0 = [ ... % pattern to match filenames
dir(fullfile(fd,'*.tif')), ... % get TIF
dir(fullfile(fd,'*.jpg'))]; % get JPG
Expand All @@ -110,15 +115,15 @@
end

% Format file information for output
if iscell(fname) % handle a cell array of files
if iscell(fname) % handle a cell array of files
flag = 1;
for ii=length(fname):-1:1
Imgs(ii).fname = fname{ii};
Imgs(ii).folder = [folder, filesep];
end
elseif Imgs.fname==0 % handle when no image was selected
elseif Imgs.fname==0 % handle when no image was selected
error('No image selected.');
else % handle when only one image is selected
else % handle when only one image is selected
Imgs.fname = fname;
Imgs.folder = [folder, filesep];
flag = 1;
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ The submodule is not necessary for any of the scripts or methods included with t

Additional dependencies are required for use of the **[carboseg](https://github.com/tsipkens/atems/tree/master/carboseg)** or convolutional neural network component of this program, including a copy of Python. See the appropriate [section below](#+-carboseg-and-cnn-segmentation) for more information.

This code has been tested on Windows. Linux users may have some issues with loading images when supplying a string to `tools.load_imgs(...)`.

# B. Getting started

The overall structure of scripts associated with this code can be broken down into three steps.
Expand Down
Loading