-
Notifications
You must be signed in to change notification settings - Fork 1
DiSTNet2D (legacy version)
This tutorial is based on the work described in this publication. DiSTNet2D is a deep learning-based method that simultaneously segment and track bacteria, leveraging temporal information from neighboring frames.
We will see how to:
- Import trained weights and load a movie to analyze it with DiSTNet2D in BACMMAN
- Run the analysis
- Visualize and export results
If necessary, install bacmman, along with Tensorflow 2. Follow the Install From FIJI and the Tensorflow 2.x (CPU) or Tensorflow 2.x (GPU) instructions. If you do not know which option to choose between CPU and GPU, choose CPU.
This should work smoothly on Linux, Windows, and MacOS X with Intel CPU. Since November 2025, it is also compatible with recent Apple computers (with Apple silicon CPU).
- Start the BACMMAN plugin
- In Fiji, go to
Plugins > BACMMAN > BACteria in Mother Machine ANalyzer - Set Working directory (at the first use): Right-click on the Working directory area and select a folder where you want to store BACMMAN data.
- Go to
Dataset > New dataset from online library. - Enter username: jeanollion
- Click
Load Public Configuration. - Select
Distnet2D > PhC-C2DH-PA14(orFluo-C2DH-HBEC). - Choose a local name for the dataset.
- Click
OK.
- Go to
Import/Export > Sample dataset > Cell tracking > Bacteria 2D(orHuman Cells 2D). - Choose a local folder to save the .tif file.
- Click
Download.
- Click on the
Home tab. - Right-click in the Position window area.
- Select
Import/re-link image. - Navigate to the folder where the .tif file is saved and select the file.
- Click on the
Configuration testtab. - Select
Simplifiedin the Test mode area. - Select
Processingin the Step area. - You can reduce the frame range to speed up computation: Right-click on the Frame range area and move the sliders.
- Right-click on
DistNet2D > Test Segmentation and Trackingto launch the computation. - The first time you launch, there may be a long initialization of the database (dozens of seconds).
CPU processing time for the bacterial sample dataset:
- Macbook early 2015, with MacOS Mojave: 10 seconds/frame
- Macbook air M4 2025, with MacOS Sequoia: 1.8 seconds/frame
- PC with Intel Core i7-8559U and Windows 11: 3 seconds/frame
- PC with Intel Core i7-8700 and Windows 11: 2 seconds/frame
- AMD Ryzen 3 5425u, with Ubuntu 22.04: 3 seconds/frame
The results are displayed in a "Hyperstack" window, where each color represents a track. The EDM and center map are displayed as well.
- Click on the
Configuration testtab. - Select
Advancedin the Test mode area. The configuration tree now shows all available options for the Prediction, Segmentation, and Tracking stages. By default, all settings are adequate for processing the provided datasets, but you can adjust them as needed. - Right-click on an option to explore the possible values (among a drop-down menu or a numerical value).
- Select
Processingin the Step area. - You can reduce the frame range to speed up computation: Right-click on the Frame range area and move the sliders.
- Right-click on
DistNet2D > Test Segmentation and Trackingto launch the computation. - In advanced mode, all predicted proxies are displayed along the result window (EDM, GDCM, centers, dX, dY). Feel free to explore all the proxies, change settings and see the effect on the results. For instance, if you increase the
Tracker:DistNet2D > Segmentation > Min Max EDM Threshold, less cells will be detected. - The post-processing stage can be turned off with the option
Tracking>Post- Processing>NO_POST_PROCESSING. - If you are satisfied with the current configuration, you can now process the entire movie.
- Click the
Hometab. - Select the position you want to process in the Position window area, select
Bacteriain the Objects area, selectSegment and Trackin the Tasks area. - Go to menu
Run > Run selected task. - The result database is automatically saved on the hard drive in the subfolder corresponding to the position, within the folder defined as the working directory.
- After the processing is complete, go to the
Data Browsingtab. - Right-click on the position name corresponding to the position you analyzed in the Segmentation & Tracking Results area.
- Select
Open Hyperstack > Bacteria. - A window showing the analyzed movie opens. To display the results, press Ctrl+Q.
- In track mode, the contour of each cell is colored according to its track ID. Each press on Ctrl+Q randomizes the contour colors. In object mode, all contours are displayed in pink. To switch between modes, press S.
- All the shortcuts are listed in the Help window (F1).
- You can make edits to the results such as creating a cell, splitting a cell, merging multiple cells, and more.
- You can create or delete links.
- Refer to the Help windows (F1) for the complete lists of tools, and this page about data curation for further assistance.
- All changes are automatically saved on the database file (unless the safe mode is activated, by pressing U).
- Go to menu
Options > Measurements > Extract by position. Selecttrue. - Click on the
Hometab. - Select the position you want to process in the Position window area, select
Bacteriain the Objects area, selectMeasurementsin the Task area. - Go to menu
Run > Run selected task. - The software performs measurements on every track.
- Select the position you want to process in the Position window area, select
Bacteriain the Objects area, selectExtract measurementsin the Task area. - Select the menu
Run > Run selected task. - A .csv file is created in the dataset folder.
- Click on the
Data Browsingtab. - Right-click on the position you want to process and select
Create Selection > Viewfield. - Click on the
Hometab. - Right-click in the Tasks to execute area and select
Extract Dataset > Add new dataset extraction task to list. - Click on
Viewfieldin the Selections area. - Right-click on
output fileand enter a name for the file. - Click on the arrow left to
Features, then on the arrow next toFeature #0. Right-click onFeatureand selectModules > Labels. - Click
OK. Then, right-click in the Tasks to execute area and selectRun all tasks. - A .hdf5 file is created in the dataset folder. This file contains the label images and can be opened within Fiji.