Skip to content
Snippets Groups Projects
Commit 417440e5 authored by François  LAURENT's avatar François LAURENT
Browse files

doc slight improvement

parent 241dcaee
No related branches found
No related tags found
No related merge requests found
Pipeline #95654 passed
...@@ -13,6 +13,19 @@ Python interface to JSON *.label* files. ...@@ -13,6 +13,19 @@ Python interface to JSON *.label* files.
It is a poor parent of Julia struct `Dataset` from `PlanarLarvae.jl`. It is a poor parent of Julia struct `Dataset` from `PlanarLarvae.jl`.
`Labels` can be used as a `dict`, with (runid, trackid) pairs as keys.
To iterate over its content and access timeseries of labels, you can do:
```
for run_larva in labels:
_, larva_id = run_larva
timeseries_data = labels[run_larva]
...
```
A `Labels` object will typically describe a single run, but can technically
represent several runs.
The following example function opens such a *.label* file and loads the The following example function opens such a *.label* file and loads the
associated track data assumed to be available as a *trx.mat* file. associated track data assumed to be available as a *trx.mat* file.
It iterates over the tracks defined in the *.label* file. The same tracks are It iterates over the tracks defined in the *.label* file. The same tracks are
...@@ -46,11 +59,6 @@ def retagged_trxmat_confusion_matrix(label_file): ...@@ -46,11 +59,6 @@ def retagged_trxmat_confusion_matrix(label_file):
return cm return cm
``` ```
Note that unlike the `TrxMat` class, keys in `Labels` objects are
(runid, trackid) pairs.
A `Labels` object will typically describe a single run, but can technically
represent several runs.
The `labelspec` attribute is assumed to be a list, which is valid for *.label* The `labelspec` attribute is assumed to be a list, which is valid for *.label*
generated by automatic tagging. generated by automatic tagging.
Manual tagging will store label names as `Labels.labelspec['names']`, because Manual tagging will store label names as `Labels.labelspec['names']`, because
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment