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
a75aaa90
Commit
a75aaa90
authored
May 17, 2020
by
ac 20
Browse files
Options
Downloads
Patches
Plain Diff
allocateShake: restore size kilt kernels, aiareaOpen speed
parent
003745f0
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/+Segment/aiAreaOpen.m
+9
-1
9 additions, 1 deletion
matlab/+Segment/aiAreaOpen.m
matlab/+Segment/allocateShake.m
+24
-9
24 additions, 9 deletions
matlab/+Segment/allocateShake.m
matlab/+Segment/getParams.m
+7
-0
7 additions, 0 deletions
matlab/+Segment/getParams.m
with
40 additions
and
10 deletions
matlab/+Segment/aiAreaOpen.m
+
9
−
1
View file @
a75aaa90
...
...
@@ -16,4 +16,12 @@ if ~is3D(bw)
end
ee
=
HIP
.
MakeEllipsoidMask
(
maskRadius
);
bwSeeds
=
imerode
(
bw
,
ee
);
bw
=
imreconstruct
(
bwSeeds
,
bw
);
% bw=imreconstruct(bwSeeds,bw);
% faster by 2x compared to imreconstruct...
idx
=
find
(
bwSeeds
);
cc
=
bwconncomp
(
bw
);
L
=
labelmatrix
(
cc
);
idxIntersect
=
cellfun
(
@
(
x
)
intersect
(
x
,
idx
),
cc
.
PixelIdxList
,
'UniformOutput'
,
false
);
idxDelete
=
cellfun
(
@
isempty
,
idxIntersect
);
bw
(
vertcat
(
cc
.
PixelIdxList
{
idxDelete
}))
=
0
;
This diff is collapsed.
Click to expand it.
matlab/+Segment/allocateShake.m
+
24
−
9
View file @
a75aaa90
function
[
L
,
num
,
bwBoundary
]
=
allocateShake
(
bw
,
bw2
,
min_radius_pixels
,
segParams
)
bwBoundary
=
assignShake
(
bw
,
bw2
,
true
);
bwReduce
=
Segment
.
aiAreaOpen
(
bwBoundary
,
min_radius_pixels
);
% any components that were not big enough?
if
find
(
bwBoundary
&
~
bwReduce
,
1
,
'first'
)
% "re-absorb" components too small to exist on their own
% allow disconnected components in case whole CC was removed
bwBoundary
=
assignShake
(
bwReduce
,
bw2
,
false
);
bwBoundary
=
Segment
.
aiAreaOpen
(
bwBoundary
,
min_radius_pixels
);
end
% now, the boundary has been resent, label that and done
[
L
,
num
]
=
bwlabeln
(
bwBoundary
);
return
function
bwBoundary
=
assignShake
(
bw
,
bw2
,
bNoDisconnected
)
d
=
bwdist
(
bw
);
L
=
watershed
(
d
);
L
(
~
bw2
)
=
0
;
bwBoundary
=
logical
(
L
);
% cell image with boundaries set to 0
% don't allow disconnected components
if
bNoDisconnected
[
LX
,
nx
]
=
bwlabeln
(
bwBoundary
);
idx
=
unique
(
LX
(
bw
));
% the boundary image, remove the connected components not from bw (e.g.
% bw2 only)
bwBoundary
=
bwBoundary
&
ismember
(
LX
,
idx
);
bwBoundary
=
Segment
.
aiAreaOpen
(
bwBoundary
,
min_radius_pixels
);
end
% now, the boundary has been resent, label that and done
[
L
,
num
]
=
bwlabeln
(
bwBoundary
);
return
This diff is collapsed.
Click to expand it.
matlab/+Segment/getParams.m
+
7
−
0
View file @
a75aaa90
...
...
@@ -24,6 +24,13 @@ for i=1:length(names)
segParams
=
setfield
(
segParams
,
names
{
i
},
fv
);
end
end
% convert to row vectors for easier readability
if
isfield
(
segParams
,
'minimumRadius_um'
)
segParams
.
minimumRadius_um
=
segParams
.
minimumRadius_um
(:)
'
;
end
if
isfield
(
segParams
,
'NLM'
)
segParams
.
NLM
=
segParams
.
NLM
(:)
'
;
end
...
...
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