Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LarvaTagger.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Nyx
LarvaTagger.jl
Commits
0f971768
Commit
0f971768
authored
1 year ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
larva decorating from larva filter
parent
89ae3cb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!15
Set of commits to be tagged v0.17
Pipeline
#117213
passed
1 year ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/players.jl
+3
-1
3 additions, 1 deletion
src/players.jl
src/plots.jl
+2
-8
2 additions, 8 deletions
src/plots.jl
src/wgl.jl
+32
-1
32 additions, 1 deletion
src/wgl.jl
with
37 additions
and
10 deletions
src/players.jl
+
3
−
1
View file @
0f971768
...
@@ -158,6 +158,7 @@ function timecontroller(times::Vector{Float64}; speed=1.0)
...
@@ -158,6 +158,7 @@ function timecontroller(times::Vector{Float64}; speed=1.0)
stepmin
=
Observable
(
1
)
stepmin
=
Observable
(
1
)
stepmax
=
Observable
(
nsteps
)
stepmax
=
Observable
(
nsteps
)
boundreached
=
Observable
(
true
)
boundreached
=
Observable
(
true
)
initialized
=
Ref
(
false
)
# useful for skipping a "Time bound reached" message at startup
#
#
on
(
timestep
)
do
step
on
(
timestep
)
do
step
min
,
max
=
stepmin
[],
stepmax
[]
min
,
max
=
stepmin
[],
stepmax
[]
...
@@ -177,7 +178,8 @@ function timecontroller(times::Vector{Float64}; speed=1.0)
...
@@ -177,7 +178,8 @@ function timecontroller(times::Vector{Float64}; speed=1.0)
end
end
end
end
on
(
boundreached
)
do
b
on
(
boundreached
)
do
b
b
&&
@info
"Time bound reached"
b
&&
initialized
[]
&&
@info
"Time bound reached"
initialized
[]
=
true
end
end
on
(
stepmin
)
do
bound
on
(
stepmin
)
do
bound
0
<
bound
||
throw
(
DomainError
(
"stepmin < 1"
))
0
<
bound
||
throw
(
DomainError
(
"stepmin < 1"
))
...
...
This diff is collapsed.
Click to expand it.
src/plots.jl
+
2
−
8
View file @
0f971768
...
@@ -528,13 +528,7 @@ function Makie.plot!(plot::LarvaPlot{Tuple{DecoratedLarva}})
...
@@ -528,13 +528,7 @@ function Makie.plot!(plot::LarvaPlot{Tuple{DecoratedLarva}})
# decoration
# decoration
p
=
Makie
.
Point2f
∘
coordinates
p
=
Makie
.
Point2f
∘
coordinates
outline
=
p
.
(
Vector
(
vertices
(
decoratedlarva
.
activearea
)))
outline
=
p
.
(
Vector
(
vertices
(
decoratedlarva
.
activearea
)))
# TODO: design a more systematic way to prevent path closing of spine, i.e. when outline
close!
(
path
)
=
push!
(
path
,
path
[
1
])
# data is not available and `outline` is actually a spine
close!
(
path
)
=
if
7
<
length
(
path
)
push!
(
path
,
path
[
1
])
else
path
end
lines!
(
plot
,
close!
(
outline
);
lines!
(
plot
,
close!
(
outline
);
color
=
theme
[
:
DecoratedLarva
][
:
hover_color
],
color
=
theme
[
:
DecoratedLarva
][
:
hover_color
],
linewidth
=
theme
[
:
DecoratedLarva
][
:
hover_linewidth
],
linewidth
=
theme
[
:
DecoratedLarva
][
:
hover_linewidth
],
...
@@ -599,7 +593,7 @@ function DecoratedLarvae(larvae::Vector{DecoratedLarva})
...
@@ -599,7 +593,7 @@ function DecoratedLarvae(larvae::Vector{DecoratedLarva})
else
else
@error
begin
@error
begin
j_id
=
larvae
[
j
]
.
larva
.
model
.
id
j_id
=
larvae
[
j
]
.
larva
.
model
.
id
"
c
annot decorate invisible larva #
$(j_id)
-
please file an issue at https://gitlab.pasteur.fr/nyx/larvatagger.jl/-/issues
"
"
C
annot decorate invisible larva #
$(j_id)
"
end
end
hovered_larva
.
val
=
0
hovered_larva
.
val
=
0
end
end
...
...
This diff is collapsed.
Click to expand it.
src/wgl.jl
+
32
−
1
View file @
0f971768
...
@@ -118,6 +118,7 @@ struct AssayPlot
...
@@ -118,6 +118,7 @@ struct AssayPlot
end
end
function
AssayPlot
(
ctrl
,
larvae
::
DecoratedLarvae
;
size
=
FIGSIZE
)
function
AssayPlot
(
ctrl
,
larvae
::
DecoratedLarvae
;
size
=
FIGSIZE
)
gethub
(
ctrl
)[
:
decoratedlarvae
]
=
larvae
fig
=
Figure
(
resolution
=
size
)
fig
=
Figure
(
resolution
=
size
)
width
=
0.1f0
# try to get 1px
width
=
0.1f0
# try to get 1px
color
=
RGBAf
(
0
,
0
,
0
,
0.36
)
color
=
RGBAf
(
0
,
0
,
0
,
0.36
)
...
@@ -448,14 +449,41 @@ end
...
@@ -448,14 +449,41 @@ end
struct
LarvaInfo
struct
LarvaInfo
controller
controller
id
::
LarvaID
id
::
LarvaID
hovered
::
AbstractObservable
{
Bool
}
reviewed
::
AbstractObservable
{
Bool
}
reviewed
::
AbstractObservable
{
Bool
}
edited
::
AbstractObservable
{
Bool
}
edited
::
AbstractObservable
{
Bool
}
included
::
AbstractObservable
{
Bool
}
included
::
AbstractObservable
{
Bool
}
end
end
function
larvainfo
(
controller
,
id
)
function
larvainfo
(
controller
,
id
)
hovered
=
Observable
(
false
)
reviewed
=
Observable
(
false
)
reviewed
=
Observable
(
false
)
edited
=
Observable
(
false
)
edited
=
Observable
(
false
)
#
larvae
=
gethub
(
controller
)[
:
decoratedlarvae
]
larvaindex
=
nothing
for
(
i
,
larva
)
in
enumerate
(
larvae
.
larvae
)
larva
=
larva
.
larva
if
larva
.
model
.
id
==
id
larvaindex
=
i
end
end
larvavisible
=
larvae
.
larvae
[
larvaindex
]
.
larva
.
visible
on
(
hovered
)
do
b
if
larvae
.
hovering_active
[]
if
b
if
larvavisible
[]
larvae
.
hovered_larva
[]
=
larvaindex
end
else
i
=
larvae
.
hovered_larva
[]
if
i
!=
0
i
==
larvaindex
||
@warn
"Larva #
$
(larvae.larvae[i].larva.model.id) unexpectedly decorated"
larvae
.
hovered_larva
[]
=
0
end
end
end
end
on
(
edited
)
do
b
on
(
edited
)
do
b
if
b
if
b
#@assert reviewed[]
#@assert reviewed[]
...
@@ -474,6 +502,7 @@ function larvainfo(controller, id)
...
@@ -474,6 +502,7 @@ function larvainfo(controller, id)
included
=
Observable
(
false
)
included
=
Observable
(
false
)
LarvaInfo
(
controller
,
LarvaInfo
(
controller
,
id
,
id
,
hovered
,
reviewed
,
reviewed
,
edited
,
edited
,
included
)
included
)
...
@@ -482,7 +511,9 @@ end
...
@@ -482,7 +511,9 @@ end
JSServe
.
jsrender
(
session
::
Session
,
li
::
LarvaInfo
)
=
r
(
session
,
prerender
(
li
))
JSServe
.
jsrender
(
session
::
Session
,
li
::
LarvaInfo
)
=
r
(
session
,
prerender
(
li
))
function
prerender
(
li
::
LarvaInfo
)
function
prerender
(
li
::
LarvaInfo
)
label
=
"#
$
(li.id)"
label
=
DOM
.
label
(
"#
$
(li.id)"
,
onmouseenter
=
js
"JSServe.update_obs(
$
(li.hovered), true)"
,
onmouseleave
=
js
"JSServe.update_obs(
$
(li.hovered), false)"
)
discard_larva_edits
=
js
"LarvaTagger.discardLarvaEdits(this,
$
(li.edited),
$
label)"
discard_larva_edits
=
js
"LarvaTagger.discardLarvaEdits(this,
$
(li.edited),
$
label)"
reviewed_checkbox
=
DOM
.
input
(
type
=
"checkbox"
,
reviewed_checkbox
=
DOM
.
input
(
type
=
"checkbox"
,
checked
=
li
.
reviewed
,
checked
=
li
.
reviewed
,
...
...
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