-
Notifications
You must be signed in to change notification settings - Fork 0
/
pAnalAllFiles.m
61 lines (55 loc) · 1.85 KB
/
pAnalAllFiles.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
%switch to appropriate directory to import photos/confirm analysis group
whichDir = input('Enter full location of photos to analyze as a string ');
cd(whichDir);
treatgp = input('If group to analyze is 10D5, type "y" ');
jpegFiles = dir('*.jpg');
numfiles = length(jpegFiles);
allImgs = cell(1, numfiles);
for k = 1:numfiles
allImgs{k} = imread(jpegFiles(k).name);
end
%switch back to script directory and run analysis
cd('H:\apps\xp\desktop\Sadowski Lab\Matlab Files');
%Assumes order of files is split evenly into halves
%If not, iteration may need adjustment
if treatgp == 'y'
%10D5
perPlaqueTreatAvgs = zeros(1, numfiles/2);
normTreatAvgs = zeros(1, numfiles/2);
normIm1TreatAvgs = zeros(1, numfiles/2);
nPareaVsImg1AvgsTreat = [];
allImg1Avgs = [];
allImg2Avgs = [];
for g=1:(numfiles/2)
img1 = allImgs{g};
img2 = allImgs{g+(numfiles/2)};
pAnalysis;
perPlaqueTreatAvgs(g) = normIm1PerPlaque;
%normTreatAvgs(g) = normpp;
normIm1TreatAvgs(g) = normIm1Int;
nPareaVsImg1AvgsTreat = [nPareaVsImg1AvgsTreat; nPareaVsImg1Avgs];
allImg1Avgs = [allImg1Avgs, img1avgs];
allImg2Avgs = [allImg2Avgs, img2avgs];
disp(g)
end
else
%TY11
perPlaqueCtrlAvgs = zeros(1, numfiles/2);
normCtrlAvgs = zeros(1, numfiles/2);
normIm1CtrlAvgs = zeros(1, numfiles/2);
nPareaVsImg1AvgsCtrl = [];
allImg1Avgs = [];
allImg2Avgs = [];
for g=1:(numfiles/2)
img1 = allImgs{g};
img2 = allImgs{g+(numfiles/2)};
pAnalysis;
perPlaqueCtrlAvgs(g) = normIm1PerPlaque;
%normCtrlAvgs(g) = normpp;
normIm1CtrlAvgs(g) = normIm1Int;
nPareaVsImg1AvgsCtrl = [nPareaVsImg1AvgsCtrl; nPareaVsImg1Avgs];
allImg1Avgs = [allImg1Avgs, img1avgs];
allImg2Avgs = [allImg2Avgs, img2avgs];
disp(g)
end
end