Skip to main content

Cross-platform Python software package and GUIs to support Single Particle Tracking experiments.

Project description

TRAIT2D

PyPI PyPI - Wheel PyPI - Python Version PyPI - License

TRAIT2D (available as trait2d) is a cross-platform Python software package with compilable graphical user interfaces (GUIs) to support Single Particle Tracking experiments. The software can be divided, in three main sections: the tracker, the simulator and the data analyzer.

The documentation is available at GitHub Pages.

Features

  • SPT simulation, tracking and analysis
  • user-friendly GUIs for simple tasks
  • customisable libraries for more advanced users
  • open source under the GNU General Public License

Installation

Installation methods have been tested on Linux and Windows.

Install from PyPI (Recommended)

Prerequisites:

  • A Python installation (version >= 3.7 is required)

Installation:

  • run pip install trait2d

Install from Source (Not Recommended)

Prerequisites:

  • A Python installation (version >= 3.7 is required)
  • Optional: A Git installation

Installation:

  • clone the GitHub repository

  • change to the directory that was just created (should contain a setup.py file)

  • run pip install -e .

Quickstart

GUIs

There are GUIs available for simple simulation, tracking and analysis tasks.

To start using them follow these steps:

  • open a terminal
  • if you installed the package with conda to a separate environment, activate it (e.g. conda activate trait2d)
  • type trait2d_analysis_gui, trait2d_simulator_gui or trait2d_tracker_gui and hit enter

Library Modules

To use the trait2d modules, you can import them in your Python scripts or notebooks.

The simulator module is available as trait2d.simulators and the analysis module as trait2d.analysis.

For more information, check the documentation on the simulation and analysis libraries.

Examples are available in the gallery.

Further GUI Usage

You can find more information and GUI descriptions in the documentation on the analysis, simulator, and tracker GUIs.

Detection and Tracking

  • Launch a terminal (or the Anaconda Prompt on Windows)
  • if neccessary, activate the environment (e.g. conda activate trait2d)
  • run trait2d_tracker_gui

Setting parameters:

Use “Preview” button to evaluate performance of the detector. It shows detections for the current frame.

Parameters:

  • SEF: sigma – parameters of the Laplacian-of-Gaussian(LoG) kernel. It relates to the spot size (increase to detect larger particles)
  • SEF: threshold – parameter for the image threshold after LoG. It relates to the intensity of the spots (decrease to detect particles with lower intensity)
  • SEF: min peak value – parameter of the detected peak size. It relates to the intensity of the spots (decrease to detect particles with lower intensity)
  • patch size – size of the region of interest with the particle (should be bigger than expected particle size). It can influence the particle localisation accuracy.
  • Linking: max distance – maximum possible distance (in pixels) between detections to be linked (increase to link detections located further away from each other)
  • Linking: frame gap – maximum possible number of frames between detections to be linked (increase if the final trajectory is broken into parts)
  • Minimum track length – helps to eliminate short tracks created by false detections
  • resolution - set the value to get trajectories in mircons
  • frame rate - set the value to get timescale of the trajectories in seconds

Proposed workflow:

  1. choose timelapse tiff sequence and run pre-processing step if necessary
  2. choose between dark or light spots
  3. tune detection parameters to detect all the particles. It is recommended to test the results for a few different frames using "Preview" button
  4. set resolution and frame rate (optional)
  5. set linking parameters
  6. run linking by pressing "Run tracking" button. It will run linking algorithm and offer to save tiff file with plotted trajectories. Check the trajectories and change the linking parameters if needed. Use minimum track length parameter to eliminate short tracks
  7. when the tracks provided by the tracker is good enough - save csv file with the particle trajectories (button “Save data”)
Advice:
  • If the final trajectory is broken into parts - it means, that the detection is failing in a sequence of frames. Firstly, the detection settings can be tuned to detect particles in the sequence, secondly the frame gap can be increased to connect the detection after the sequence of lost detections.

Movie simulation: command line

  • Launch a terminal (or the Anaconda Prompt on Windows)
  • Activate the environment with: conda activate iscat
  • Go to the source directory
  • Run the simulation python scripts/simulate_iscat_movie.py /path/to/track.csv /path/to/output.tif --psf /path/to/psf.tif --gaussian_noise --poisson_noise
    • tracks.csv is a file containing the tracks to reconstruct
    • The optional psf.tif file is a 3D PSF stack were the middle slice is in focus.
    • The PSF can be generated with the ImageJ plugin DeconvolutionLab2
    • Other simulation options can be listed with: python scripts/simulate_iscat_movie.py --help

Movie Simulation: GUI

  • Launch a terminal (or the Anaconda Prompt on Windows)
  • If neccessary activate the environment (e.g. conda activate trait2d)
  • run trait2d_simulator_gui
  • Generate/load trajectory first, then generate the image sequence and save it

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trait2d-1.2.tar.gz (60.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trait2d-1.2-py3-none-any.whl (69.3 kB view details)

Uploaded Python 3

File details

Details for the file trait2d-1.2.tar.gz.

File metadata

  • Download URL: trait2d-1.2.tar.gz
  • Upload date:
  • Size: 60.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for trait2d-1.2.tar.gz
Algorithm Hash digest
SHA256 ed0cdf054fe40fca16f992ee96b69498f6ef18bc36b124245343baba49b00f2b
MD5 b6358cf17354089223245b123c6a2063
BLAKE2b-256 4904cb21eee3e748cbfec157e9b9d1a9ac188ed8c18f890710c820a61fa37ed7

See more details on using hashes here.

File details

Details for the file trait2d-1.2-py3-none-any.whl.

File metadata

  • Download URL: trait2d-1.2-py3-none-any.whl
  • Upload date:
  • Size: 69.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for trait2d-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 42f30451dcbd4fad917553ef171db6957add5a0b68f239a7c940d0771c8294ec
MD5 a4354f1c9ae718f5950e590572b04453
BLAKE2b-256 b63360ed938cc08e10d5b6de9857927833d51a8319408ed4df08e31873f02ead

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page