BoneJ Analyse Particles File Size Limitation?

I am attempting to run the BoneJ particle analyser to measure the moments of inertia of binary filamentous structures segmented from 3D electron microscopy datasets and am getting the below error which occurs immediately after attempting to run the plugin. Does anyone know what this error means and possibly how to work around it?

My 8-bit dataset is 150 GB (6972x4970x4666 pixels) with over 3 million structures, so I could be pushing the size limits. However, I have 2 TB of RAM on my Windows 10 PC and have successfully run the particle analyser on files up to 90 GB with over 300,000 filaments. I do not get this error when I run the particle analyser on a 5.9 GB file on a different computer with only 64 GB RAM, so I don’t think it is a RAM limitation on my part (64/5.9 < 2000/150). Because the error pops up immediately after pressing run, I don’t think it is an issue of too many structures as they can’t be counted that quickly.

(Fiji Is Just) ImageJ 2.1.0/1.53c; Java 1.8.0_172 [64-bit]; Windows 10 10.0; 154325MB of 2000000MB (7%)
 
java.lang.IllegalArgumentException: Expected initial capacity is greater than or equal to 0. Was: -176544
	at org.eclipse.collections.impl.list.mutable.FastList.<init>(FastList.java:142)
	at org.eclipse.collections.impl.list.mutable.FastList.newList(FastList.java:178)
	at org.bonej.plugins.ConnectedComponents.run(ConnectedComponents.java:142)
	at org.bonej.plugins.ParticleCounter.getParticles(ParticleCounter.java:484)
	at org.bonej.plugins.ParticleCounter.run(ParticleCounter.java:229)
	at ij.IJ.runUserPlugIn(IJ.java:235)
	at ij.IJ.runPlugIn(IJ.java:198)
	at ij.Executer.runCommand(Executer.java:150)
	at ij.Executer.run(Executer.java:68)
	at java.lang.Thread.run(Thread.java:748)

Wow, OK, that’s a big image.

This bug was addressed in a commit and merged to master not long ago, and will be fixed in the next user release.

You may also be pushing the limits of the particle labelling strategy: see the discussion in the last paragraphs of the preprint. Briefly, ImageJ1 interprets int arrays as RGB images, so the hacky workaround is to use float instead for the particle labels. But float loses integer precision at 223 = 8,388,608 particles, which creates a limit far less than it could be.

If you run out of RAM you should just get the familiar OOM (out of memory) error or exception.

Please let us know how you get on - yours are the biggest images I have heard Particle Analyser being used on. Processing speed for the labelling should be in the region of 5-10s / GB, with quite a bit more needed for the analysis, depending on which options you use.

Thanks. It’s great to hear that a fix is already in the works. I’ll be on the lookout for the update when it becomes available.

I was able to perform a connected components labeling using the MophoLibJ plugin and float, so I’m assuming it will work for this dataset once BoneJ updates, but it’s good to know that there will be a potential limit at a little over 8 million structures.

The plugin is great and very fast compared to a lot of the other calculations I run on these large datasets. It is also the only plugin I know of that I can calculate moments of inertia for many individual structures which has been very useful for me.

1 Like

Check the updater - I managed to squeeze out styloid-r8 this evening.

I installed the update and particle analyser finished labeling in 1436 seconds just as you would predict. Thanks!

1 Like

@bglancy what are the other specifications of your machine, e.g. number of CPU threads & cores, clock frequency etc?

@mdoube I have 64 Intel Xeon Gold 6142M processors @2.60 GHz base speed. Windows 10 64-bit, Nvidia Quadro RTX 8000 GPU, and 2 TB RAM.

Unfortunately, while you fixed the initial problem, there seems to be another issue that I think may be related to the number of particles. Once the particle analyser finished running and displayed the particle stack, there were many completely blank frames (histogram was all zeros) mixed in with some frames with correctly labeled particles. The results table listed ~1.7 million particles, though there should be over 3 million and many were not as big as they should be (binary file was created through fiber tracing in Avizo, so I know how many fibers and what the size filter was).

I tried cropping the dataset down from 150 Gb to ~65 Gb and still get the same issue of blank frames and ~1.8 million particles that are mostly too small. Then I took a different ~70 Gb dataset that had previously run correctly in BoneJ, duplicated it and concatenated the two duplicates to create a ~140 Gb file. The 140 Gb file ran correctly, so it does not seem to be file size as a problem. The 140 Gb file had just under 800,000 particles whereas the original 150 Gb file has over 3 million and the cropped file still has over 1.8 million, so I am wondering if there is another limitation before the 8 million particle float limit you mentioned earlier. At the bottom is the error message I get in the console window.

