Package: trait2d
TRAIT2DTRAIT2D (available astrait2d) 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 atGitHub Pages.FeaturesSPT simulation, tracking and analysisuser-friendly GUIs for simple taskscustomisable libraries for more advanced usersopen source under the GNU General Public LicenseInstallationInstallation methods have been tested on Linux and Windows.Install from PyPI (Recommended)Prerequisites:A Python installation (version >= 3.7 is required)Installation:runpip install trait2dInstall from Source (Not Recommended)Prerequisites:A Python installation (version >= 3.7 is required)Optional: A Git installationInstallation:clone the GitHub repositoryrungit clone https://github.com/Eggeling-Lab-Microscope-Software/TRAIT2DORvisithttps://github.com/Eggeling-Lab-Microscope-Software/TRAIT2Dclick the greenCodebutton and thenDownload ZIPextract the downloaded.zipfile anywhere on your computerchange to the directory that was just created (should contain asetup.pyfile)runpip install -e .QuickstartGUIsThere are GUIs available for simple simulation, tracking and analysis tasks.To start using them follow these steps:open a terminalif you installed the package with conda to a separate environment, activate it (e.g.conda activate trait2d)typetrait2d_analysis_gui,trait2d_simulator_guiortrait2d_tracker_guiand hit enterLibrary ModulesTo use thetrait2dmodules, you can import them in your Python scripts or notebooks.The simulator module is available astrait2d.simulatorsand the analysis module astrait2d.analysis.For more information, check the documentation on thesimulationandanalysislibraries.Examples are available in thegallery.Further GUI UsageYou can find more information and GUI descriptions in the documentation on theanalysis,simulator, andtrackerGUIs.Detection and TrackingLaunch a terminal (or theAnaconda Prompton Windows)if neccessary, activate the environment (e.g.conda activate trait2d)runtrait2d_tracker_guiSetting 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 detectionsresolution - set the value to get trajectories in mirconsframe rate - set the value to get timescale of the trajectories in secondsProposed workflow:choose timelapse tiff sequence and run pre-processing step if necessarychoose between dark or light spotstune detection parameters to detect all the particles. It is recommended to test the results for a few different frames using "Preview" buttonset resolution and frame rate (optional)set linking parametersrun 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 trackswhen 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 lineLaunch a terminal (or theAnaconda Prompton Windows)Activate the environment with:conda activate iscatGo to the source directoryRun the simulationpython scripts/simulate_iscat_movie.py /path/to/track.csv /path/to/output.tif --psf /path/to/psf.tif --gaussian_noise --poisson_noisetracks.csvis a file containing the tracks to reconstructThe optionalpsf.tiffile is a 3D PSF stack were the middle slice is in focus.The PSF can be generated with the ImageJ pluginDeconvolutionLab2Other simulation options can be listed with:python scripts/simulate_iscat_movie.py --helpMovie Simulation: GUILaunch a terminal (or theAnaconda Prompton Windows)If neccessary activate the environment (e.g.conda activate trait2d)runtrait2d_simulator_guiGenerate/load trajectory first, then generate the image sequence and save it