-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainScript.m
53 lines (46 loc) · 1.87 KB
/
mainScript.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
% Author: Izabela M Sztuka
% Before running this script, make sure to read the README file.
clc;
clear;
%----------Set up the paths and directories----------------
% root directory to this folder
root = pwd;
% name of image folder
image_folder = "stimuli";
% output directory
output = fullfile(root, 'output');
% make the output directory if it doesn't exist
if ~exist(output, 'dir')
mkdir(output);
end
% base path
set(0, 'DefaultFigureVisible', 'off');
pathtoolbox = fullfile(root, 'toolbox/'); % path to the toolbox
% Add paths for various toolboxes
ber_path = fullfile(pathtoolbox, 'WholeIm_Decomposer_cc_ims.m'); % path to the Berman toolbox
addpath(genpath(fileparts(ber_path))); % add the directory of the Berman toolbox to the path
path_circ = fullfile(pathtoolbox, 'CircStat2012a/');
addpath(genpath(path_circ));
sed_path = fullfile(pathtoolbox, 'Str_Nstr_DecomposerV3/'); %Str_Nstr_DecompserV3ci.m spatial decomposer
addpath(genpath(sed_path));
color_path = fullfile(pathtoolbox, 'Count_Colors_variableDupIMS.m');
addpath(genpath(color_path));
fractal_path = fullfile(pathtoolbox, 'boxcount.m');
addpath(genpath(fractal_path));
lgn_statistics = fullfile(pathtoolbox, 'LGNstatistics-master/');
addpath(genpath(fileparts(lgn_statistics)));
warning('off', 'all');
%---------------Class Integration----------------
% Initialize the ImageDecomposer class
decomposer = ImageDecomposer(root, output, image_folder);
% Process the images
decomposer.decomposeImages();
%---------------Post-Processing----------------
% load feature names from load_featureheaders.csv
feature_header = readtable(fullfile(root, 'load_featureheaders.csv'));
% load the data
data = readtable(fullfile(output, 'stimuli.csv'));
% add the feature names to the data
data.Properties.VariableNames = feature_header.Properties.VariableNames;
% save the data
writetable(data, fullfile(output, 'stimuli.csv'), 'WriteMode', 'overwrite');