A Python-based application for analyzing PIEZO1 protein distribution and membrane dynamics using TIRF microscopy data.
This tool enables simultaneous analysis of membrane dynamics, curvature, and PIEZO1 protein distribution along cell edges using Total Internal Reflection Fluorescence (TIRF) microscopy data. It processes two types of image sequences:
- Binary segmented images showing cell position (cell mask)
- Fluorescence recordings of PIEZO1 protein distribution
The application provides a powerful interface for investigating the relationship between membrane movement, curvature, and protein localization.
- Tracks membrane movement between consecutive frames
- Classifies movement as expanding, retracting, flowing, or stationary
- Calculates velocity vectors and movement magnitudes
- Visualizes movement patterns with color-coded vectors
- Calculates local membrane curvature using circular arc fitting
- Maps curvature along the entire cell edge
- Correlates curvature with membrane dynamics and protein intensity
- Supports multiple curvature calculation methods
- Processes entire time-series sequences
- Creates kymographs to track specific membrane regions over time
- Analyzes correlation coefficients across frames
- Tracks movement class distributions throughout sequences
- Multi-tab interface with specialized views
- Real-time visualization updates when changing parameters
- Color-coding for different movement types and curvature values
- Export options for data and figures
- Clone the repository:
git clone https://github.com/yourusername/piezo1-dynamics-tracker.git
cd piezo1-dynamics-tracker- Create and activate a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Python 3.8+
- NumPy
- OpenCV (cv2)
- SciPy
- Matplotlib
- PyQt6
- scikit-image
- pandas
Run the application using:
python main.py- Click "Load Cell Mask Sequence" to select the first frame of your binary cell mask sequence
- Click "Load PIEZO1 Sequence" to select the first frame of your PIEZO1 fluorescence sequence
The application supports:
- Multi-page TIFF files
- Sequences of individual TIFF files with sequential numbering
- Pixel Size: Set the physical pixel size in nanometers (typically 100-200 nm)
- Time Between Frames: Set the time interval in seconds between frames
- Edge Smoothing: Adjust the Gaussian smoothing of the detected edge
- Frame Range: Select specific frames for analysis (useful for large datasets)
- Navigate to desired frame using the frame slider or buttons
- Adjust analysis parameters as needed
- Click "Run Analysis" to process selected frames
- View results in various visualization tabs
-
Main View: Change display mode between:
- Original: Raw image data
- Cell Mask: Binary segmentation
- Optical Flow: Movement vectors between frames
- Curvature-Motion: Curvature mapped to color with motion vectors
- Movement Classification: Membrane segments colored by movement type
-
Correlation Analysis: Plots of curvature vs. velocity with statistical analysis
-
Time Series: Temporal plots of correlation, curvature, and movement classes
-
Kymograph: Time-position plots for tracking membrane regions over time
- Export Data to CSV: Save all analysis data to a CSV file for further processing
- Export Figures: Save current visualizations as high-resolution images
The application classifies membrane movement into four categories:
- Expanding: Outward movement (red)
- Retracting: Inward movement (blue)
- Flowing: Tangential movement along the membrane (green)
- Stationary: Minimal movement (gray)
Classification is based on the angle between velocity vectors and membrane normal vectors, along with magnitude thresholds.
Curvature is calculated using:
- Finite Difference: Direct calculation from coordinate derivatives
- Circle Fit: Fitting circular arcs to membrane segments
- Spline: Fitting and analyzing smooth spline curves
The curvature sign convention is:
- Positive curvature: Membrane curved toward cell interior (concave)
- Negative curvature: Membrane curved toward cell exterior (convex)
Membrane motion is tracked using:
- Lucas-Kanade optical flow for precise point tracking
- Contour correlation between frames
- Normal vector projection for movement classification
The application automatically excludes image borders from analysis to prevent artifacts. Points within 40 pixels of image edges are ignored.
Process entire sequences with:
- Batch mode for analyzing multiple frames
- Range selection for processing specific subsets
- Progress tracking for long operations
Investigate relationships between:
- Curvature and normal velocity
- Curvature and PIEZO1 intensity
- Movement class and PIEZO1 distribution
- Load cell mask and PIEZO1 sequences
- Set correct pixel size and time interval
- Adjust edge smoothing parameter
- Select a range of frames (e.g., frames 10-30)
- Run analysis
- Explore the different visualization tabs
- Identify regions of interest and track their behavior
- Export results for publication or further analysis
- No contour detected: Adjust binary mask or check image format
- Missing motion data for first frame: Normal, as motion requires two frames
- Border artifacts: Increase border margin in source code if needed
- Performance issues: Reduce frame range, use fewer sample points
This project is licensed under the MIT License - see the LICENSE file for details.
This tool was developed for analyzing PIEZO1 mechanosensitive ion channel distribution in relation to membrane dynamics and curvature in TIRF microscopy data.
For questions and support, please open an issue on the GitHub repository.
Built with AI assistance from Claude (Anthropic).
