imagej / imagej/ImageJ

Analyze Particles creates unexpected measurement

Open
#211 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
786
Forks
267
PR merge metrics
No merged PRs in 30d

Description

I created a macro to just count objects in a binary image.
For this I add the objects to the ROI manager and read out the number of ROIs.
The number of ROIs are then added to the result table.

However I noticed that apparently Analyze Particles creates per ROI a measurement.
As far as I can tell I did not select any measurement options.

I used Fiji on Ubuntu 22.04.

Here is a macro that reproduces that issue:

`
run("Set Measurements...", " redirect=None decimal=3");

run("AuPbSn 40");

setAutoThreshold("Default dark no-reset");
//run("Threshold...");
//setThreshold(126, 255);
setOption("BlackBackground", true);
run("Convert to Mask");
run("Analyze Particles...", "show=Nothing add");

result = roiManager("count");

setResult("count", 0, result);
`

It then produces this result table:

1 41
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 0
11 0
12 0
13 0
14 0
15 0
16 0
17 0
18 0
19 0
20 0
21 0
22 0
23 0
24 0
25 0
26 0
27 0
28 0
29 0
30 0
31 0
32 0
33 0
34 0
35 0
36 0
37 0
38 0
39 0
40 0
41 0

It does not come from the ROI manager as when I just add ROIs manually to the ROI manager these measurements are not created. Selecting "clear results" in the particle analyzer does not fix the issue.

For me this behavior was surprising. Mind also that without writing the ROI manager count in the results table the 0 measurement per ROI is also not visible actually. As no results table is opened. Further indicating for me that this was unintentional and maybe erroneous measurements are created in the background.

There are other ways I can get the same workflow going. Maybe I overlook also a setting.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the provided macro and inspect the Analyze Particles... entry point, especially with the `show=Nothing add` options and no measurement selections. Confirm whether the generated result rows are expected or unintended, and document or test the behavior using the reported 41-ROI case. Done means the measurement behavior is explained and, if erroneous, no unexpected per-ROI rows are created.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.