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
8e2efc00
Commit
8e2efc00
authored
2 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
docs(readme): refresh RemoteImageViewer info
parent
993d6d4d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+11
-5
11 additions, 5 deletions
README.md
src/aliby/utils/imageViewer.py
+12
-12
12 additions, 12 deletions
src/aliby/utils/imageViewer.py
with
23 additions
and
17 deletions
README.md
+
11
−
5
View file @
8e2efc00
...
@@ -80,12 +80,18 @@ It fetches the metadata from the Image object, and uses the TilerParameters valu
...
@@ -80,12 +80,18 @@ It fetches the metadata from the Image object, and uses the TilerParameters valu
```
python
```
python
fpath
=
"
h5/location
"
fpath
=
"
h5/location
"
t
rap
_id
=
9
t
ile
_id
=
9
trange
=
list
(
range
(
0
,
3
0
)
)
trange
=
range
(
0
,
1
0
)
ncols
=
8
ncols
=
8
riv
=
remoteImageViewer
(
fpath
)
riv
=
remoteImageViewer
(
fpath
)
trap_tps
=
riv
.
get_trap_timepoints
(
trap_id
,
trange
,
ncols
)
trap_tps
=
[
riv
.
tiler
.
get_tiles_timepoint
(
tile_id
,
t
)
for
t
in
trange
]
# You can also access labelled traps
m_ts
=
riv
.
get_labelled_trap
(
tile_id
=
0
,
tps
=
[
0
])
# And plot them directly
riv
.
plot_labelled_trap
(
trap_id
=
0
,
channels
=
[
0
,
1
,
2
,
3
],
trange
=
range
(
10
))
```
```
Depending on the network speed can take several seconds at the moment.
Depending on the network speed can take several seconds at the moment.
...
@@ -95,8 +101,8 @@ For a speed-up: take fewer z-positions if you can.
...
@@ -95,8 +101,8 @@ For a speed-up: take fewer z-positions if you can.
Alternatively, if you want to get all the traps at a given timepoint:
Alternatively, if you want to get all the traps at a given timepoint:
```
python
```
python
timepoint
=
0
timepoint
=
(
4
,
6
)
seg_expt
.
get_tiles_timepoint
s
(
timepoint
,
tile_size
=
96
,
channels
=
None
,
tiler
.
get_tiles_timepoint
(
timepoint
,
channels
=
None
,
z
=
[
0
,
1
,
2
,
3
,
4
])
z
=
[
0
,
1
,
2
,
3
,
4
])
```
```
...
...
This diff is collapsed.
Click to expand it.
src/aliby/utils/imageViewer.py
+
12
−
12
View file @
8e2efc00
...
@@ -6,12 +6,12 @@ Example of usage:
...
@@ -6,12 +6,12 @@ Example of usage:
fpath =
"
/home/alan/Documents/dev/skeletons/scripts/data/16543_2019_07_16_aggregates_CTP_switch_2_0glu_0_0glu_URA7young_URA8young_URA8old_01/URA8_young018.h5
"
fpath =
"
/home/alan/Documents/dev/skeletons/scripts/data/16543_2019_07_16_aggregates_CTP_switch_2_0glu_0_0glu_URA7young_URA8young_URA8old_01/URA8_young018.h5
"
t
rap
_id = 9
t
ile
_id = 9
trange = list(range(0,
3
0))
trange = list(range(0,
1
0))
ncols = 8
ncols = 8
riv = remoteImageViewer(fpath)
riv = remoteImageViewer(fpath)
riv.plot_labelled_trap(t
rap
_id, trange, [0], ncols=ncols)
riv.plot_labelled_trap(t
ile
_id, trange, [0], ncols=ncols)
"""
"""
...
@@ -224,7 +224,7 @@ class RemoteImageViewer(BaseImageViewer):
...
@@ -224,7 +224,7 @@ class RemoteImageViewer(BaseImageViewer):
def
get_labelled_trap
(
def
get_labelled_trap
(
self
,
self
,
t
rap
_id
:
int
,
t
ile
_id
:
int
,
tps
:
t
.
Union
[
range
,
t
.
Collection
[
int
]],
tps
:
t
.
Union
[
range
,
t
.
Collection
[
int
]],
channels
=
None
,
channels
=
None
,
concatenate
=
True
,
concatenate
=
True
,
...
@@ -234,12 +234,12 @@ class RemoteImageViewer(BaseImageViewer):
...
@@ -234,12 +234,12 @@ class RemoteImageViewer(BaseImageViewer):
Core method to fetch traps and labels together
Core method to fetch traps and labels together
"""
"""
imgs
=
self
.
get_pos_timepoints
(
tps
,
channels
=
channels
,
**
kwargs
)
imgs
=
self
.
get_pos_timepoints
(
tps
,
channels
=
channels
,
**
kwargs
)
imgs_list
=
[
x
[
t
rap
_id
]
for
x
in
imgs
.
values
()]
imgs_list
=
[
x
[
t
ile
_id
]
for
x
in
imgs
.
values
()]
outlines
=
[
outlines
=
[
self
.
cells
.
at_time
(
tp
,
kind
=
"
edgemask
"
).
get
(
t
rap
_id
,
[])
self
.
cells
.
at_time
(
tp
,
kind
=
"
edgemask
"
).
get
(
t
ile
_id
,
[])
for
tp
in
tps
for
tp
in
tps
]
]
lbls
=
[
self
.
cells
.
labels_at_time
(
tp
).
get
(
t
rap
_id
,
[])
for
tp
in
tps
]
lbls
=
[
self
.
cells
.
labels_at_time
(
tp
).
get
(
t
ile
_id
,
[])
for
tp
in
tps
]
lbld_outlines
=
[
lbld_outlines
=
[
np
.
stack
([
mask
*
lbl
for
mask
,
lbl
in
zip
(
maskset
,
lblset
)]).
max
(
np
.
stack
([
mask
*
lbl
for
mask
,
lbl
in
zip
(
maskset
,
lblset
)]).
max
(
axis
=
0
axis
=
0
...
@@ -253,7 +253,7 @@ class RemoteImageViewer(BaseImageViewer):
...
@@ -253,7 +253,7 @@ class RemoteImageViewer(BaseImageViewer):
imgs_list
=
np
.
concatenate
(
imgs_list
,
axis
=
1
)
imgs_list
=
np
.
concatenate
(
imgs_list
,
axis
=
1
)
return
lbld_outlines
,
imgs_list
return
lbld_outlines
,
imgs_list
def
get_images
(
self
,
t
rap
_id
,
trange
,
channels
,
**
kwargs
):
def
get_images
(
self
,
t
ile
_id
,
trange
,
channels
,
**
kwargs
):
"""
"""
Wrapper to fetch images
Wrapper to fetch images
"""
"""
...
@@ -262,13 +262,13 @@ class RemoteImageViewer(BaseImageViewer):
...
@@ -262,13 +262,13 @@ class RemoteImageViewer(BaseImageViewer):
for
ch
in
self
.
_find_channels
(
channels
):
for
ch
in
self
.
_find_channels
(
channels
):
out
,
imgs
[
ch
]
=
self
.
get_labelled_trap
(
out
,
imgs
[
ch
]
=
self
.
get_labelled_trap
(
t
rap
_id
,
trange
,
channels
=
[
ch
],
**
kwargs
t
ile
_id
,
trange
,
channels
=
[
ch
],
**
kwargs
)
)
return
out
,
imgs
return
out
,
imgs
def
plot_labelled_trap
(
def
plot_labelled_trap
(
self
,
self
,
t
rap
_id
:
int
,
t
ile
_id
:
int
,
channels
,
channels
,
trange
:
t
.
Union
[
range
,
t
.
Collection
[
int
]],
trange
:
t
.
Union
[
range
,
t
.
Collection
[
int
]],
remove_axis
:
bool
=
False
,
remove_axis
:
bool
=
False
,
...
@@ -288,7 +288,7 @@ class RemoteImageViewer(BaseImageViewer):
...
@@ -288,7 +288,7 @@ class RemoteImageViewer(BaseImageViewer):
Parameters
Parameters
----------
----------
t
rap
_id : int
t
ile
_id : int
Identifier of trap
Identifier of trap
channels : Union[str, int]
channels : Union[str, int]
Channels to use
Channels to use
...
@@ -325,7 +325,7 @@ class RemoteImageViewer(BaseImageViewer):
...
@@ -325,7 +325,7 @@ class RemoteImageViewer(BaseImageViewer):
nrows
=
int
(
np
.
ceil
(
len
(
trange
)
/
ncols
))
nrows
=
int
(
np
.
ceil
(
len
(
trange
)
/
ncols
))
width
=
self
.
tiler
.
tile_size
*
ncols
width
=
self
.
tiler
.
tile_size
*
ncols
out
,
images
=
self
.
get_images
(
t
rap
_id
,
trange
,
channels
,
**
kwargs
)
out
,
images
=
self
.
get_images
(
t
ile
_id
,
trange
,
channels
,
**
kwargs
)
# dilation makes outlines easier to see
# dilation makes outlines easier to see
out
=
dilation
(
out
).
astype
(
float
)
out
=
dilation
(
out
).
astype
(
float
)
...
...
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