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
b0cdf95f
Commit
b0cdf95f
authored
2 years ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
fixes #17
parent
c0a1abee
No related branches found
No related tags found
No related merge requests found
Pipeline
#93883
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/LarvaDatasets.jl
+5
-7
5 additions, 7 deletions
src/LarvaDatasets.jl
with
5 additions
and
7 deletions
src/LarvaDatasets.jl
+
5
−
7
View file @
b0cdf95f
...
@@ -271,17 +271,18 @@ function write_larva_dataset_hdf5(path, counts, files, refs, nsteps_before, nste
...
@@ -271,17 +271,18 @@ function write_larva_dataset_hdf5(path, counts, files, refs, nsteps_before, nste
end
end
end
end
h5open
(
path
,
"w"
)
do
h5
h5open
(
path
,
"w"
)
do
h5
g
=
make_dataset
(
h5
,
"samples"
)
Threads
.
foreach
(
ch
)
do
(
file
,
refs
,
sampleid
)
Threads
.
foreach
(
ch
)
do
(
file
,
refs
,
sampleid
)
@info
"Sampling series of spines in run:
$
(runid(file))"
@info
"Sampling series of spines in run:
$
(runid(file))"
processfile
(
h5
,
file
,
refs
,
sampleid
,
nsteps_before
,
nsteps_after
;
processfile
(
g
,
file
,
refs
,
sampleid
,
nsteps_before
,
nsteps_after
;
fixmwt
=
fixmwt
,
frameinterval
=
frameinterval
)
fixmwt
=
fixmwt
,
frameinterval
=
frameinterval
)
end
end
attributes
(
h5
[
"samples"
]
)[
"n_samples"
]
=
sampleid
attributes
(
g
)[
"n_samples"
]
=
sampleid
# extension
# extension
h5
[
"labels"
]
=
collect
(
keys
(
counts
))
h5
[
"labels"
]
=
collect
(
keys
(
counts
))
#h5["files"] = [f.source for f in files]
#h5["files"] = [f.source for f in files]
if
!
isnothing
(
frameinterval
)
if
!
isnothing
(
frameinterval
)
attributes
(
h5
[
"samples"
]
)[
"frame_interval"
]
=
frameinterval
attributes
(
g
)[
"frame_interval"
]
=
frameinterval
end
end
end
end
end
end
...
@@ -363,7 +364,7 @@ function processfile(h5, file, refs, sampleid, nsteps_before, nsteps_after;
...
@@ -363,7 +364,7 @@ function processfile(h5, file, refs, sampleid, nsteps_before, nsteps_after;
sample
[
:
,
8
]
=
lengths
sample
[
:
,
8
]
=
lengths
sample
[
:
,
9
:
end
]
=
spines
sample
[
:
,
9
:
end
]
=
spines
#
#
name
=
"
samples/
sample_
$
sampleid"
name
=
"sample_
$
sampleid"
# transpose for compatibility with h5py
# transpose for compatibility with h5py
# see issue https://github.com/JuliaIO/HDF5.jl/issues/785
# see issue https://github.com/JuliaIO/HDF5.jl/issues/785
h5
[
name
]
=
permutedims
(
sample
,
reverse
(
1
:
ndims
(
sample
)))
h5
[
name
]
=
permutedims
(
sample
,
reverse
(
1
:
ndims
(
sample
)))
...
@@ -517,9 +518,6 @@ function write_larva_dataset_hdf5(output_dir::String,
...
@@ -517,9 +518,6 @@ function write_larva_dataset_hdf5(output_dir::String,
h5open
(
output_file
,
"cw"
)
do
h5
h5open
(
output_file
,
"cw"
)
do
h5
attributes
(
h5
[
"samples"
])[
"len_traj"
]
=
window_length
attributes
(
h5
[
"samples"
])[
"len_traj"
]
=
window_length
attributes
(
h5
[
"samples"
])[
"len_pred"
]
=
window_length
attributes
(
h5
[
"samples"
])[
"len_pred"
]
=
window_length
if
!
isnothing
(
frameinterval
)
attributes
(
h5
[
"samples"
])[
"frame_interval"
]
=
frameinterval
end
end
end
return
output_file
return
output_file
end
end
...
...
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