-
Notifications
You must be signed in to change notification settings - Fork 4
Distance to ROI analyses
Notebook | Input data | Optional data |
---|---|---|
Distance to ROI | CellTracksColab format*, ROI images | Raw movies |
* Output of the TrackMate and Custom notebooks, for more information see here
The "Distance to ROI" notebook in CellTracksColab analyzes movement tracks relative to designated Regions of Interest (ROIs). It computes the distances between moving objects (tracks) and ROIs, providing insights into spatial behavior. This notebook is essential for studying movement patterns, interactions, and overall dynamics of tracked entities in relation to ROIs.
Note: This notebook only works with 2D + t datasets
- DataFrames from CellTracksColab: Ensure spots and tracks DataFrames compiled by CellTracksColab are available.
- ROI Images in TIF Format: Use mask or label images in TIF format with a pixel value of 0 for the background.
-
Consistent Naming of ROI Images: Follow a consistent naming convention like
File_name_ROI_name.tif
. - ROI Image Files in One Folder: For streamlined access and analysis, store all ROI image files in the same folder.
- Load Your Dataset: Import spots and tracks DataFrames from CellTracksColab.
- Specify ROI Folder Path: Indicate the directory containing ROI images, following the correct format and naming conventions.
- Define ROI Name and Pixel Calibration: Align the ROI name with image files and specify pixel calibration for accurate measurements.
- ROI Image Processing: Read ROI images, ensuring correct naming and format.
- Distance Transform Application: For each spot in the DataFrame, calculate the distance to the nearest labeled pixel in the ROI image using the distance transform method.
- Pixel Calibration Adjustment: Convert distances from pixel units to real-world units (e.g., micrometers) using the pixel calibration value.
- Visual Check: Validate computed distances in the notebook.
Calculate metrics like MaxDistance, MinDistance, MedianDistance, and more to analyze spatial behavior in relation to ROIs.
-
MaxDistance_{ROI_name}:
- The maximum distance of the track from the ROI during the tracking period.
- Indicates the farthest point reached relative to the ROI.
-
MinDistance_{ROI_name}:
- The minimum distance of the track from the ROI during the tracking period.
- Represents the closest approach to the ROI.
-
StartDistance_{ROI_name} and EndDistance_{ROI_name}:
- Distances from the ROI at the start and end of the tracking period, respectively.
- Useful for understanding initial and final positioning relative to the ROI.
-
MedianDistance_{ROI_name}:
- The median of all recorded distances to the ROI.
- Provides a central tendency measure, less affected by outliers than the mean.
-
StdDevDistance_{ROI_name}:
- Standard deviation of the distances.
- Indicates the variability or consistency of the track's distance from the ROI.
-
DirectionMovement_{ROI_name}:
- Calculated as
EndDistance - StartDistance
. - A positive value indicates moving away from the ROI over time, and a negative value suggests moving closer.
- Calculated as
-
AvgRateChange_{ROI_name}:
- Average rate of change in distance per frame.
- Helps assess the speed of movement towards or away from the ROI.
-
PercentageChange_{ROI_name}:
- Percentage change in distance from the start to the end of the track.
- Normalizes the movement relative to the initial distance.
-
TrendSlope_{ROI_name}:
- Slope of a linear regression line fitted to the distance values over time.
- Indicates the general trend of movement (increasing or decreasing distance).
- These metrics are calculated considering the distance to the closest ROI at each time point. If the ROI moves, the metrics reflect the relative motion between the track and the ROI.
- The closest ROI to a track at each time point may change if multiple ROIs exist. This factor is inherently considered in the distance calculations.
- It is essential to consider the movement of both the track and the ROI when interpreting these metrics. For example, a decreasing distance over time could mean the track is moving towards the ROI, the ROI is moving towards the track, or both.
- Follow standard procedures for quality control and plotting track parameters as detailed in other sections. Refer to the wiki pages for instructions.
- Analyze and visualize tracks based on their distance to the ROIs.
- Results, including computed distances and metrics, are saved in the
Distance_to_ROI
sub-folder within yourResults_Folder
.
This notebook offers a comprehensive tool for researchers to understand the interactions and dynamics of tracked entities relative to critical areas in their experiments.
---