October 10th, 2025
Here we provide instructions on effectively utilizing SegElegans, a deep learning system we developed for the automated segmentation of individual worms in widefield microscopy images, for subsequent use in image analysis software such as ImageJ. We provide ways to use the system both online and offline.
C.elegans research makes routine use of in vivo imaging techniques to monitor processes and answer questions about cell biology. The analysis of the imaging data often requires spending significant time designating regions of interest by making manual selections in the software. Existing options that could automate the process of generating individual worm ROIs are lacking in precision.
And often have difficulties distinguishing touching or overlapping worms. To begin, image adult worms using a widefield microscope with a 4x objective lens. If the data is measured in brightfield images, acquire them normally.
If the data is measured in dark field fluorescence images, acquire them simultaneously with matching brightfield guide images using the multi-channel acquisition options in the microscope software. Ensure both image sets are saved with identical names, but placed in separate folders. To run the online version of SegElegans, first log into a Google account using a web browser.
Enter Google Drive and upload the folder containing brightfield or guide images. Open the GitHub page and click on the SegElegans Body Prediction Interface. ipynb file.
Press the open in CoLab button at the top of the opened file. Ensure that CoLab is running a CUDA compatible GPU runtime. Press the play button to execute code block one and grant runtime permissions.
Next, execute code block two to load Google Drive into the runtime. Accept all confirmation dialogues, and grant all requested permissions. Then execute code blocks three and four in order, ensuring block three completes fully before running block four.
Open the folder tab icon on the left in the CoLab interface, and find the folder with your guide images. Copy the path, then paste it into the test images input form of code block five. Also specify a separate path for the analysis output.
Execute code block five. Specify the exact image extension to be analyzed in code block six. Execute code block six, and wait for completion.
Now, execute code block seven without changing inputs and less memory issues occur. In a separate tab or window, access Google Drive and open the output folder. Choose one of three options.
The first option is to use the ROIs from one all ROIs results, and reject unwanted ROIs in Image J.The second option is to accept the curated good masks from one complete mask without any manual correction, although this will not include the segmentations of overlapping worms. The third and recommended option is to manually adjust the curation. In order to do that, use code block eight.
Examine the results of the initial curation from the summary graphs in the zero summary results folder. For each image that needs correction, input the full name of the original input image in the name image change form. And the numbers of the masks to be kept, separated by commas in the index images form.
Now, execute code block eight. After completing or skipping the curation correction, execute code block nine to generate the two curated ROIs results folder. The folder includes all the final curated segmentations in the Image J format.
To run the pipeline on a new set of images, reset the runtime by navigating to runtime, then choose restart session and repeat the procedure from the beginning. It is also possible to run SegElegans without cloud computing on a local machine using Jupyter or a Python script. To import the segmentations, open one of the actual data images in Image J.Open the corresponding zip file containing the ROIs of that image to load the selections into the Image J ROI manager.
If they are from the two curated ROIs results output, proceed with analysis using the desired methods, preferably automated with macros. If the ROIs originate from the one all ROIs results output, remove unwanted segmentations from the ROI manager. Select them and press the delete button on the ROI manager window.
Then proceed with analysis normally. If software other than Image J is required, import the segmentations as binary masks instead. In the validation and performance testing experiments, SegElegans significantly reduced the average time required per image compared to manual segmentation.
Cutting it from approximately 245 seconds to under 60 seconds. SegElegans achieved a segmentation intersection over union score above 93%outperforming all alternative models listed at the time of publication. SegElegans is a deep learning system that utilizes a special architecture that permits the accurate segmentation of individual worms, even in crowded images.
SegElegans is important and versatile tool that can help expedite the analysis of microscopic data without sacrificing accuracy.
View the full transcript and gain access to thousands of scientific videos
This study presents SegElegans, a deep learning system developed for the automated segmentation of individual C. elegans worms in widefield microscopy images. The system aims to enhance image analysis efficiency with significant time savings and high segmentation accuracy.