-
Notifications
You must be signed in to change notification settings - Fork 0
/
Choose_Seeds.m
41 lines (28 loc) · 988 Bytes
/
Choose_Seeds.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
function [Condition,Seeds]=Choose_Seeds(O,ch)
Seed_ch=find(O.General_Thresholds.Seed);
Nucleus_ch=find(strcmp(O.General_Thresholds.Label,'Nucleus'));
Cell_ch=find(strcmp(O.General_Thresholds.Label,'Cell'));
if ~isempty(Nucleus_ch) && ...
~isempty(Cell_ch) && ...
ch==Cell_ch && ...
O.General_Thresholds.Intensity_thr(Nucleus_ch)>0 && ...
O.General_Thresholds.smoothing_alpha(Nucleus_ch)>0
Condition='Use Nucleii as seeds';
elseif isempty(Seed_ch)
Condition='each channal with its own seeds';
else
Condition='One seeds channal for all';
end
%% implement watershedding
switch Condition
case 'Use Nucleii as seeds'
Seeds=O.BW{Nucleus_ch};
case 'each channal with its own seeds'
if isempty(O.BW_spots{ch})
Seeds=[];
else
Seeds=O.BW_spots{ch};
end
case 'One seeds channal for all'
Seeds=O.BW_spots{Seed_ch};
end