CliJ thresholded image are not recognized as thresholded images by ImageJ

Playing with CliJ, I discovered that the automatic-thresholding functions in CliJ set the pixels above the threshold value to “1” (which is the natural thing to do), but when I then use the ImageJ “Analyze Particles” function on these thresholded images, it complains that “A thresholded image or 8-bit binary image is required”.

I could of course “AND” the CliJ thresholded image with an image filled with 255, but is there a more elegant way of getting these two to play nice together?

Would it make sense to add a parameter to the threshold functions what the thesholded value should be set to?

1 Like

Hey @nicost,

good point! CLIJ has only ImageJ2 support for that. You can call clij.pullBinaryRAI(buffer) to get a RandomAccessibleInterval<BitType>.
I think it would make sense to build in a clij.pullBinary(buffer) / CLIJ_pullBinary to get a binary ImagePlus back. I can make that happen immediately. The next hotfix release is approaching anyway.

Thanks for the suggestion!