Analysing thresholded filaments


Hi folks,
I aim to analyse thresholded images of cytoskeleton. Here is the issue i faced - When using analyse particles, it considers parts of the thresholded image not as a filament but as an entire region. Is there anyway to avoid this and measure just the thresholded region? I have attached a screenshot of what it does.

Here it measures the whole region as one but i just need the red lines to be measured. Is there anyway to do this?



Have you tried using the AnalyzeSkeleton plugin?


Yes i did try this, but doesnt help in my case as i still need to calculate the area of these filaments and this can only be done with the ‘Analyse Particles’ tool know? I also used another plugin to skeletonise my filaments - here is the outcome

Does your plugin calculate the area of the identified filaments?


Good day Praveen Krishnamoorthy,

as far as I can see your structures are one pixel “wide”. Because a pixel has no spatial extension (width or height), you won’t be able to determine an area. For area measurements you need images with higher spatial resolution.




Yep, that makes sense now. Thanks!


I was about to say the same as @Herbie. What you can get from AnalyzeSkeleton is the number of pixels/voxels per skeleton. Maybe that helps?


Yes that would be fine too. How do i get this information? Is this the ‘Brach length’ in the ‘Branch Information’ window? Also is there a way to see which are these branches in the output image file created by the plugin?


The easiest way would be to check the “Display labeled skeletons” option and then work with that label image for example using the MorphoLibJ label an analysis tools.


Of course @Herbie and @iarganda are right concerning the 1 pixel issue. But comming back to the “original” issue with analyze particles not taking into account when there are holes in the sturcture. When I stumbled upon this problem a while ago I found it quite irritating that Analyze Particles measures the correct thing (i.e. only the thesholded part - see example below) but puts the ROI including the hole into the ROI manager. I found a solution that worked for me - shown below. I used this image for testing:

with the macro below you´ll end up with two ROIs that are only the structures without the holes. The results table generated is interesting: the first two rows are from “Analyze Particles” and they are identical to the last two rows, which are from the measurement of the two ROIs. But not identical to the measurement of the ROIs that were added to the manager from Analyse Particles (Row 4 and 5) - these include the holes.

if (isOpen("Results")) {

if (isOpen("ROI Manager")) {
     selectWindow("ROI Manager");

setAutoThreshold("Default dark");
run("Create Selection");
roiManager("Add");// add everything that is thresholded to the first roi (ROI_0)

run("Analyze Particles...", "display add");

for (i=1; i<roi_number; i++) {
	roiManager("Select", newArray(0,i));//select the ROI with everything (ROI_0) plus one of the others 
	roiManager("AND");//keep what is common to both ROIs


//delete the first ROIs in the list that are no longer needed.
for (i=0; i<roi_number; i++) {
	roiManager("Select", 0);