This project is designed for segmenting and tracking cells in time-lapse microscopy images using Otsu thresholding and Cell ACDC tracking. It includes additional functions for filtering tracked cells, calculating their movement speeds, and visualizing results.
- Image Preprocessing: Rescales intensity and applies Gaussian filtering.
- Segmentation: Uses Otsu thresholding and region filtering.
- Tracking: Integrates with Cell ACDC for object tracking.
- Filtering: Removes objects not present for a minimum number of frames.
- Speed Calculation: Computes movement speeds over time.
- Data Visualization: Generates boxplots and fits Michaelis-Menten kinetics.
Ensure you have Python installed (recommended version: 3.13+). You can download Python from python.org. Make sure to check the box for python to be added to system PATH!
Download the files form this repository in a zip folder (or clone the repository). Unpack the folder into the desired location. Open the command prompt. Navigate to the folder into which you have extracted the data using the commands:
- Windows:
For example:
cd path\to\extracted\folder
cd C:\molmot-master
- Mac/Linux:
cd path/to/extracted/folder
It is recommended to create a virtual environment to manage dependencies.
python -m venv venvActivate the virtual environment:
- Windows:
venv\Scripts\activate
- Mac/Linux:
source venv/bin/activate
Run the following command to install all required Python libraries:
pip install -r requirements.txtIf requirements.txt is not available, install dependencies manually:
pip install numpy tqdm scikit-image pandas matplotlib seaborn scipy- Place your image files inside the
imgs/oradditional_imgs/directory. - !Modify the configuration parameters in the script as needed (e.g., segmentation settings, time interval, pixel size, etc.)!.
- Open the command prompt and move to the folder where you placed the files during installation. View Step 2 of the installation guide to see how to navigate there.
- Run the script:
python main.py- For tracking, please use Cell ACDC. The created data structure should also allow users to easily view and edit data in Cell_ACDC.
- Restructure data for ACDC: Set
restruc_for_acdc_toggle = True. The input should be inimgs/additional_imgs, with tif files in folders. These folders should have the conc. of ATP as their name. - Segment images: Set
segment_toggle = True. Segments the tif files using some preprocessing and otsu adaptive thresholding. - Filter tracked IDs: Set
filter_cont_tracking_toggle = True. Filters for IDs which have been tracked for a certain number of frames. - Calculate speeds: Set
get_speed_toggle = True. Gets the speeds of the tracked objects based on their centroids. - Generate boxplots: Set
boxplot_toggle = True. Creates plots (violin and box plot)
- Segmented cell masks (
.npzfiles, in\imgs\5\Position_0\Images) - Filtered tracking data (
.npzfiles, in\imgs\5\Position_0\Images) - Speed CSV files (in
\imgs) - Plots and fitted kinetic models (in
\imgs)
This project is released under the MIT License.