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
5338a634
Commit
5338a634
authored
2 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
feat(tiler): Assume full image if tiler is None
parent
a16bbf60
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
aliby/tile/tiler.py
+24
-15
24 additions, 15 deletions
aliby/tile/tiler.py
with
24 additions
and
15 deletions
aliby/tile/tiler.py
+
24
−
15
View file @
5338a634
...
...
@@ -371,22 +371,31 @@ class Tiler(ProcessABC):
tile_size: integer
The size of a tile
"""
half_tile
=
tile_size
//
2
# max_size is the minimal number of x or y pixels
max_size
=
min
(
self
.
image
.
shape
[
-
2
:])
# first time point, reference channel, reference z-position
initial_image
=
self
.
image
[
0
,
self
.
ref_channel
,
self
.
ref_z
]
# find the traps
trap_locs
=
segment_traps
(
initial_image
,
tile_size
)
# keep only traps that are not near an edge
trap_locs
=
[
[
x
,
y
]
for
x
,
y
in
trap_locs
if
half_tile
<
x
<
max_size
-
half_tile
and
half_tile
<
y
<
max_size
-
half_tile
]
# store traps in an instance of TrapLocations
self
.
trap_locs
=
TrapLocations
.
from_tiler_init
(
trap_locs
,
tile_size
)
if
tile_size
:
half_tile
=
tile_size
//
2
# max_size is the minimal number of x or y pixels
max_size
=
min
(
self
.
image
.
shape
[
-
2
:])
# first time point, reference channel, reference z-position
# find the traps
trap_locs
=
segment_traps
(
initial_image
,
tile_size
)
# keep only traps that are not near an edge
trap_locs
=
[
[
x
,
y
]
for
x
,
y
in
trap_locs
if
half_tile
<
x
<
max_size
-
half_tile
and
half_tile
<
y
<
max_size
-
half_tile
]
# store traps in an instance of TrapLocations
self
.
trap_locs
=
TrapLocations
.
from_tiler_init
(
trap_locs
,
tile_size
)
else
:
yx_shape
=
self
.
image
.
shape
[
-
2
:]
trap_locs
=
[[
x
//
2
for
x
in
yx_shape
]]
self
.
trap_locs
=
TrapLocations
.
from_tiler_init
(
trap_locs
,
max_size
=
min
(
yx_shape
)
)
def
find_drift
(
self
,
tp
):
"""
...
...
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