Skip to content

Commit

Permalink
Merge pull request #47 from tsipkens/patch
Browse files Browse the repository at this point in the history
Merge recommended changes from paper review
  • Loading branch information
tsipkens authored Apr 10, 2024
2 parents e49530a + 3fea642 commit cd661f0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
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

0 comments on commit cd661f0

Please sign in to comment.