CLIJx skeletonize wrong skeleton

Hi,
The skeletonize function in CLIJX seem wrong on a 3D stack? No problem on 2D image.
original mask :


CLIJ skeletonize :

Skeletonize Fiji:

Philippe

1 Like

Hey Phillipe @pmailly ,

would you mind sharing that data set? It makes it easier for me to trace down that bug.

Thanks,
Robert

Sorry for the delay. Here a link to download image (to big to send in the forum).


Philippe

@ haesleinhuepf I wanted to confirm this problem, the skeletonization in 3D is not working.

Result form the ImageJ Menu ( Plugins › ImageJ on GPU (CLIJx) › Binary › Skeletonize on GPU (experimental)) is wrong and different form the Plugins › Skeleton › Skeletonize (2D/3D).

Binary dataset:
filament_example_mask.tif (483.1 KB)

Skeleton › Skeletonize (2D/3D) Result:
filament_example_mask_3d_skeletonization_result.tif (483.1 KB)

CLIJx Result:
filament_example_mask_clijx_skeletonization_result.tif (479.4 KB)

An extra question, I didn’t succeed to run it from a macro, probably my fault but I am not sure why, here is my code:

// Init GPU
run("CLIJ2 Macro Extensions", "cl_device=NVS 5200M");
Ext.CLIJ2_clear();

input = getTitle();
imgIn = Ext.CLIJ2_push(input);

Stack.getDimensions(width, height, channels, slices, frames);
print("width:"+width);
print("height:"+height);
print("slices:"+slices);
print("bitdepth:"+bitDepth());
Ext.CLIJ2_create3D(imgOut, width, height, slices,bitDepth());
print(imgOut)
Ext.CLIJx_skeletonize(imgIn,imgOut);
Ext.CLIJ2_pull(imgOut);

Benjamin

1 Like

Hey Benjamin @bpavie,

the macro issue is solvable. Hint: Push doesn’t return anything in macro. It just ensures that the specified image exist in the GPU afterwards. Furthermore, create is not necessary in macro, because internals figure out necessary target image size.

// Init GPU
run("CLIJ2 Macro Extensions", "cl_device=");
Ext.CLIJ2_clear();

input = getTitle();
Ext.CLIJ2_push(input);

Stack.getDimensions(width, height, channels, slices, frames);
print("width:"+width);
print("height:"+height);
print("slices:"+slices);
print("bitdepth:"+bitDepth());
Ext.CLIJx_skeletonize(input,imgOut);
Ext.CLIJ2_pull(imgOut);

Regarding the skeletonization: Fixing this bug is a bit more involved. I just checked the code and can recall now what’s going wrong. Some background: I started translating this code @iarganda wrote in Java to OpenCL. While doing so, it turned out that OpenCL does not support recursive function calls, and this function is recursive. That’s why this if block is missing here.
Unentangling this was a little bit beyond my capabilities. But maybe a third pair of eyes see the solution immediately? :wink:

Let me know if I can help any further.

Cheers,
Robert

1 Like