Hello,
I am running imageJ 2. I want to count objects in a stack. For this I use 3D cell count. It works well when running from the plugin tool, even when there is no object found. In this case it just writes in the Log window that 0 objects were found.
Now I want to make a macro since I have lots of images to analyze. When the 3D objects counter finds objects, everything works fine. However, when no object is found in my stack, a dialogue box pops up saying “No object found” and the macro stopps.
I wonder why this message doesn’t appear when I run it manually on one stack but only when I run my macro? And it is annoying since the macro stops, which I don’t want.

thanks for the help!!

I cannot reproduce this problem. Try the following macro:

run("Blobs (25K)");
run("3D Objects Counter", "threshold=248 slice=8" +
  " min.=50000 max.=65024 exclude_objects_on_edges" +
  " objects surfaces centroids centres_of_masses" +
  " statistics summary");
print("Moving on!");

It shows in the log:

blobs.gif: 0 objects detected (Size filter set to 50000-65024 voxels, threshold set to: 248).
Moving on!

Which means the macro continues after 0 objects are detected by the 3D Objects Counter plugin.

Thanks for your answer.
Yeah its really weird. For some samples, it continues after it found 0 objects and stops if it finds again 0 objects and sometimes it stops right when it finds the first 0 object.

What is Blobs (25K) ?

The command run("Blobs (25K)"); executes the command File :arrow_forward: Open Samples :arrow_forward: Blobs (25K), one of the sample images.

Can you find a sample image in the “Open Samples” menu that illustrates the problem, and post a small macro demonstrating it? We probably cannot help you here unless you can create an MCVE which reproduces the issue.

Hi, I have no sample images in my imageJ directories…

I tried reporting a bug but it says “network failure”. In the java console it says: Got an IOException: java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect

Hi @devya

In ImageJ the File ▷ Open Samples menu contains sample images that are downloaded from the internet when run, so you won’t see files on your local disk unless you explicitly run File ▷ Open Samples ▷ Cache Sample Images

The user guide has more information on the Sample Image topic.

1 Like

Hello.
I finally was able to do a bug report. The firewall at work didn’t allow me to do so, so I use my personal computer now.
The bug report can be found there: http://fiji.sc/bugzilla/show_bug.cgi?id=1175

thanks a lot!

Hello @ctrueden,
it took a while but I was able to file a bug report. Is it correctly made like this? Can you see something wrong in the macro that makes it stop when the window “no object found” appears?
thanks a lot for the help!

I was able to reproduce this behavior with the following macro:

newImage("HyperStack", "8-bit color-mode", 121, 154, 1, 114, 1);
run("3D Objects Counter", "threshold=128 slice=57 min.=10 max.=2124276 objects surfaces centroids centres_of_masses statistics summary");

which displays a “No object found” dialog, whereas if you manually run Analyze ▷ 3D Objects Counter, it doesn’t display a dialog but logs:

HyperStack: 0 objects detected (Size filter set to 10-2124276 voxels, threshold set to: 0).

Ok,
so what do you think would be the solution to that?

Hi @ctrueden,
could you have a look at the report? Am I doing something wrong that you can’t see the report?
Would be great to get some help.
Thanks in advance!!

Yannick

It is on my to-do list.

OK, I checked it out. If you set a valid threshold (within the range of the actual data), then the problem does not occur. I posted some sample code at the bug report.

1 Like

What a beast! thanks man, really awesome help!
Cheers!

"Problem"_description

Hello @ctrueden ,

Thanks for the useful plugin! :slight_smile:
I experience the same issue when running it from a macro. It gives out statistical results as normally, but it doesn’t produce the objects image. I am sure the threshold value is valid, and it does run as usual when doing it manually.

Do you have any other suggestion? Kindly keep in mind that I don’t have much experience with macro programming, though can follow the logic.

PS: I apologize for reviving this old topic, but the issue seems exactly the same.

Solved. My mistake - I had an unnecessary “close();” line which… well, it was closing the Objects image, :upside_down_face:. Thanks!

2 Likes