Error with CellCounter in a macro

Hello,

I also have a problem concerning loading a macro.
For the cell counter plugin one can save a macro which allows changing the counter type with the keyboard (https://imagej.nih.gov/ij/plugins/cell-counter.html). Now, after the update, if I try to use this macro the following error appears:

Error: Could not load class CellCounter in line 7:
macro "Type 7 [7]" { call ( "CellCounter.setType" , "7" <)> ; } 

Have you heard about this issue and how to resolve it?
Thanks in advance!

1 Like

Are you really talking about the jar file on that page, last updated in 2010?

I’m asking because Fiji ships its own version of this plugin, documented here:

with the source code here:


I just tried and can reproduce the issue with the Cell Counter plugin included in Fiji. The macro doesn’t work anymore because the CellCounter class was moved into the sc.fiji.cellCounter package. So an updated version of the macro should read:

macro "Type 1 [1]" {call("sc.fiji.cellCounter.CellCounter.setType", "1");}
macro "Type 2 [2]" {call("sc.fiji.cellCounter.CellCounter.setType", "2");}
macro "Type 3 [3]" {call("sc.fiji.cellCounter.CellCounter.setType", "3");}
macro "Type 4 [4]" {call("sc.fiji.cellCounter.CellCounter.setType", "4");}
macro "Type 5 [5]" {call("sc.fiji.cellCounter.CellCounter.setType", "5");}
macro "Type 6 [6]" {call("sc.fiji.cellCounter.CellCounter.setType", "6");}
macro "Type 7 [7]" {call("sc.fiji.cellCounter.CellCounter.setType", "7");}
macro "Type 8 [8]" {call("sc.fiji.cellCounter.CellCounter.setType", "8");}

Can you try if it works if you change your macro like that?

(Maybe @ctrueden has an idea how to make the plugin backwards-compatible so that call("CellCounder.setType") keeps working?!)

2 Likes

It works! :partying_face:
Thank you very much! This makes cell counting much easier again!

2 Likes

I had the same problem, and this solved it.
Perhaps this could be added to the Cell Counter documentation?