Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
leverjs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
leverjs
Commits
cd3bbbf9
Commit
cd3bbbf9
authored
Nov 5, 2020
by
actb
Browse files
Options
Downloads
Patches
Plain Diff
ensembleseg : use mean, new cell efficiency
parent
11e59f4d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
matlab/+Ensemble/+Draw/recapScore.m
+27
-0
27 additions, 0 deletions
matlab/+Ensemble/+Draw/recapScore.m
matlab/+Ensemble/processEnsemble.m
+9
-8
9 additions, 8 deletions
matlab/+Ensemble/processEnsemble.m
matlab/+Ensemble/setCellEfficiency.m
+1
-1
1 addition, 1 deletion
matlab/+Ensemble/setCellEfficiency.m
with
37 additions
and
9 deletions
matlab/+Ensemble/+Draw/recapScore.m
0 → 100644
+
27
−
0
View file @
cd3bbbf9
% score the cells in nest
time
=
1
iNest
=
71
q
=
fetch
(
conn
,[
'select * from tblEnsemble where time='
num2str
(
time
)
' and iNest='
...
num2str
(
iNest
)]);
[
im
]
=
DenoiseCache
.
readImages
(
time
,
CONSTANTS
,
segParams
,[]);
cx
=
[];
for
i
=
1
:
length
(
q
.
time
)
nc
=
Ensemble
.
makeEnsembleCell
(
q
(
i
,:));
cx
=
[
cx
,
nc
];
end
cx
=
Ensemble
.
setCellEfficiency
(
cx
,
im
,
segParams
);
% find rp
cx
=
Read
.
setCellsIdxPts
(
cx
,
CONSTANTS
);
for
i
=
1
:
length
(
cx
)
L
=
0
*
im
;
L
(
cx
(
i
)
.
idxPts
)
=
1
;
rp
=
regionprops
(
L
,
'area'
,
'convexarea'
,
'circularity'
);
cx
(
i
)
.
area
=
rp
.
Area
;
cx
(
i
)
.
ConvexArea
=
rp
.
ConvexArea
;
cx
(
i
)
.
convDef
=
rp
.
Area
/
rp
.
ConvexArea
;
cx
(
i
)
.
circularity
=
rp
.
Circularity
;
end
This diff is collapsed.
Click to expand it.
matlab/+Ensemble/processEnsemble.m
+
9
−
8
View file @
cd3bbbf9
...
@@ -155,17 +155,18 @@ for j=1:length(nestedCells{ic})
...
@@ -155,17 +155,18 @@ for j=1:length(nestedCells{ic})
% question of combining function -- min,max,mean,etc. relates to
% question of combining function -- min,max,mean,etc. relates to
% cluster structure function. empirically chose min.
% cluster structure function. empirically chose min.
% and on Dec 13 2019 tried max and mean as well. chose mean for now..:)
% and on Dec 13 2019 tried max and mean as well. chose mean for now..:)
scoreJ
(
j
)
=
max
([
nestedCells
{
ic
}(
cellsJ
{
j
})
.
score
]);
% scoreJ(j)=max([nestedCells{ic}(cellsJ{j}).score]);
scoreJ
(
j
)
=
mean
([
nestedCells
{
ic
}(
cellsJ
{
j
})
.
score
]);
nestedCells
{
ic
}(
j
)
.
nest
.
score
=
scoreJ
(
j
);
nestedCells
{
ic
}(
j
)
.
nest
.
score
=
scoreJ
(
j
);
end
end
% ensemble vote on k -- score+=#k/total#
% ensemble vote on k -- score+=#k/total#
nx
=
[
nestedCells
{
ic
}
.
nest
];
%
nx=[nestedCells{ic}.nest];
lx
=
cellfun
(
@
length
,{
nx
.
segList
});
%
lx=cellfun(@length,{nx.segList});
for
j
=
1
:
length
(
scoreJ
)
%
for j=1:length(scoreJ)
k
=
length
(
nestedCells
{
ic
}(
j
)
.
nest
.
segList
);
%
k=length(nestedCells{ic}(j).nest.segList);
pk
=
length
(
find
(
lx
==
k
))/
length
(
lx
);
%
pk=length(find(lx==k))/length(lx);
scoreJ
(
j
)
=
scoreJ
(
j
)
+
pk
;
%
scoreJ(j)=scoreJ(j)+pk;
end
%
end
% now pick the best of the combi nations
% now pick the best of the combi nations
[
mm
,
idx
]
=
max
(
scoreJ
);
[
mm
,
idx
]
=
max
(
scoreJ
);
newCells
=
nestedCells
{
ic
}(
cellsJ
{
idx
});
newCells
=
nestedCells
{
ic
}(
cellsJ
{
idx
});
...
...
This diff is collapsed.
Click to expand it.
matlab/+Ensemble/setCellEfficiency.m
+
1
−
1
View file @
cd3bbbf9
...
@@ -48,7 +48,7 @@ for i=1:length(Cells)
...
@@ -48,7 +48,7 @@ for i=1:length(Cells)
imBackgroundEff
=
1
;
imBackgroundEff
=
1
;
else
else
% high number means cell pixels are brighter than background
% high number means cell pixels are brighter than background
imBackgroundEff
=
mean
(
im
(
idxPts
)
-
T
(
idxPts
));
imBackgroundEff
=
mean
(
im
(
idxPts
)
-
T
(
idxPts
))
/
mean
(
im
(
bw
)
-
T
(
bw
))
;
end
end
% how dark on average the surface neighborhood is (1 is good)
% how dark on average the surface neighborhood is (1 is good)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment