Aug 14, 2025

Public workspaceImage processing and egg quantification using Fiji

  • Cassidy Schneider1,
  • Spencer Koury1,
  • Laurie Stevison1
  • 1Auburn University
Icon indicating open access to content
QR code linking to this content
Protocol CitationCassidy Schneider, Spencer Koury, Laurie Stevison 2025. Image processing and egg quantification using Fiji. protocols.io https://dx.doi.org/10.17504/protocols.io.q26g75bo3lwz/v1
Manuscript citation:
Schneider C, Koury S, Stevison L. 2025. Protocol: An absolute egg-to-adult viability assay in Drosophila melanogaster. microPublication Biology. 10.17912/micropub.biology.001656
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working, but the GitHub is private
Created: April 03, 2025
Last Modified: August 14, 2025
Protocol Integer ID: 126107
Keywords: Drosophila, egg-to-adult viability, egg counting, point-and-click, ImageJ, egg quantification, count egg, count of egg, image processing step, egg, cropped image, cropping, input image, image capture, fiji this protocol detail, new versions of each input image, image processing, image, using fiji, use of fiji script, image capture with raspberry pi, image with the pixel, food surface, edges of the food, vial, pixel, fiji script
Funders Acknowledgements:
NIH
Grant ID: R35GM147501
Abstract
This protocol details the use of Fiji scripts (available at: https://github.com/StevisonLab/Egg-to-adult-viability) to process images and count eggs using a point-and-click approach. After the image processing step, there will be three new versions of each input image, named with the input file name followed by "_cropped" (the image cropped to the edges of the food), "_prepped" (the cropped image with the pixels outside the food surface made black) and "_validated" (a copy of the "_prepped" file that indicates the cropping has been validated). Performing point-and-click annotations creates a .csv file containing the count of eggs for each vial, as well as files containing the annotations in the .roi format and .tiff files with the annotations as an overlay.
This protocol was developed to be used following the protocol:
- Image capture with Raspberry Pi (dx.doi.org/10.17504/protocols.io.261geeoywg47/v1)
Materials
  • Fiji set up with required scripts (see "Before start")
  • Folder containing images of vials to be processed
Troubleshooting
Before start
This protocol requires the use of Fiji,
If you have not already, download Fiji: (https://imagej.net/software/fiji/).
1. Navigate to the folder where Fiji is located and open it.
- On Mac: Right-click Fiji and select “Show Package Contents”
- On Windows: Open the Fiji.app folder
2. Clone the Github repository containing the Fiji macros (https://github.com/StevisonLab/Egg-to-adult-viability) into the "scripts" subfolder.
3. Install the IJ-OpenCV plugin by following the directions at https://github.com/joheras/IJ-OpenCV.

Now, when you open Fiji, there should be a "Egg-to-adult-viability" tab in the menu bar with a drop-down menu containing the required scripts.
Detect region of interest and crop
From menu bar, click "Egg-to-adult-viability" > "Crop and validate"
Fill out prompt box
In “Raw photos directory” field, select folder containing raw images for cropping (works if images are in subfolders)
In “Processed photos directory” field, select destination folder for cropped images (maintains subfolders as present “Raw photos directory”) (does not have to exist)
In “File extension” field, enter extension of raw images (should be .png)
Select “Use previously saved ROIs” if you want to skip circle detection for images that already have files containing a circle selection. Do not select this if you want to run circle detection for every image, regardless of previous status
Select "Skip previously validated images" if you want to skip images that already have a validated cropped file saved
Select "Validate as it goes" if you want to be prompted to validate each detected region before the next is cropped
Select OK
Wait for the script to go through every image in the selected folder. It will open each image to perform operations on it. Do not close any image windows it opens during this time.
  • If you selected "Validate as it goes", Go to
  • Otherwise, Go to
Step case

Perform validation as you go
12 steps

Validate cropping
For each prompted window that opens:
View cropped image on left and prepped image on right

Evaluate if image has been cropped accurately to edges of food
In “Validate image cropping” popup, select “Yes” if cropping is valid, select “No” if it is not, and select “Cancel” at any time (progress will be preserved)
If cropping was not accurate, adjust the borders of the circle selection on the raw image when it opens. If there was no circle selection, make one
Select “Done” in “Adjust circle selection” popup
If you select “Cancel”, changes to circle selection will not be saved


Run point-and-click
From menu bar, click “Egg-to-adult-viability” > “Point and click”

Fill out prompt box
In “User” field, enter your name
In “Picture directory” field, choose folder of images for analysis
Note
If chosen folder contains subfolders, images they contain will also be processed

Select mode
  • Create new file: Start from scratch without deleting previous point-and-click data
  • Append to existing file: Pick up where you left off
  • Overwrite existing file: Start from scratch and overwrite user’s previous point-and-click data

Protocol references
Domínguez, C., Heras, J., & Pascual, V. (2017). IJ-OpenCV: Combining ImageJ and OpenCV for processing images in biomedicine. Computers in Biology and Medicine, 84, 189–194. 10.1016/j.compbiomed.2017.03.027
Schindelin, J., Arganda-Carreras, I., Frise, E., Kaynig, V., Longair, M., Pietzsch, T., Preibisch, S., Rueden, C., Saalfeld, S., Schmid, B., Tinevez, J.-Y., White, D. J., Hartenstein, V., Eliceiri, K., Tomancak, P., & Cardona, A. (2012). Fiji: An open-source platform for biological-image analysis. Nature Methods, 9(7), 676–682. 10.1038/nmeth.2019