Exception error occurring when trying to run 3D OC on CT images

fiji
imagej
3d-objects-counter

#1

Hello,

I keep getting the following error when trying to run 3D OC on my Micro-CT image stacks in Fiji. It only happens for a select few samples, the rest are running fine so I am unsure what is going wrong.

"(Fiji Is Just) ImageJ 2.0.0-rc-65/1.52a; Java 1.8.0_66 [64-bit]; Windows 7 6.1; 67MB of 15000MB (<1%)

java.lang.NegativeArraySizeException
   at Utilities.Counter3D.<init>(Counter3D.java:90)
   at _3D_objects_counter.run(_3D_objects_counter.java:192)
   at ij.IJ.runUserPlugIn(IJ.java:221)
   at ij.IJ.runPlugIn(IJ.java:185)
   at ij.Executer.runCommand(Executer.java:137)
   at ij.Executer.run(Executer.java:66)
   at java.lang.Thread.run(Thread.java:745)"

If anyone could help me figure out what’s going on I would be extremely grateful.

Regards,
R


#2

Is it possible that the exception only occurs on large stacks, where width*height*n_{slices} > 2147483647 ?

I fear the plugin was not written with these large datasets in mind. You’ll have to downsample or crop your images to work with them.

Alternatively, consider using the 3D ImageJ Suite by @ThomasBoudier (available from the 3D ImageJ Suite update site).


Technical background

In the plugin source code, this multiplication happens here:

which leads to an integer overflow and subsquently to a NegativeArraySizeException in this line: