Help segmenting and quantifying images



I aim to measure the length of continuous fluorescent structures from microscopic images in different conditions. I have attached two representative examples. In the first example, the structures are short and relatively straight. In the second, the structures are long and elaborately curved, often spiral-shaped. I have been manually measuring them by drawing an ROI for each structure and then measuring the length (end-to-end distance along the long axis) of the ROI, but I have literally thousands of these structures to measure in several different conditions. Thus, in the interests of both time and objectivity, I was hoping to automate the process. Does anyone have any ideas? (1.4 MB)


Good day,

so you’ve finally decided to change the kind of analyses when compared to your earlier Forum post.

From my point of view the greatest problem is to find a reproducible approach that is scientifically acceptable. What you’ve drawn in your first sample image is doubtable from a scientific point of view and the same holds for various results that strongly depend on how you process your images.

What you need is a very strict processing concept that is applicable to all of your images without any adaptation of parameters. Every manually set or adapted methods are scientifically inacceptable. Furthermore, you need to justify the chosen method, i.e. you need to tell why you’ve chosen a certain approach and not another one. This is really difficult and requires a lot of thinking about the underlying physiological processes.

Here are results obtained with the same parameter setting:

To get the lengths use “Analyze Particles” with “Display results” and checked “Area” in “Set Measurements”.

Of course the parameters can be optimized but in any case they must be scientifically justified and that’s a problem that must be solved by you because we are unaware of the underlying physiology.




Hi, this is a feasible aided method. though it may not do all things automatically.

  1. do a dog filter

  2. find ridge

  3. got the ridge and build the network

  4. some tool to cut or repair network

  5. do a network statistic


Sorry Sir,

but my above approach is fully automatic and gives the lengths.
It works for both sample images without parameter tweaking.
Lengths statistics is no problem with ImageJ.
If desired, lengths screening can be done by “Analyze Particles”.

The main problem is a totally different one and I’ve tried to explain it in detail!

What is better with your approach?




measure is simple, but how to find the mid_axis line automatic is hard.
in my opinion, do some filter like(tv/usm/dog), then do a ridge detect, or some method like canny 's no-max depress. But I do not think these method can got a ideal result. So can not fully automatic.
may be you need train a u-net or some other model to segment.


So can not fully automatic.

As I’ve written: My approach is fully automatic (using a very short ImageJ-macro)!

BTW, you didn’t answer my question: What is better with your approach?




Hello anivarj,

Have you realized yet that you are not looking at waves?



@smith_robertj, I don’t really know what to reply to this, as your comment is pretty vague. We are in fact looking at waves, I have just only given you a still-frame of a movie. In the end, it doesn’t matter what they are called, they just need to be segmented and measured.

@Herbie, you do not describe your approach at all, so unless you are willing to share how you got results, I don’t find that helpful.

@yxdragon, thank you for providing a description of your process. Although not fully automatic, it at least gives me something to build from, and will save me time compared to what I am currently doing!


@Herbie, you do not describe your approach at all, so unless you are willing to share how you got results, I don’t find that helpful.

Thanks for your kind words.
Perhaps you first tell me if the results suit your needs or not.




Hello anivarj,
I’m sorry it has taken so long to respond. The image(s) you are looking at are blobs, much like bubbles in boiling water. I used your tif stack at looked at the image in 3D where you can clearly see them. The only reason they look like waves is because of the strobe effect caused by the speed you are watching the images, which is not the speed they were aqired at. This effect can also be seen in a automobile commercial when it seems as though the wheels are running backwards to the line of travel. I would look into segmenting blobs in 3D and get some measurements of the whole stack.
There are many approaches to determine what you have so keep plugging and I will get back as soon as possible, but I’m old. I will help as I can.


Although I don’t agree that my confirmation is necessary for your transparency, I would say your results are a good start. I’m assuming there are certain parameters that can be tweaked to make the segmentations more accurate, however it is difficult without knowing what was done.


I would say your results are a good start.


I’m assuming there are certain parameters that can be tweaked to make the segmentations more accurate

I don’ think that there is much to tweak with the following ImageJ-macro that works for both of your provided sample images:

// imagej-macro "skel" (Herbie G., 05. Jan. 2019)
requires( "1.52j" );
run("Set Measurements...", "area redirect=None decimal=2");
setOption("BlackBackground", true);
run("Duplicate...", "title="+nme[0]+"-skel");
run("Bandpass Filter...", "filter_large=30 filter_small=20 suppress=None tolerance=0");
setAutoThreshold("MinError dark");
run("Convert to Mask");
run("Analyze Particles...", "display clear");
// imagej-macro "skel" (Herbie G., 05. Jan. 2019)

Paste the above macro code to an empty macro window (Plugins >> New >> Macro) and run it with an image open in ImageJ.

@anivarj, please report if it works for you!

Three parameters can be optimized:

  1. filter_large
  2. filter_small
  3. autoThreshold scheme

However and given the above code, I don’t think you will get much better results than those shown in my earlier post.

Good luck