-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeanOfAllCell.m
120 lines (92 loc) · 4.38 KB
/
meanOfAllCell.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
clear all
dt_path_wt={ '../data/Nuclei_and_Cells_DT_S18_m6_wt/', '../data/Nuclei_and_Cells_DT_S17_m2_wt/',...
'../data/Nuclei_and_Cells_DT_S84_m3_wt/', '../data/Nuclei_and_Cells_DT_S51_m2_wt/',...
'../data/Nuclei_and_Cells_DT_S84_m4_wt/'};
pt_path_wt = { '../data/Nuclei_and_Cells_PT_S18_m6_wt/','../data/Nuclei_and_Cells_PT_S17_m2_wt/',...
'../data/Nuclei_and_Cells_PT_S84_m3_wt/','../data/Nuclei_and_Cells_PT_S51_m2_wt/',...
'../data/Nuclei_and_Cells_PT_S84_m4_wt/'};
dt_path_mut= {'../data/Nuclei_and_Cells_DT_S17_m1_mut/', '../data/Nuclei_and_Cells_DT_S18_m2_mut/' ,...
'../data/Nuclei_and_Cells_DT_S84_m1_mut/', '../data/Nuclei_and_Cells_DT_S84_m5_mut/'};
pt_path_mut = {'../data/Nuclei_and_Cells_PT_S17_m1_mut/', '../data/Nuclei_and_Cells_PT_S18_m2_mut/',...
'../data/Nuclei_and_Cells_PT_S84_m1_mut/', '../data/Nuclei_and_Cells_PT_S84_m5_mut/', };
du_path_wt={'../data/Nuclei_and_Cells_DU_S51_m2_wt/','../data/Nuclei_and_Cells_DU_S84_m2_wt/','../data/Nuclei_and_Cells_DU_S84_m3_wt/'};
allpath={dt_path_wt; pt_path_wt; dt_path_mut; pt_path_mut; du_path_wt};
%allpath={du_path_wt};
% the columns contains the individual nuclei features
% 1 - stack id
% 2 - volume
% 3 - surface area
% 4 - sphericity
% 5-7 - centroid x,y,z coordinates
% 8-10 - PC1 x,y,z orientation
% 11-13 - PC2 x,y,z orientation
% 14-16 - PC3 x,y,z orientation
% 17-19 - PC1,PC2,PC3 latent coefficient
% 20 - Delaunay density
mycolor={'r.','b.','g.','m.','k.'};
nucallcolor={'r--','b--','g--','m--','k--'};
fcelallcolor={'ro-','bo-','go-','mo-','ko-'};
fnucallcolor={'ro--','bo--','go--','mo--','ko--'};
h1=figure();
set(gcf, 'PaperSize', [13 10]);
set(gcf, 'PaperPosition', [0 0 13 10]);
count=1;
for bonetype=1:5
path=allpath{bonetype};
clear col1avg
clear col2avg
clear col3avg
clear col4avg
subplot(2,3,bonetype)
for fi=1:length(path)
b1=load(['../../',path{fi},'all_cells.mat']);
cel=b1.all_cells;
clear celcent
s=strsplit(path{fi},'Nuclei_and_Cells_');
%input2=strcat('Columnar_Structure_Prediction_8_100/',s{2});
%doubletIndex=load([input2,'LCC_final.dat']);
%input1=strcat('MakeListColumnarStructurePrediction/',s{2});
%load([input1,'centroid_and_surface_cells.mat']);
%temp=unique(doubletIndex(:));
if (bonetype==3)|(bonetype==1)
celcent(:,1:3)=[cel(:,5),cel(:,6),-cel(:,7)];
%coordinate=[centroid(temp,1),centroid(temp,2),-centroid(temp,3)];
else
celcent(:,1:3)=[cel(:,5),cel(:,6),cel(:,7)];
%coordinate=[centroid(temp,1),centroid(temp,2),centroid(temp,3)];
end
meanofallcell=mean(celcent);
celcent=celcent-meanofallcell;
%doubletCoordinates=coordinate-meanofallcell;
% plot(doubletCoordinates(:,1),doubletCoordinates(:,2),'b.');
% hold on
data(count,:)=[meanofallcell,min(celcent),max(celcent)];
count=count+1;
end
end
% axis image
% view(90,0);
% xlabel('X');
% ylabel('y');
% zlabel('z');
saveas(h1,['DoubletPositionsIn2D.png']);
function [positioninGrowthPlate,centroidZ,Xinterval,youtput]= makeProfile(centroidZ,data,profilesize,zpositionofcolumn)
%centroidZ=centroid(:,3);
minl=min(centroidZ); maxl=max(centroidZ);
Yinterval=linspace(minl-0.00001,maxl+0.00001,profilesize);
Xinterval=zeros(1,length(Yinterval));
binsize=Yinterval(2)-Yinterval(1);
horizontalCount=cell(1,length(Yinterval));
positioninGrowthPlate=zeros(size(zpositionofcolumn));
for k=1:length(Yinterval)
horizontalCount{k}=[];
for tt=1:length(zpositionofcolumn)
if (zpositionofcolumn(tt) > Yinterval(k)) & (zpositionofcolumn(tt) <= Yinterval(k+1))
horizontalCount{k}=[horizontalCount{k},tt];
positioninGrowthPlate(tt,1)=k;
end
end
Xinterval(k)=mean(data(horizontalCount{k}));
end
youtput=Yinterval+binsize/2;
end