forked from carmlingling/PeGSVector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PeGSModular.m
executable file
·91 lines (85 loc) · 3.19 KB
/
PeGSModular.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
%%New version of PeGS using a modular format, Adapted from Jonathan
%%Kollmer's PeGS installation in matlab Github link by Carmen Lee
%%Began on June 24
%%Ideally, this script will call various modules included in this folder
%%and will only requre some user input values. These include the image
%%location, boundary (for the annulus data and airtable data from K.
%%Daniels lab at NCSU)
function PeGSModular(topDirectory, imageNames)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%User input values
%topDirectory = '/mnt/ncsudrive/c/cllee3/MyEno/DATA/jekollme/20160701/Steps/artificial/'
topDirectory = '/eno/cllee3/DATA/240603/run1/' % location of image files
%topDirectory = './testdata/square/'
%topDirectory = '/Users/carmenlee/Desktop/20150731reprocesseduniaxial/'
% %topDirectory = './DATA/test/Step09/'
imageNames = '200Hz_5spfT_*.jpg'; %image format and regex
frameidind = 16;
%
%files = dir([topDirectory,imageNames])
boundaryType = "annulus"; %if airtable use "airtable" if annulus use "annulus"
radiusRange = [40, 57];
%radiusRange = [45, 78]; %airtable
verbose = false;
% if (isfile([topDirectory, 'log.txt']))
% fid = fopen([topDirectory, 'log.txt'], 'r');
%
% % Read data using textscan
% data = textscan(fid, '%s %s', 'HeaderLines', 1, 'Delimiter', ':');
%
% % Close the file
% fclose(fid);
% % Extract relevant data
% nFrames_index = find(strcmp(data{1}, 'nFrames'));
% nFrames = str2num(data{2}{nFrames_index});
%
% radiusRange_index = find(strcmp(data{1}, 'radiusRange'));
% radiusRange_str = data{2}{radiusRange_index};
% radiusRange = str2num(radiusRange_str);
%
% cen_index = find(strcmp(data{1}, 'cen'));
% cen_str = data{2}{cen_index};
% cen = str2num(cen_str);
%
% rad_index = find(strcmp(data{1}, 'rad'));
% rad_str = data{2}{rad_index};
% rad = str2num(rad_str);
%
% data = [nFrames, rad, cen, radiusRange]
% % Display the extracted data
% disp(['Number of Frames: ', num2str(nFrames)]);
% disp(['Radius Range: ', num2str(radiusRange)]);
% disp(['Center: ', num2str(cen)]);
% disp(['Radius: ', num2str(rad)]);
%
% end
if not(isfolder(append(topDirectory,'adjacency'))) %make a new folder with warped images
mkdir(append(topDirectory,'adjacency'));
end
if not(isfolder(append(topDirectory,'solved'))) %make a new folder with warped images
mkdir(append(topDirectory,'solved'));
end
if not(isfolder(append(topDirectory,'synthImg'))) %make a new folder with warped images
mkdir(append(topDirectory,'synthImg'));
end
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%preprocess(topDirectory, imageNames, boundaryType, verbose);
%%
%particleDetect(topDirectory, imageNames, radiusRange, boundaryType, verbose);
'particles detected'
%%
%particleTrack(topDirectory, imageNames, boundaryType, frameidind, verbose, false);
'trajectories connected'
%%
%contactDetection(topDirectory, imageNames, boundaryType,frameidind, verbose)
'contacts detected'
%%
%diskSolve(topDirectory, imageNames, boundaryType, verbose)
'forces solved'
%%
newtonize(topDirectory, imageNames, boundaryType, verbose)
'newtonized and edges handled'
%%
adjacencyMatrix(topDirectory, imageNames, boundaryType, frameidind,verbose)
'Adjacency matrix built'