Problem with Cell Counter Plugin




I have spent many hours trying to troubleshoot a problem I encountered when using a MacOSX platform and ImageJ. I have tried on a Mac with OS El Capitain as well as OS High Sierra and cannot get the Export Image function to work. I need to export a tiff image with the markers(acquired by an Axioscan) after having used the cell counter plugin to quantify 2 different markers. I can do this on a PC and seemed to have done it once on the Mac but could never reproduce it. Does anyone know if this is a bug ie. a java problem and would anyone know how to write script to overcome this problem?

Thanks in advance for any help! Much appreciated!



So… I tested the functionality of Cell Counter on my Fiji installation (ImageJ 2.0.0-rc-68/1.51t; Java 1.8.0_66 [64-bit]) on my macOS High Sierra Version 10.13.6 and it worked just fine. This is exactly what I did:

  1. File > Open Samples > Blobs
  2. Run Cell Counter
  3. Click “Initialize” (this is step one - has to be done for anything to work)
  4. Added 10 ‘cells’ to Counters: Type 1
  5. Added 3 ‘cells’ to Counters: Type 2
  6. Click “Export Image” - note this guy is an RGB image… (if you hover your cursor over the ‘dots’, you should see ‘blue’, ‘cyan’)
  7. This image can be saved as a .tif file… File > Save As > Tiff…

Here is the tif file I generated (a quick screen-shot):

Can you perhaps provide a bit more information? What are the versions of macOS you are using exactly? What about Fiji? What exact steps are you taking? This will help us help you better in the end…



Thanks so much Eta. My MacOSX is 10.13.4 High Sierra, the Fiji is
version 2 and the java applet is java 8. My steps are pretty much what
you outlined. The file I import is a tiff file. After
initializing, I am working on the image in the Counter Window. After
counting the “cells” with two Types, ie. Type 2 and Type 7, I click on
the Export Image button and either a window opens up of the image
without the markers present or the Console window opens up and I see a
lot of red script with the opening sequence mentioning “Exception in
thread “AWT-EventQueue-0” java.lang.OutOfMemoryError…” ". I have a lot of RAM but I seem to run out of memory quickly when working with Fiji.
Any additional help is greatly appreciated!


Here is the guide to troubleshooting the OutOfMemoryError:

Please read it over, double check how much memory your Fiji has allocated, and let us know how it goes.

In general, that red script output is helpful to copy-and-paste in full. You can enclose it in “fences”—three backtick symbols ``` on each side—and it will render in a fixed-width box. There are often details in these stack traces helpful for programmers to understand what is going wrong, and work toward bug-fixes.


Thanks so much Curtis. I’ll definitely have a look through the guide tomorrow and let you know if I get anywhere : ). Do you think that when the Marker window displays the tiff image but not the markers (this is the other scenario besides the red script) that it may be due to lack of memory?



Ah, I did not notice that part of your earlier message, sorry.

I am not sure why that would happen. When the new window pops up, is it RGB type? And none of the markers are baked in? But your original image definitely has markers? I have not seen that issue before. Are you able to create a concise list of steps to reproduce, like how @etarena wrote above? That would help others to troubleshoot the issue.


Hi Curtis, please see the concise steps below:

  1. File >Open tif image
  2. Plugins> Analyze> Cell counter
  3. Click “Keep Original”
  4. Initialize
  5. Image opens in Counter window, is an RGB image
  6. Select counter Type 1 and count ie 10 “cells” then select counter Type 7 and count 8 “cells”
  7. Click “Export Image”
  8. Markers_Counter Window opens the same RGB image but no markers are visible

Tomorrow I’ll send the red script. It didn’t come up when I went through the steps this evening.



I am having very serious memory issues besides the cell counter export image function which may be a memory problem.

Currently, I can’t even initialize an image in order to count it (while I have 2 other images open at the same time). I have a new Mac computer with 8GB of physical memory. The Fiji application uses 4.85GB memory. The memory used in total is 6.64 GB. My image file folder which I saved to my desktop reads as44.68 GB (on disk). Could anyone let me know what all this means regarding Fiji’s memory alerts.

Thank you!