Exclude fibers by size/thickness

Hi all,

Does anyone know of a way to exclude certain features in images based on their thickness please? In the image below you can see large tracts (often with small circles in indicating where the cell bodies are) with thin vertical fibers in the spaces in between. I would like to find a way to exclude the thin, vertical fibers (e.g. based on thickness) as they are currently confounding my analysis.

Ideally I would have another biological marker that did not express in the thin fibers that I could use as a mask, but Iā€™m not aware of one right now.

I have tried using the Local Thickness plugin to try to generate a map of thick fiber locations to then use that as a mask, which worked to some extent, but ended up excluding some other bits too.

Any help much appreciated
Thanks
Ryan

Hi Ryan,
Interesting image, I gave it a shot with classical approaches using binary eroding and dilation to remove the smaller part of the mask. The result is not perfect but that can help you get some ideas

Using thresholding

image_thresh
the corresponding recorded macro (rename it to have extension ijm, then drag and drop on Image/Fiji and click run)
If it does not work you can just click the corresponding menu in the order depicted in the macro
image_thresh.txt (192 Bytes)

Using first edge detection then thresholding

image_Edges
image_Edges.txt (154 Bytes)

For the top mask you might be able to remove the remaining bit using connected component and filtering the small segments.
Also using the original images the image quality might be better and the result too

1 Like

Hi Laurent,

Thanks very much for your reply! I had never used the erode function before, but I think this is a nice solution to assess how much of an effect the thin fibers were having on my downstream analysis.

Thanks again
Ryan

Hi
@rhamnett
Another possible way in addition:

run("Duplicate...", "title=1");
run("Duplicate...", "title=2");
run("Gaussian Blur...", "sigma=10");
setAutoThreshold("Default dark");
//run("Threshold...");
run("Create Selection");
selectWindow("1");
run("Restore Selection");
setBackgroundColor(0, 0, 0);
run("Clear Outside");
run("Select None");

Hi Mathew,

That works very nicely, thank you. I had tried blurring the small fibers out of existence, but did not think to then use that as a mask on the original image. This also allows analysis of the image without needing to threshold it, so intensity differences are preserved. Thanks!