Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TaggingBackends
Manage
Activity
Members
Labels
Plan
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nyx
TaggingBackends
Commits
effabc10
Commit
effabc10
authored
3 years ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
mysterious bugfix (maybe not in this package...)
parent
2171897b
No related branches found
No related tags found
No related merge requests found
Pipeline
#85674
passed
3 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Trxmat2HDF5.jl
+8
-5
8 additions, 5 deletions
src/Trxmat2HDF5.jl
with
8 additions
and
5 deletions
src/Trxmat2HDF5.jl
+
8
−
5
View file @
effabc10
...
...
@@ -109,10 +109,10 @@ function LarvaDatasets.labelcounts(
files
::
Vector
{
LarvaH5
},
nsteps_before
=
nothing
,
nsteps_after
=
nothing
;
unused
...
)
if
isnothing
(
nsteps_before
)
nsteps_before
=
isnothing
(
nsteps_after
)
?
0
:
nsteps_after
nsteps_before
=
isnothing
(
nsteps_after
)
?
0
:
nsteps_after
+
1
end
if
isnothing
(
nsteps_after
)
nsteps_after
=
nsteps_before
nsteps_after
=
nsteps_before
-
1
end
counts
=
Dict
{
String
,
Int
}()
refs
=
Dict
{
String
,
Vector
{
Tuple
{
Int
,
Int
,
Int
}}}()
...
...
@@ -123,7 +123,7 @@ function LarvaDatasets.labelcounts(
h5open
(
file
.
source
)
do
h5
labels
=
try
read
(
h5
,
"labels"
)
catch
e
catch
@error
"no
\"
labels
\"
record in file"
file
=
file
.
source
push!
(
corrupted
,
file
.
source
)
return
...
...
@@ -137,11 +137,11 @@ function LarvaDatasets.labelcounts(
nsteps_before
+
nsteps_after
<
size
(
steps
,
1
)
||
continue
steps
=
steps
[
nsteps_before
+
1
:
end
-
nsteps_after
,
:
]
counts′
=
sum
(
steps
;
dims
=
1
)
for
(
j′
,
(
label
,
count′
))
in
enumerate
(
zip
(
labels
,
counts′
))
for
(
l
,
(
label
,
count′
))
in
enumerate
(
zip
(
labels
,
counts′
))
count
=
get
(
counts
,
label
,
0
)
counts
[
label
]
=
count
+
count′
ref
=
get!
(
refs
,
label
,
Tuple
{
Int
,
Int
,
Int
}[])
for
k′
in
findall
(
steps
[
:
,
j′
])
for
k′
in
findall
(
steps
[
:
,
l
])
k
=
nsteps_before
+
k′
push!
(
ref
,
(
i
,
j
,
k
))
end
...
...
@@ -175,13 +175,16 @@ function LarvaDatasets.processfile(h5, file::LarvaH5, refs, sampleid, nsteps_bef
end
median_body_length
=
median
(
lengths
)
@debug
basename
(
file
.
source
)
median_body_length
labels
=
read
(
h5′
,
"labels"
)
# testset #1
#
for
(
j
,
record
)
in
enumerate
(
records
)
trackid
=
parse
(
Int
,
record
[
7
:
end
])
times
=
read
(
h5′
,
record
*
"/t"
)
track
=
read
(
h5′
,
record
*
"/spines"
)
behavior
=
read
(
h5′
,
record
*
"/labels"
)
# testset #1
for
(
j′
,
k
,
label
)
in
refs
j′
==
j
||
continue
@assert
label
in
labels
[
behavior
[
k
,
:
]]
# testset #1
start_point
=
k
-
nsteps_before
spines
=
[
aspoints
(
track
[
row
,
:
,
:
])
for
row
in
start_point
:
k
+
nsteps_after
]
lengths
=
bodylength
.
(
spines
)
...
...
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