close all;\r
clear all;\r
\r
-%% vstupni data T:\00-Orvalho\Travnickova\Bubble column\r
-\r
% User dialog for the data directory used for files\r
\r
DirectoryName = get_data_dir();\r
ResFile = [res_path, ResFile];\r
%}\r
\r
+mask = load_mask();\r
+\r
FileType = '*.png';\r
\r
-main_wb = waitbar(0, 'Whole processing progress');\r
% process all directories in cycles\r
for i=1:nSelectedDirectory\r
FileName=([DirectoryName '/' SelectedDirectory{i} '/' FileType]);\r
FFiles = dir(FileName); % Loads files to struct FFiles(1).name, FFiles(1).folder, FFiles(1).date - i s casem\r
\r
- %%D_num=str2double(SelectedDirectory{i}(21)); % position of camera\r
[minfig, maxfig, meanfig] = get_aggregate_images(FFiles);\r
- changefig = maxfig - minfig;\r
- mask = get_mask(changefig, meanfig);\r
- figure();\r
- imshow(meanfig .* uint8(mask));\r
+\r
+ if (i == 1)\r
+ figure();\r
+ imshow(meanfig .* uint8(mask));\r
+ mn = menu('May the computation proceed with this mask?', 'Yes', 'No');\r
+ if (mn == 2)\r
+ close all\r
+ return\r
+ end\r
+ main_wb = waitbar(0, 'Whole processing progress');\r
+ end\r
\r
waitbar((i - 0.5)/nSelectedDirectory, main_wb);\r
\r
--- /dev/null
+clear all
+
+FileType = '*.png';
+
+last_path = get_last_path();
+[filenames, path] = uigetfile([last_path '/' FileType], ...
+ 'Select all files for mask creation', 'MultiSelect', 'on');
+update_last_path(path);
+files = struct('name', cell(1, numel(filenames)), 'folder', cell(1,...
+numel(filenames)));
+[files.name] = deal(filenames{:});
+[files.folder] = deal(path);
+[minfig, maxfig, meanfig] = get_aggregate_images(files);
+changefig = maxfig - minfig;
+mask = get_mask(changefig, meanfig);
+figure();
+imshow(meanfig .* uint8(mask));
+[mask_file_name, mask_path] = uiputfile([path '/*.pbm'], 'Save you mask as...');
+if (mask_file_name ~= 0)
+ imwrite(mask, [mask_path '/' mask_file_name], 'PBM', 'Encoding', 'raw');
+end
--- /dev/null
+function mask = load_mask()
+ path = get_last_path();
+ [mask_file path] = uigetfile([path '/*.pbm'],...
+ 'Select a mask for this batch');
+ mask = double(imread([path '/' mask_file]));
+end