Counting elements in an image stack (3D)

Dear community,

Unfortunately, i couldn’t find any similar topics in the archive. I would be very thankful for any helpful advice!

I am currently analyzing micro-CT sequences of frogs and need to count the number of cysts in their kidneys. I first tried to do this manually, but some sequences are too challenging for the human eye! I tried to use the multi-point tool, but unfortunately the points are staying at the same place when i’m scrolling back and forth through the stack. Is there some way to add points to a single image of the stack in order to count the cysts by moving back and forth through my section images?

Here is a screenshot to get an idea:
I need to count the black shapes in the kidneys, but not in single image but a stack of hundreds of images…

I hope my request is clear enough, thanks for any advice!

If you associate cyst ROIs with slice numbers (that’s an option in Roi Manager) then you will only see the rois in slices where you put them. Go to Analyze > Tools > Roi Manager… in RoiManager tick the ‘Show All’ box in the bottom, choose More>> Options and tick the ‘Associate “Show All” Rois with slices’ option.
Or see what happens if you run the macro below. This will work with point selections (using shift key to add more than one point) added to slices too but is a bit harder to show in a macro.

run("MRI Stack (528K)");
run("ROI Manager...");
roiManager("Associate", "true");
for(slice = 1; slice<nSlices();slice++){
run("Select None");
for(roi = 1; roi < roiManager("count");roi++){