Also, I can correctly run a connected components analysis on the 150 Gb dataset using the MorphoLibJ plugin, so if there is not an easy fix to the above problem, perhaps there is a way to input an already labeled file into BoneJ to do the desired particle analysis calculations (i.e. moments of inertia)?

Exception in thread "Thread-132" java.lang.ArrayIndexOutOfBoundsException: 2016
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:264)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-126" java.lang.IllegalArgumentException: ID 7602176 is greater than the allowed range (max 7602175)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-91" java.lang.IllegalArgumentException: ID 3014656 is greater than the allowed range (max 3014655)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-125" java.lang.IllegalArgumentException: ID 7471104 is greater than the allowed range (max 7471103)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-129" java.lang.IllegalArgumentException: ID 7995392 is greater than the allowed range (max 7995391)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-127" java.lang.IllegalArgumentException: ID 7733248 is greater than the allowed range (max 7733247)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-131" java.lang.IllegalArgumentException: ID 8257536 is greater than the allowed range (max 8257535)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-130" java.lang.IllegalArgumentException: ID 8126464 is greater than the allowed range (max 8126463)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-128" java.lang.IllegalArgumentException: ID 7864320 is greater than the allowed range (max 7864319)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-124" java.lang.IllegalArgumentException: ID 7340032 is greater than the allowed range (max 7340031)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-93" java.lang.IllegalArgumentException: ID 3276800 is greater than the allowed range (max 3276799)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-116" java.lang.IllegalArgumentException: ID 6291456 is greater than the allowed range (max 6291455)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-107" java.lang.IllegalArgumentException: ID 5111808 is greater than the allowed range (max 5111807)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-92" java.lang.IllegalArgumentException: ID 3145728 is greater than the allowed range (max 3145727)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-95" java.lang.IllegalArgumentException: ID 3538944 is greater than the allowed range (max 3538943)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-122" java.lang.IllegalArgumentException: ID 7077888 is greater than the allowed range (max 7077887)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-72" java.lang.IllegalArgumentException: ID 524288 is greater than the allowed range (max 524287)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-96" java.lang.IllegalArgumentException: ID 3670016 is greater than the allowed range (max 3670015)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-109" java.lang.IllegalArgumentException: ID 5373952 is greater than the allowed range (max 5373951)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-90" java.lang.IllegalArgumentException: ID 2883584 is greater than the allowed range (max 2883583)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-121" java.lang.IllegalArgumentException: ID 6946816 is greater than the allowed range (max 6946815)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-108" java.lang.IllegalArgumentException: ID 5242880 is greater than the allowed range (max 5242879)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-101" Exception in thread "Thread-106" java.lang.IllegalArgumentException: ID 4325376 is greater than the allowed range (max 4325375)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
java.lang.IllegalArgumentException: ID 4980736 is greater than the allowed range (max 4980735)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-102" java.lang.IllegalArgumentException: ID 4456448 is greater than the allowed range (max 4456447)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-113" java.lang.IllegalArgumentException: ID 5898240 is greater than the allowed range (max 5898239)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-104" java.lang.IllegalArgumentException: ID 4718592 is greater than the allowed range (max 4718591)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-97" java.lang.IllegalArgumentException: ID 3801088 is greater than the allowed range (max 3801087)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-85" java.lang.IllegalArgumentException: ID 2228224 is greater than the allowed range (max 2228223)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-123" java.lang.IllegalArgumentException: ID 7208960 is greater than the allowed range (max 7208959)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-117" java.lang.IllegalArgumentException: ID 6422528 is greater than the allowed range (max 6422527)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-118" java.lang.IllegalArgumentException: ID 6553600 is greater than the allowed range (max 6553599)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-86" java.lang.IllegalArgumentException: ID 2359296 is greater than the allowed range (max 2359295)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-80" java.lang.IllegalArgumentException: ID 1572864 is greater than the allowed range (max 1572863)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-77" java.lang.IllegalArgumentException: ID 1179648 is greater than the allowed range (max 1179647)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-89" java.lang.IllegalArgumentException: ID 2752512 is greater than the allowed range (max 2752511)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-83" java.lang.IllegalArgumentException: ID 1966080 is greater than the allowed range (max 1966079)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-115" java.lang.IllegalArgumentException: ID 6160384 is greater than the allowed range (max 6160383)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-99" java.lang.IllegalArgumentException: ID 4063232 is greater than the allowed range (max 4063231)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-82" java.lang.IllegalArgumentException: ID 1835008 is greater than the allowed range (max 1835007)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-119" Exception in thread "Thread-114" java.lang.IllegalArgumentException: ID 6684672 is greater than the allowed range (max 6684671)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
java.lang.IllegalArgumentException: ID 6029312 is greater than the allowed range (max 6029311)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-100" java.lang.IllegalArgumentException: ID 4194304 is greater than the allowed range (max 4194303)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-103" java.lang.IllegalArgumentException: ID 4587520 is greater than the allowed range (max 4587519)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-120" java.lang.IllegalArgumentException: ID 6815744 is greater than the allowed range (max 6815743)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-74" java.lang.IllegalArgumentException: ID 786432 is greater than the allowed range (max 786431)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-81" java.lang.IllegalArgumentException: ID 1703936 is greater than the allowed range (max 1703935)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-112" java.lang.IllegalArgumentException: ID 5767168 is greater than the allowed range (max 5767167)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-110" java.lang.IllegalArgumentException: ID 5505024 is greater than the allowed range (max 5505023)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-87" java.lang.IllegalArgumentException: ID 2490368 is greater than the allowed range (max 2490367)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-98" java.lang.IllegalArgumentException: ID 3932160 is greater than the allowed range (max 3932159)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-94" java.lang.IllegalArgumentException: ID 3407872 is greater than the allowed range (max 3407871)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-88" java.lang.IllegalArgumentException: ID 2621440 is greater than the allowed range (max 2621439)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-79" java.lang.IllegalArgumentException: ID 1441792 is greater than the allowed range (max 1441791)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-78" java.lang.IllegalArgumentException: ID 1310720 is greater than the allowed range (max 1310719)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-105" java.lang.IllegalArgumentException: ID 4849664 is greater than the allowed range (max 4849663)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-73" java.lang.IllegalArgumentException: ID 655360 is greater than the allowed range (max 655359)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-76" java.lang.IllegalArgumentException: ID 1048576 is greater than the allowed range (max 1048575)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-84" java.lang.IllegalArgumentException: ID 2097152 is greater than the allowed range (max 2097151)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-75" java.lang.IllegalArgumentException: ID 917504 is greater than the allowed range (max 917503)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-111" java.lang.IllegalArgumentException: ID 5636096 is greater than the allowed range (max 5636095)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-71" java.lang.IllegalArgumentException: ID 393216 is greater than the allowed range (max 393215)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-70" java.lang.IllegalArgumentException: ID 262144 is greater than the allowed range (max 262143)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-69" java.lang.IllegalArgumentException: ID 131072 is greater than the allowed range (max 131071)
	at org.bonej.plugins.ConnectedComponents.expandMap(ConnectedComponents.java:998)
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$1(ConnectedComponents.java:323)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-196" java.lang.ArrayIndexOutOfBoundsException: 2016
	at org.bonej.plugins.ConnectedComponents.lambda$firstIDAttribution$2(ConnectedComponents.java:425)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-259" java.lang.ArrayIndexOutOfBoundsException: 2000
	at org.bonej.plugins.ConnectedComponents.lambda$applyLUT$3(ConnectedComponents.java:655)
	at java.lang.Thread.run(Thread.java:748)

