Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alibylite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Swain Lab
aliby
alibylite
Commits
bff61301
Commit
bff61301
authored
3 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
bugfix
parent
a387cfb4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extraction/core/functions/cell.py
+4
-8
4 additions, 8 deletions
extraction/core/functions/cell.py
with
4 additions
and
8 deletions
extraction/core/functions/cell.py
+
4
−
8
View file @
bff61301
...
...
@@ -54,10 +54,8 @@ def max5px_med(cell_mask, trap_image):
top_vals
=
sorted_vals
[
-
5
:]
max5px
=
np
.
mean
(
top_vals
,
dtype
=
float
)
if
max5px
:
return
max5px
/
sorted_vals
[
len
(
sorted_vals
)
//
2
]
else
:
return
max2p5px
med
=
sorted_vals
[
len
(
sorted_vals
)
//
2
]
if
len
(
sorted_vals
)
else
1
return
max2p5px
/
med
def
max2p5pc_med
(
cell_mask
,
trap_image
):
...
...
@@ -68,10 +66,8 @@ def max2p5pc_med(cell_mask, trap_image):
top_vals
=
sorted_vals
[
-
top_pixels
:]
max2p5pc
=
np
.
mean
(
top_vals
,
dtype
=
float
)
if
max2p5pc
:
return
max2p5pc
/
sorted_vals
[
len
(
sorted_vals
)
//
2
]
else
:
return
max2p5pc
med
=
sorted_vals
[
len
(
sorted_vals
)
//
2
]
if
len
(
sorted_vals
)
else
1
return
max2p5pc
/
med
def
std
(
cell_mask
,
trap_image
):
...
...
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