Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
platy-browser-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kimberly Isobel Meechan
platy-browser-data
Commits
408c9dad
Commit
408c9dad
authored
5 years ago
by
Constantin Pape
Browse files
Options
Downloads
Patches
Plain Diff
Skip invalid labels in morphology computation instead of placeholder features
parent
dd94a972
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/extension/attributes/morphology.py
+1
-3
1 addition, 3 deletions
scripts/extension/attributes/morphology.py
with
1 addition
and
3 deletions
scripts/extension/attributes/morphology.py
+
1
−
3
View file @
408c9dad
...
@@ -198,7 +198,6 @@ def intensity_row_features(raw, mask):
...
@@ -198,7 +198,6 @@ def intensity_row_features(raw, mask):
def
morphology_features_for_label_range
(
table
,
ds
,
ds_raw
,
def
morphology_features_for_label_range
(
table
,
ds
,
ds_raw
,
scale_factor_seg
,
scale_factor_raw
,
scale_factor_seg
,
scale_factor_raw
,
label_begin
,
label_end
):
label_begin
,
label_end
):
n_features
=
4
if
ds_raw
is
None
else
6
label_range
=
np
.
logical_and
(
table
[
'
label_id
'
]
>=
label_begin
,
table
[
'
label_id
'
]
<
label_end
)
label_range
=
np
.
logical_and
(
table
[
'
label_id
'
]
>=
label_begin
,
table
[
'
label_id
'
]
<
label_end
)
sub_table
=
table
.
loc
[
label_range
,
:]
sub_table
=
table
.
loc
[
label_range
,
:]
stats
=
[]
stats
=
[]
...
@@ -213,8 +212,7 @@ def morphology_features_for_label_range(table, ds, ds_raw,
...
@@ -213,8 +212,7 @@ def morphology_features_for_label_range(table, ds, ds_raw,
# foreground in the mask
# foreground in the mask
seg_mask
=
seg
==
label_id
seg_mask
=
seg
==
label_id
if
seg_mask
.
sum
()
==
0
:
if
seg_mask
.
sum
()
==
0
:
result
=
[
float
(
label_id
)]
+
[
0.
]
*
n_features
# if the seg mask is empty, we simply skip this label-id
stats
.
append
(
result
)
continue
continue
# compute the morphology features from the segmentation mask
# compute the morphology features from the segmentation mask
...
...
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