Thanks for the report. This does indeed relate to the number of particles and the float limit from before. In general there are very many more labels formed in the first pass than needed in the final image. So the limit can be expanded for the first pass and a warning shown if the number of particles may be too large to be displayed accurately in an IJ1-style 32-bit float image. It is much easier to fix this bug (less code) than to do anything else.

Please keep an eye on this issue:

1 Like

@bglancy if you are up for trying the fixed code, please copy the jar files from the following link into the corresponding .../jars/ and .../plugins/ directories in your ImageJ/Fiji installation, and remove the 5 older bonej jars that are already there, then restart your ImageJ/Fiji

It would be helpful to know if it fixes your bug.

@mdoube This works! I now have measurements on 3.7 million correctly sized particles. I should also note that the particle labeling itself was a bit slower than before (~23 seconds/Gb vs ~8 previously), but I will gladly take that tradeoff to get accurate labeling of all structures in my large datasets. Thanks for such a quick turnaround on fixing these issues.

1 Like

Good news. I made a release this afternoon HKT, so you can remove the SNAPSHOT jars and let the updater download the release version (7.0.9).

Right - that’s probably due to the large amount of particle label collision resolution that’s required for your long thin objects, whose first labelling was previously aborted early because the label space was exceeded (the job was shorter because not all the labelling was done). It would be interesting (for me, at least…) to know whether the speed in GB/s is about the same on smaller images because it’s likely that there’s an interaction between the shape of particles and the time taken to label them.