diff --git a/Project.toml b/Project.toml index 9aed8765c10b4294ca1a1116cbfd049f7a703d0f..5dbf3b2616df7ea4b67921f501acf9722250d0a6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TaggingBackends" uuid = "e551f703-3b82-4335-b341-d497b48d519b" authors = ["François Laurent", "Institut Pasteur"] -version = "0.7" +version = "0.7.1" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/pyproject.toml b/pyproject.toml index 446468d8a8ece05e1aa0b195634b8e8f83346387..5cab35d6fc8a3a3d121ac999bb46f879935af816 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "TaggingBackends" -version = "0.7" +version = "0.7.1" description = "Backbone for LarvaTagger.jl tagging backends" authors = ["François Laurent"] diff --git a/src/LarvaDatasets.jl b/src/LarvaDatasets.jl index 4ddeb45eeb427874dd7ea9f7f1d58db83fa382fc..3e89f955b78e957450bf24264f20e5bbbbab3223 100644 --- a/src/LarvaDatasets.jl +++ b/src/LarvaDatasets.jl @@ -271,17 +271,18 @@ function write_larva_dataset_hdf5(path, counts, files, refs, nsteps_before, nste end end h5open(path, "w") do h5 + g = create_group(h5, "samples") Threads.foreach(ch) do (file, refs, sampleid) @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) end - attributes(h5["samples"])["n_samples"] = sampleid + attributes(g)["n_samples"] = sampleid # extension h5["labels"] = collect(keys(counts)) #h5["files"] = [f.source for f in files] if !isnothing(frameinterval) - attributes(h5["samples"])["frame_interval"] = frameinterval + attributes(g)["frame_interval"] = frameinterval end end end @@ -363,7 +364,7 @@ function processfile(h5, file, refs, sampleid, nsteps_before, nsteps_after; sample[:,8] = lengths sample[:,9:end] = spines # - name = "samples/sample_$sampleid" + name = "sample_$sampleid" # transpose for compatibility with h5py # see issue https://github.com/JuliaIO/HDF5.jl/issues/785 h5[name] = permutedims(sample, reverse(1:ndims(sample))) @@ -517,9 +518,6 @@ function write_larva_dataset_hdf5(output_dir::String, h5open(output_file, "cw") do h5 attributes(h5["samples"])["len_traj"] = window_length attributes(h5["samples"])["len_pred"] = window_length - if !isnothing(frameinterval) - attributes(h5["samples"])["frame_interval"] = frameinterval - end end return output_file end