Clij - fillholes - 3D

Hi @haesleinhuepf,

I was trying to use clij Fill Holes on a 3D stack but I din’t get what I was expecting …

Images below, are :
from fiji

from clij**

Thank you for your help,



1 Like

Hi @romainGuiet,

afaik, Fiji has no “Fill Holes” operation 3D, you’re applying it in 2D slice by slice. CLIJ does it in 3D and the object is obviously not closed on one side and that’s why it doesn’t fill it. You could still do it slice by slice. You find a related discussion with an example script how to do this here in the forum:

Let me know if this helps!


1 Like

Thanks @haesleinhuepf for your answer !

CLIJ does it in 3D and the object is obviously not closed on one side

That was one of my guess :relieved:

Let me know if this helps!

It would defintely help!

I saw in the list of operations that by default they are operating on the whole stack and some are with an indication “slice by slice”.
Would it be possible to add a “Fill Holes slice by slice” ? (Asking for a friend :grimacing:)

BTW, did you recognize the image ?



1 Like

I was actually on the way of removing all those slice-by-slice special cases, because they actually violate a core-concept in CLIJ. In order to make in generally applicable, we would also need column-by-column, row-by-row, frame-by-frame and channel-by-channel variants of basically all operations. Not sure yet how to make this happen in a way that it works the same for all AND is user friendly. Just imagine you want to call a function binaryFillHolesSliceBySliceTimepointByTimepoint, but only on the first channel! :wink:

But you’re right, binaryFillHolesSliceBySlice would indeed be very practical and thus, I just added it to clijx. After updating Fiji, you can try it out with this litte snippet:

// get example data
newImage("Untitled", "32-bit black", 100, 100, 10);

makeRectangle(12, 19, 71, 65);
run("Add...", "value=1 stack");
makeRectangle(20, 35, 51, 41);
run("Add...", "value=-1 stack");

// init GPU
run("CLIJ2 Macro Extensions", "cl_device=[Intel(R) UHD Graphics 620]");

// binary fill holes slice by slice
image1 = getTitle();
Ext.CLIJx_binaryFillHolesSliceBySlice(image1, image2);

Let me know if it works on “your” data! :wink:
(Now that you said it, I recognize it)

Thanks again for the feedback. You made CLIJ(x) better today!


1 Like