Skip to content

Exporting Data

LUC3D supports multiple export formats for 2D annotations, 3D reconstructions, calibration data, and skeleton definitions.

Export Formats

All export options are available under the File menu.

Labels (JSON)

File → Export Labels (JSON)

Exports all 2D annotations as a JSON file with frame-by-frame instance data. This is LUC3D's native format and preserves all annotation metadata.

{
  "skeleton": { "nodes": [...], "edges": [...] },
  "frames": [
    {
      "frame_idx": 0,
      "instances": [
        {
          "points": [[x1, y1], [x2, y2], ...],
          "track": "mouse_1",
          "type": "user",
          "camera": "back"
        }
      ]
    }
  ]
}

SLEAP .slp

LUC3D writes SLEAP-compatible .slp files in SLEAP's native (canonical) format, so they open directly in sleap_io and the SLEAP GUI with no conversion step. Two export modes:

File → Export SLEAP File Per Session — For the active session, writes one 2D .slp per camera into that camera's folder inside an output folder you choose. Files are versioned (<name>_vN.slp). Per-camera Download toggles and Include options (Save Predicted Instances, Save Reprojections as User or Predicted) are offered.

File → Export SLEAP File By Cam — A camera × session grid. Download All prompts for an output folder and writes one flat <CamName>.slp per included camera, spanning all selected sessions (it falls back to individual file downloads if the folder picker isn't available). Cameras whose skeleton doesn't match are blocked from export.

SLEAP version

Because exports use SLEAP's canonical flat-matrix format, reading them natively requires SLEAP ≥ 1.6 (sleap-io ≥ 0.7).

Tip

Per-camera export is recommended if you plan to retrain SLEAP models on individual camera views.

Large sessions

For a large, lazily-loaded session (see Loading large files), project save and per-camera export automatically use a memory-bounded streaming writer, so the export never holds the whole session in memory and no labeled frame is dropped.

3D Video (MP4)

File → Export 3D Video

Renders the 3D viewport to an MP4 video (WebCodecs + mp4-muxer). Pick a resolution preset (360p, 720p, 1080p, 2K); the dialog shows live frame-count and file-size estimates. Requires triangulated 3D data (or imported 3D points).

3D Points (HDF5)

File → Export 3D Points (H5)

Exports triangulated 3D keypoints as an HDF5 file. Requires triangulation to have been run first.

Structure:

/tracks          — Track names
/node_names      — Keypoint names
/points_3d       — Shape: (n_frames, n_tracks, n_nodes, 3) — XYZ coordinates

Reprojections (HDF5)

File → Export Reprojections (H5)

Exports the 2D reprojected points (3D points projected back to each camera view) in HDF5 format. Useful for evaluating annotation consistency.

Calibration (TOML)

File → Export Calibration (TOML)

Saves the current camera calibration as a TOML file. Useful if you've modified camera parameters or want to share calibration separately.

Skeleton (JSON)

File → Save Skeleton (JSON)

Exports the skeleton definition (node names and edge connections) as a JSON file.

Project Files

Save Project

File → Save Project saves a complete .luc3d.slp project file containing:

  • All 2D annotations
  • Camera calibration
  • Skeleton definition
  • Track and identity assignments
  • Instance groups and 3D data

Load Project

File → Load Project restores a previously saved project, including all calibration, annotations, and metadata.

Python Conversion Scripts

For offline conversion, LUC3D includes Python scripts in the scripts/ directory:

JSON to SLP

python scripts/json_to_slp.py input.json output.slp

Converts the JSON export to SLEAP .slp format. Requires h5py and numpy.

JSON to HDF5

python scripts/json_to_h5.py input.json output.h5

Converts the JSON export to HDF5 format. Requires h5py and numpy.