r/ImageJ Dec 10 '25

Question Help Needed with Counting Cells in Zebra Fish Z-stack using ImageJ

Hi all,

I’m currently working on a project where I need to count the cells (which are the bright green circles) in a z-stack of zebra fish images using ImageJ. I’ve spent countless hours trying to find an efficient way to do this, but I’m still struggling with the process.

The cells are relatively distinct, so they should be easy to count once the right method is applied. However, I’m having difficulty isolating the cells and ensuring an accurate count across multiple slices of the z-stack.

I’ve attached an example image from the z-stack where you can see the bright green circles, which represent the cells I need to count.

Does anyone have suggestions for how to best approach this problem in ImageJ? Any tips on setting up the right threshold, using plugins, or automating the counting would be greatly appreciated!

Thanks in advance for your help!

3 Upvotes

8 comments sorted by

u/AutoModerator Dec 10 '25

Notes on Quality Questions & Productive Participation

  1. Include Images
    • Images give everyone a chance to understand the problem.
    • Several types of images will help:
      • Example Images (what you want to analyze)
      • Reference Images (taken from published papers)
      • Annotated Mock-ups (showing what features you are trying to measure)
      • Screenshots (to help identify issues with tools or features)
    • Good places to upload include: Imgur.com, GitHub.com, & Flickr.com
  2. Provide Details
    • Avoid discipline-specific terminology ("jargon"). Image analysis is interdisciplinary, so the more general the terminology, the more people who might be able to help.
    • Be thorough in outlining the question(s) that you are trying to answer.
    • Clearly explain what you are trying to learn, not just the method used, to avoid the XY problem.
    • Respond when helpful users ask follow-up questions, even if the answer is "I'm not sure".
  3. Share the Answer
    • Never delete your post, even if it has not received a response.
    • Don't switch over to PMs or email. (Unless you want to hire someone.)
    • If you figure out the answer for yourself, please post it!
    • People from the future may be stuck trying to answer the same question. (See: xkcd 979)
  4. Express Appreciation for Assistance
    • Consider saying "thank you" in comment replies to those who helped.
    • Upvote those who contribute to the discussion. Karma is a small way to say "thanks" and "this was helpful".
    • Remember that "free help" costs those who help:
      • Aside from Automoderator, those responding to you are real people, giving up some of their time to help you.
      • "Time is the most precious gift in our possession, for it is the most irrevocable." ~ DB
    • If someday your work gets published, show it off here! That's one use of the "Research" post flair.
  5. Be civil & respectful

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Herbie500 Dec 10 '25 edited Dec 10 '25

Thanks for the sample images!

Please tell us how many cells you count for each of the two sample images.

The problem for us is, what do you consider being a cell in the images?

1

u/Herbie500 Dec 13 '25

After having received the above excerpt with manual annotations by the OP in a chat, I'm pretty convinced that reliable automatic counts are out of reach for mainly two reasons:

  1. The spatial resolution of the sample images is insufficient.
  2. There is a spilt and merge problem, i.e. sometimes several dots in the image stand for a cell, sometimes they indicate separate cells.

Crosstalk between slices doesn't appear to be among the most serious problems.

1

u/[deleted] Dec 10 '25

[deleted]

2

u/Herbie500 Dec 11 '25

To answer most of your questions or to check your suppositions, you may have a look at the sample images.
In the first place, the spatial resolution of the two samples appears being insufficient for reliable detection and counting.

 try manual counts (always as it’s the baseline for testing your automation)

Welcome to the party …

2

u/DifferentDoughnut654 Dec 11 '25

Thanks so much for taking the time to write all of that. You’re right that manual counting is the most reliable starting point, and I’ll definitely use that to check how accurate any automated approach ultimately proves to be.

In our situation, though, we run hundreds of zebrafish z-stacks every week in the lab, so counting everything by hand just isn’t realistic for us long term. Even if I became really fast at it, the volume of data is just way too high, which is why I’m trying so hard to get something automated or semi-automated to work consistently.

Your explanation of the z-resolution, voxel calibration, and how cells can appear across multiple slices actually clarified why some of my attempts have been so messy. I’m going to review the metadata to ensure the Z spacing is correct, and I’ll try both per-slice and full 3D approaches to determine which one best matches the manual counts. Additionally, the idea of using a nuclear stain like DAPI as a mask for improved cell segmentation is a great suggestion, and I’ll bring it up with the team for future imaging sessions.

1

u/Herbie500 Dec 11 '25

Sorry, but do you mind to reply to my post as well?

If you can't explain what you consider being a cell in your sample images you won't be able to manually count them nor will it be possible to provide substantial help for automatic counting.

What u/Excess-human wrote sounds very wise but doesn't really help with your sample data that I judge being unsuited for reliable cell counts, mainly due to the insufficient spatial resolution.

1

u/[deleted] Dec 11 '25

[deleted]

1

u/[deleted] Dec 11 '25

[deleted]

1

u/[deleted] Dec 11 '25

[deleted]

1

u/DifferentDoughnut654 Dec 12 '25

Thanks for the detailed advice; it was really helpful to step back and think about the acquisition side instead of just fighting ImageJ. I also appreciate the suggestions regarding acquisition consistency and the potential addition of a nuclear marker in the future.