From: Lukáš Jiřiště Date: Tue, 15 Oct 2024 12:32:14 +0000 (+0200) Subject: Fix major mistakes inside create_ and save_meter X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=dd0c340490b354f33b51bfe4c42462a77acf6586;p=Bubble_column.git Fix major mistakes inside create_ and save_meter I must have not tested it before committing before? --- diff --git a/create_meter.m b/create_meter.m index fef8f24..daa3fba 100644 --- a/create_meter.m +++ b/create_meter.m @@ -1,21 +1,23 @@ clear all oldpath = addpath('./functions'); +FileType = '*.png'; + last_path = get_last_path(); -[filenames, path] = uigetfile([last_path '/*.mtr'], ... +[filenames, last_path] = uigetfile([last_path '/' FileType], ... 'Select all files for meter creation', 'MultiSelect', 'on'); -update_last_path(path); +update_last_path(last_path); mask = load_mask(); files = struct('name', cell(1, numel(filenames)), 'folder', cell(1,... -numel(filenames))); + numel(filenames))); [files.name] = deal(filenames{:}); -[files.folder] = deal(path); +[files.folder] = deal(last_path); [minfig, maxfig, meanfig] = get_aggregate_images(files); meter = get_meter(maxfig, mask); figure(); imshow(meanfig); -[meter_file_name, meter_path] = uiputfile([path '/*.mtr'], 'Save you mask as...'); -if (mask_file_name ~= 0) +[meter_file_name, meter_path] = uiputfile([path '/*.mtr'], 'Save your meter as...'); +if (meter_file_name ~= 0) save_meter([meter_path '/' meter_file_name], meter) end path(oldpath); diff --git a/functions/save_meter.m b/functions/save_meter.m index fb649b0..c86411b 100644 --- a/functions/save_meter.m +++ b/functions/save_meter.m @@ -1,4 +1,4 @@ -function save_meter(meter, fullpath) +function save_meter(fullpath, meter) info = functions(meter); coefs = info.workspace{1}.coefs; writematrix(coefs, fullpath, 'FileType', 'text');