You’re welcome @Charles_hoo!
I chose 100 because after extending the particles with 10 there were no touching.
Yes. You just need to replace the first line containing
open(...); with the following. Btw. this line is recorded. I didn’t type it:
run("Image Sequence...", "open=[C:/Users/rober/Downloads/FIB-SEM images-20200906T073825Z-001/FIB-SEM images/pores_in _calcite_022.tif] sort");
Furthermore, many classical ImageJ Macro
run() calls can be extended so that they work slice-by-slice on a
The macro will then operate in 3D:
No problem, just output the resulting vector by the end to a table.
// rotate vector so that touch-count sits in lines, not in rows:
// show table
This is how the table looks then. The first entry is 0 because it corresponds to background:
Furthermore, as good scientific practice, I would measure the centroid position of the objects:
and add it to the table:
// put positions and neighbor count in one table/image
Ext.CLIJ2_getDimensions(coordinate_list, number_of_points, dimensionality, _);
Ext.CLIJ2_create2D(vertical_table, number_of_points, dimensionality + 1, 32);
Ext.CLIJ2_paste2D(coordinate_list, vertical_table, 0, 0);
Ext.CLIJ2_paste2D(touching_neighbors_count, vertical_table, 0, dimensionality);
You can download the whole script here.
In order to understand what it’s doing, I would recommend learning some Image Macro, a bit CLIJ2 and especially the
pull() command as it allows you to look at intermediate results. E.g. if you want to know what the
coordinate_list variable contains, you can pull it:
It will open a window and show an image with 3 lines, which correspond to X, Y and Z coordinates:
Let me know if you need any further hint!