Unexpected result in BoneJ Purify


Hi All,

@LucindaE and I have been attempting to use BoneJ’s Purify command to remove all particles apart from the largest in some 2D images. This typically works well (using the Mapped labelling algorithm), but we have found an example where something unexpected happens:

male-strort-24wks-20dec2018-le__rec_sag_voi_1365-edge-test.tif (3.5 MB)

Apart from removing smaller particles in the example image above, it also removes part on the ends of the largest particle (what is maybe important or not is that the cuts happen at locations where the curve changes direction in a way?):

Purified.tif (3.5 MB)

Translating the Foreground structures (via cut-paste) gives the same result.

We went on to do further tests on a 3D image stack (the example image that started it all + a background slice before and after combined into a stack). This give the same result. Reslicing the image stack gives a different result, but it is also wrong: there are 3 foreground particles remaining after the Purify step, which may be another, unrelated issue?

The issues were reproduced on Windows 10 and Ubuntu 18.04 operating systems on two different machines.

Can anyone think of what might be happening?


PS using a different Purify algorithm results in either a java.util.concurrentModificationException (linear) or an image with several particles (multi-threaded)


BoneJ1 or BoneJ2? A few bugs were introduced during initial porting and I don’t remember if the fixes made it to master


It works as expected using BoneJ1 (see pic below). I suspect that there are some bugs in the BoneJ2 version.

Please try the test user instructions to have a go with the up-to-date particle analyser in BoneJ2, and file a bug report.


Confirming in BoneJ2 master and particle-analyser branches.

Edit: I logged and fixed this bug, and created a pull request for @alessandrofelder’s review.

1 Like