Repository navigation
Before You Record
Applies to: Track2Data v0.1.0 and later.
Most things Track2Data cannot do for you are decided before the camera starts. This is the checklist to run through while planning a recording session — each item maps to a problem that cannot be fixed afterwards.
-
Know the frame rate, and keep it constant. Frame rate scales speed, acceleration and
path length. Sessions recorded at different rates are not comparable without modelling it,
and if the tracker's files do not record the rate, Track2Data refuses to guess:
READER_OPTION_MISSINGrather than a silently wrong speed. -
Keep sessions the same length, or accept that every total (path length, visit counts,
bout counts) needs a duration offset.
duration_sandn_framesare insessions.csvfor exactly this reason. - One condition per recording. Treatment, tank and date attach to a session, so a session that contains two conditions cannot be split later.
-
Do not change the camera, arena geometry or tracking settings mid-study. Body length
and area are defined by idtracker.ai's segmentation parameters, and identity matching
across sessions needs
resolution_reductionandid_image_sizeto match; Track2Data warns when sessions differ, but the data is already collected by then. - Decide the camera view, and keep it fixed. A side view gives depth in the water column (IL-15); a top-down view gives position in the arena. Declare which you used on the Calibration screen. For depth, film so the whole water column is in frame, upright, with the waterline and the tank floor visible: Track2Data measures depth between the top and bottom edges of the main zone you draw, and it cannot correct for refraction or for fish at different distances from the front glass.
- Keep the video with the session folder. If the path idtracker.ai recorded no longer exists on the analysis machine, the Video column reads Not found and you point at the file with Locate Video… — metrics do not need it, but the Preview and the calibration measurement do.
Decide which units you want before recording, because one of them needs an object in frame:
-
Centimetres (
*_cm) need a pixels-per-unit scale. Put something of known length in the frame — a ruler, a calibration card — or measure the arena diameter and record it. Without a scale, every*_cmcolumn is empty. This is not recoverable from the video later unless something of known size is visible in it. -
Body lengths (
*_bl) need only the tracker's body length, which idtracker.ai 6.x records; this is the default mode and the right choice when no physical scale exists. Note that an idtracker.ai v5 session carries no body length, so those export in pixels. -
A scale the tracker already records is used by Session calibration, and which
trackers record one differs:
-
idtracker.ai: the Validator's Length Calibration tool. Click carefully, and make
two or three measurements rather than one: Track2Data records how much your clicks
disagreed (
length_calibration_rel_sdinsessions.csv), warns above 5 %, and lets you use the median of several measurements instead of the average. -
Ctrax / JAABA
trx.mat:pxpermm(pixels per millimetre), once the file's units were converted in Ctrax or JAABA. -
DeepLabCut, SLEAP and Ctrax raw
.matrecord no scale. Note it down, and give Scale (pixels per cm) when you add the sessions. idtracker.ai never records whether you measured in cm or mm, so write the unit down too: you confirm it on the Calibration screen.
-
idtracker.ai: the Validator's Length Calibration tool. Click carefully, and make
two or three measurements rather than one: Track2Data records how much your clicks
disagreed (
If body size itself differs between your groups, prefer *_bl for distances between animals
— body lengths are the comparable quantity.
Tracking with identities gives you every individual metric and the zone metrics that follow an animal (Z-3 … Z-9). An identity-free session gives you pooled zone occupancy (Z-1, Z-2, Z-8) and the nearest-neighbour-matched group metrics, and no per-animal rows.
If your question is about individuals, that is a tracking decision, not an analysis one: budget the tracking effort for stable identities, and check the ⚠ identity-free flag on the Sessions screen before you plan the statistics.
The session folder name becomes session_id, and it is the key everything else joins on.
- Give each folder the name you want in the dataset: short, no spaces, consistent across the
study (
t07_ctrl_d1, notTrial 7 (control) copy). - The
session_idcolumn in your metadata CSV must equal the folder name exactly. - Ids that could escape the output directory are rejected, so avoid path separators and leading dots.
Write it while you record, not afterwards. Two shapes, depending on whether the information is per session or per animal.
One row per session — treatment, date, tank:
session_id,treatment,trial_date,tank
t07_ctrl_d1,control,2026-03-04,A
t08_drug_d1,drug_10mg,2026-03-04,BOne row per animal — sex, weight, genotype:
session_id,individual_id,sex,weight_g,genotype
t07_ctrl_d1,1,F,0.42,wt
t07_ctrl_d1,2,M,0.39,wt
t08_drug_d1,1,F,0.45,mutThen on the Metadata screen, map your animal column to Individual ID and pick how it is
matched: Validator label (the names set in the idtracker.ai Validator, by default 1,
2, …) or Position (the 0-based individual_id of the exported tables). If your CSV
counts animals from 1, use Validator label; if from 0, use Position. Getting this wrong
silently attaches each animal's data to a different animal, so check the match summary — it
names every session and animal that found no row.
Columns named like engine columns (speed_px_s, frame, bin_index, …) are never carried,
so they cannot overwrite measurements. Unmapped, unticked columns are dropped.
If the design involves zones, keep the arena in the same place in frame for every session, and draw the zones once on a frame at that resolution. Zones drawn on a different image size raise a resolution warning, and re-drawing them per session makes occupancy numbers incomparable.
- Frame rate known and identical across sessions you will compare.
- Scale object in frame, or body lengths accepted as the unit.
- Identities tracked, if the question is about individuals.
- Session folders named as you want
session_idto read. - Metadata CSV written, with
session_idmatching those names.
Then: Install and First Run → the user guide → Analysis Recipes.
Source · Changelog · Issues · Report an error in this page
These pages describe the latest release unless a page says otherwise; version-pinned
documentation (the user guide, the metrics specification) lives in the repository and ships
with each release. Pages are published from docs/wiki/ — edit there, by pull request.
© 2026 Martina Bellio · MIT licence
Using it
Analysing the output
Reference
Developing