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…


1 Like

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?


1 Like

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 @etadobson 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!


Did you go through the Trouble-Shooting page that @ctrueden sent you in his previous post?

And also… what he indicated there to share as well:

That will help us help you better in this issue.


1 Like

Hi Ellen,
thanks for following up. I tried to enclose the script in “fences” but couldn’t add text/symbols to the console window red script. Could you explain in a bit more detail how to do this? I haven’t looked at the environment variable but will do!



You just need to copy/paste the text in the error message you are seeing in Fiji… and paste it here on the forum and enclose it with ``` on either end of the text. So if you look at this post here I am making as if you are going to ‘edit’ it (at the bottom of this post click the pencil icon) … the following text I am writing is enclosed by those ‘fences’…

This text is now being read as 'code'... so you can put the entire error message in the forum to be easily read by us to better help you...

Make sense?


Hi sanja

I thought I had the same problem as you do/did. Do not know if you might have figured it out already. I counted cells on a tile scan (as you used an Axioscan, I thought you might have, too) which is quite a big file. After clicking the export button, the “Markers_Counter Window” opens, but no markers are visible. Did you try to really zoom in into you cells? In my case the markers where tiny tiny tiny, and not visible when looking at the whole picture. Only when I zoomed in, I could see the markers…

Hope this solves the whole problem :slight_smile: