Wall thickness of bronze statuette with core remnants

Hi, I would like to measure the wall thickness of a bronze statuette in 3D based on a neutron tomography (NT) scan. The process is simple if there is no core remnants in the sculpture. However, as the uploaded NT slice image shows, if the remnants are touching the inner surface it is difficult. By naked eye you see where is the wall and where is the other material but I could not find methods in FIJI which is capable to segment the wall and the rest of the materials.
Any help is very well appreciated!

here is a slice:
horse_wall_th_1398.tif (449.5 KB)

Thanks, Zoli

Hi
@Zoltan_Kis
I worked on the main object of the image
A few comments:

  • my macro requires plugins
    a) MorpholibJ
    b) RGB to CMYK

The binary image underwent an “erode” then a “dilate” (I don’t know if its dimensions are altered ?)

Is this what you are looking for?

Hi Mathew,

Many thanks, oh yes, your work is almost perfect! It is what I am looking for. If I am doing an extra dilation with the built-in method of FIJI then the dimension seems to be good enough

.

I would like to try your method on the slices of my tomo scan. Does it operate in real 3D? Or is it working slice by slice?

Best regards, Zoli

@Zoltan_Kis
This is a macro for (1) the image you have uploaded.
The macro doesn’t always seem to work well. (I don’t know why)

requires("1.52t");
setBackgroundColor(0,0,0);
setOption("BlackBackground",true);
img=getImageID();


run("Duplicate...", "title=1");
run("Invert");
morpholib();
//setBatchMode(true);
run("RGB Color");
run("RGB to CMYK");
selectWindow("CMYK_1-catchment-basins");
run("Stack to Images");
selectWindow("C");
setAutoThreshold("Default dark");
run("Threshold...");
//setOption("BlackBackground", true);
run("Convert to Mask");
run("Erode");
run("Analyze Particles...", "size=0-20000 display clear add");
n=roiManager("count");
a=Array.getSequence(n);
roiManager("select", a)
roiManager("Combine");
wait(1000);
roiManager("Add");
roiManager("Delete");
wait(1000);
roiManager("Select", 0);
run("Cut");
roiManager("Show None");
run("Select None");
run("Dilate");
setBatchMode(false);

selectWindow("C");
close("\\Others");
closeAll();
exit("It's over");




function morpholib()
{
run("Morphological Segmentation");
selectWindow("Morphological Segmentation");
//setTool("point");
wait(2000);
call("inra.ijpb.plugins.MorphologicalSegmentation.setInputImageType", "object");
call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientRadius", "1");
call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientType", "Morphological");
wait(1000);
call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Catchment basins");
call("inra.ijpb.plugins.MorphologicalSegmentation.segment", "tolerance=8.0", "calculateDams=true", "connectivity=4");
wait(12000);
call("inra.ijpb.plugins.MorphologicalSegmentation.createResultImage");
wait(1000);
selectWindow("Morphological Segmentation");
close();
print("\\Clear");
}

function closeAll () {
if (isOpen("Results")) { selectWindow("Results"); run("Close" ); } 
if (isOpen("Log")) { selectWindow("Log"); run("Close" ); }  
if (isOpen("Threshold")) { selectWindow("Threshold"); run("Close" ); }  
if (isOpen("ROI Manager")) { selectWindow("ROI Manager"); run("Close"); }
}

Please report to me.

Dear Mathew,
Thanks for the macro, I will try and test it. And I will report about the outcome. It will take time because I am not an expert of using macros in FIJI but now I am happy to be forced to learn it a bit.

Zoli

Dear Mathew,
I was trying to test the macro extensively. It turned out your basic idea is quite smart, however, my slices from the tomography scan are too different. What does it mean: I could not find a parameter set which is suitable for all the slices (altogether I have thousands), sometimes objects disappeared or sometimes not cut out in the slices. Later, I tried to use the watershed lines (not the catchment basin) from the Morphological Segmentation. They were eroded, analyzed and the ROIs were combined. At last, the ROI area was cut out from the original slice, and the remainders were opened. A macro is copied here (consider it as my first attempt based on yours):

wall_th_ws2.txt (1.5 KB)

I realized that the key factor is into how small parts can we breakdown the area we would like to get rid of, in parallel to keep the area in a whole what we need. Unfortunately, this macro is not perfect at all. I just want to report you where I am now. I try to improve the algorithms.

If you would like to deal with such images I upload some:
horse_wall_th_0900.tif (190.2 KB) horse_wall_th_1368.tif (391.6 KB) horse_wall_th_1674.tif (294.1 KB)

Thanks again for your help! Zoltan

1 Like

Hi Zoltan
@Zoltan_Kis

I “played” with your images with another macro.
The results are not satisfactory.
Especially for one of the images.
Maybe the solution is on your side? Play with your device on problematic section ?
Greetings

run("Duplicate...", "title=1");
run("Duplicate...", "title=2");

run("Add...", "value=25");
run("Invert");

run("Subtract Background...", "rolling=30");
wait(200);
run("Gaussian Blur...", "sigma=10");

setAutoThreshold("IsoData dark");
//run("Threshold...");
//setThreshold(30, 255);
setOption("BlackBackground", true);
run("Convert to Mask");
run("Analyze Particles...", "display clear add");
n=roiManager("Count");
a=Array.getSequence(n);
roiManager("Select",a);
roiManager("Combine");
roiManager("Add");
roiManager("Delete");

selectWindow("1");
roiManager("Show All without labels");
roiManager("Select", 0);
setBackgroundColor(0, 0, 0);
run("Clear", "slice");

run("Select None");
roiManager("Show None");

setAutoThreshold("Default dark");
//run("Threshold...");
//setThreshold(84, 255);
run("Convert to Mask");