Skip to main content

Optional: Use Data from TrackMate

  • Robust tracking of cells and other objects in microscopy time-lapse images
  • Various detection and tracking algorithms
  • Visualization and analysis tools
  • Cellpose is a cell segmentation algorithm for TrackMate:
    • Enables advanced object detection directly within the TrackMate workflow

1:   Export Data from TrackMate

1.1: Configure your experiment timelapse

Open and set properties for a timelapse of interest (Image > Properties; update Channels, Slices, Frames, and Pixel dimensions as desired, these are carried over to TrackMate output and ultimately the Loon output.

1.2: Run Tracking

Run tracking using TrackMate user interface with optimized tracking parameters for your specific dataset. After tracking is complete, and you are in the "Display Options" menu, manually correct tracks using TrackScheme as necessary.

TrackMate settings screenshot

1.3: Define Cell Lineages

After tracks have been manually corrected, click "next" (bottom right) to navigate to the final menu titled "Select an action", scroll down to select "Spot auto-naming", and select "Append 'a', 'b' for each branch. For each cell, each 'a' and 'b' cell are children.

Spot naming settings

The names should appear like this.

TrackMate Names Result

1.4: Export .roi Segmentations

In the same "Select an action" menu, select "Export spots to IJ ROIS". This will save a .zip folder of ROIs that will be the segmentations into Loon. Click "Execute" (bottom right). Select "All spots" if you would like to export all ROIs to Loon.

TrackMate settings screenshot

1.5: Export Cell Metadata .csv

Once all tracks have been manually corrected, Click “Spots” on the bottom left of the “Display Options” menu. This will bring up the “All Spots Table”. Click “Export to CSV” (Top right) and save the file.

2:   Convert TrackMate Data into Loon Format

We currently use our conversion script on github. On GitHub, click the download button at the top-right of the script.

Conversion Script Info:

Inputs:

  • A .csv file from TrackMate
    • Must currently include LABEL, FRAME, POSITION_X, POSITION_Y columns
  • A folder containing .roi files from TrackMate

What the script does:

  • Reads your .csv file, removes unnecessary rows / columns, sorts by frame
  • Infers / Adds a parent column to the .csv file, which includes the parents of each track
  • Outputs that corrected .csv
  • Converts that corrected .csv to a .parquet file
  • Converts .roi files to GeoJSON format, creating a folder structure based on frames

Outputs:

  • A metadata.csv file with metadata for Loon
  • A metadata.parquet file with metadata for Loon
  • A segmentations folder with GeoJSON files for each frame

Run the script:

  1. Open your terminal:
    • Mac: Press Cmd + Space, type Terminal, and press Enter
    • Windows: Press Win + R, type cmd, and press Enter
  2. Change to the directory where you saved ingest_trackmate.py:
    • Mac: cd ~/Downloads
    • Windows: cd %USERPROFILE%\Downloads
  3. Run the script:
    • Type ingest_trackmate.py "/path/to/your/input.csv" "/path/to/your/roi_files" "/path/to/your/output" and press Enter
Optional: New Conversion Script with User Interface

Download our new conversion script ↓

Run the script:

  1. Open your terminal:
    • Mac: Press Cmd + Space, type Terminal, and press Enter
    • Windows: Press Win + R, type cmd, and press Enter
  2. Change to the directory where you saved convert_trackmate.py:
    • Mac: cd ~/Downloads
    • Windows: cd %USERPROFILE%\Downloads
  3. Run the script:
    • Type python convert_trackmate.py and press Enter
  4. Follow the on-screen instructions to convert your TrackMate data to Loon format