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
5e2d2a6e
Commit
5e2d2a6e
authored
3 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
drift bugfix
parent
f5285e41
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
+8
-9
8 additions, 9 deletions
aliby/tile/tiler.py
with
8 additions
and
9 deletions
aliby/tile/tiler.py
+
8
−
9
View file @
5e2d2a6e
...
@@ -53,7 +53,7 @@ class Trap:
...
@@ -53,7 +53,7 @@ class Trap:
def
at_time
(
self
,
tp
):
def
at_time
(
self
,
tp
):
"""
Return trap centre at time tp
"""
"""
Return trap centre at time tp
"""
drifts
=
self
.
parent
.
drifts
drifts
=
self
.
parent
.
drifts
return
self
.
centre
-
np
.
sum
(
drifts
[:
tp
],
axis
=
0
)
return
self
.
centre
-
np
.
sum
(
drifts
[:
tp
+
1
],
axis
=
0
)
def
as_tile
(
self
,
tp
):
def
as_tile
(
self
,
tp
):
"""
Return trap in the OMERO tile format of x, y, w, h
"""
Return trap in the OMERO tile format of x, y, w, h
...
@@ -155,28 +155,27 @@ class Tiler(ProcessABC):
...
@@ -155,28 +155,27 @@ class Tiler(ProcessABC):
image
,
image
,
metadata
,
metadata
,
parameters
:
TilerParameters
,
parameters
:
TilerParameters
,
trap_locs
=
None
,
):
):
super
().
__init__
(
parameters
)
super
().
__init__
(
parameters
)
self
.
image
=
image
self
.
image
=
image
self
.
channels
=
metadata
[
"
channels
"
]
self
.
channels
=
metadata
[
"
channels
"
]
self
.
ref_channel
=
self
.
get_channel_index
(
parameters
.
ref_channel
)
self
.
ref_channel
=
self
.
get_channel_index
(
parameters
.
ref_channel
)
self
.
trap_locs
=
trap_locs
@classmethod
@classmethod
def
from_image
(
cls
,
image
,
parameters
:
TilerParameters
):
def
from_image
(
cls
,
image
,
parameters
:
TilerParameters
):
return
cls
(
image
.
data
,
image
.
metadata
,
parameters
)
return
cls
(
image
.
data
,
image
.
metadata
,
parameters
)
@classmethod
@classmethod
def
from_hdf5
(
cls
,
image
,
filepath
,
tile_size
=
None
):
def
from_hdf5
(
cls
,
image
,
filepath
):
trap_locs
=
TrapLocations
.
read_hdf5
(
filepath
)
trap_locs
=
TrapLocations
.
read_hdf5
(
filepath
)
metadata
=
load_attributes
(
filepath
)
metadata
=
load_attributes
(
filepath
)
metadata
[
"
channels
"
]
=
metadata
[
"
channels/channel
"
].
tolist
()
metadata
[
"
channels
"
]
=
metadata
[
"
channels/channel
"
].
tolist
()
if
tile_size
is
None
:
return
cls
(
tile_size
=
trap_locs
.
tile_size
image
.
data
,
return
Tiler
(
metadata
,
image
=
image
,
TilerParameters
.
default
(),
metadata
=
metadata
,
template
=
None
,
tile_size
=
tile_size
,
trap_locs
=
trap_locs
,
trap_locs
=
trap_locs
,
)
)
...
...
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