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
95675a7e
Commit
95675a7e
authored
2 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
[WIP]feat(tiler): support metaless local expts
parent
16faba8f
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
src/aliby/tile/tiler.py
+15
-14
15 additions, 14 deletions
src/aliby/tile/tiler.py
with
15 additions
and
14 deletions
src/aliby/tile/tiler.py
+
15
−
14
View file @
95675a7e
...
@@ -231,16 +231,16 @@ class Tiler(ProcessABC):
...
@@ -231,16 +231,16 @@ class Tiler(ProcessABC):
super
().
__init__
(
parameters
)
super
().
__init__
(
parameters
)
self
.
image
=
image
self
.
image
=
image
self
.
_metadata
=
metadata
self
.
_metadata
=
metadata
self
.
channels
=
metadata
[
"
channels
"
]
self
.
channels
=
metadata
.
get
(
"
channels
"
,
list
(
range
(
metadata
[
"
size_c
"
]))
)
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
self
.
trap_locs
=
trap_locs
try
:
try
:
self
.
z_perchannel
=
{
self
.
z_perchannel
=
{
ch
:
metadata
[
"
zsectioning/nsections
"
]
if
zsect
else
1
ch
:
zsect
for
zsect
,
ch
in
zip
(
for
ch
,
zsect
in
zip
(
self
.
channels
,
metadata
[
"
zsections
"
])
metadata
[
"
channels
"
],
metadata
[
"
channels/zsect
"
]
)
}
}
except
Exception
as
e
:
except
Exception
as
e
:
print
(
f
"
Warning:Tiler: No z_perchannel data:
{
e
}
"
)
print
(
f
"
Warning:Tiler: No z_perchannel data:
{
e
}
"
)
...
@@ -555,20 +555,21 @@ class Tiler(ProcessABC):
...
@@ -555,20 +555,21 @@ class Tiler(ProcessABC):
def
ref_channel_index
(
self
):
def
ref_channel_index
(
self
):
return
self
.
get_channel_index
(
self
.
parameters
.
ref_channel
)
return
self
.
get_channel_index
(
self
.
parameters
.
ref_channel
)
def
get_channel_index
(
self
,
item
):
def
get_channel_index
(
self
,
channel
:
str
or
int
):
"""
"""
Find index for channel using regex. Returns the first matched string.
Find index for channel using regex. Returns the first matched string.
Parameters
Parameters
----------
----------
item: string
channel: string or int
The channel
The channel or index to be used
"""
"""
channel
=
find_channel_index
(
self
.
channels
,
item
)
if
isinstance
(
channel
,
str
):
if
channel
is
None
:
channel
=
find_channel_index
(
self
.
channels
,
channel
)
raise
Warning
(
if
channel
is
None
:
f
"
Reference channel
{
channel
}
not in the available channels:
{
self
.
channels
}
"
raise
Warning
(
)
f
"
Reference channel
{
channel
}
not in the available channels:
{
self
.
channels
}
"
)
return
channel
return
channel
@staticmethod
@staticmethod
...
...
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