Fix major mistakes inside create_ and save_meter
authorLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 15 Oct 2024 12:32:14 +0000 (14:32 +0200)
committerLukáš Jiřiště <jiriste@icpf.cas.cz>
Tue, 15 Oct 2024 12:32:14 +0000 (14:32 +0200)
I must have not tested it before committing before?

create_meter.m
functions/save_meter.m

index fef8f24ef391a575af6b10814cb8a3505feef3c5..daa3fbaf4353cc6b1e24201e14a387ab3545c7b0 100644 (file)
@@ -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);
index fb649b033d1c8a0eec102d81cbf4f564b2fa20d5..c86411b7f9c233edce51437b1e723c20761e43b4 100644 (file)
@@ -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');