Great Overlaid Rigid Rod Segmentation Challenge


I have recently posted on this Forum a few questions on the use of ImageJ/Fiji to obtain a correct rigid rod length distribution values in cases when some/many rod segments are touching (forming a T or V) or are overlaid (forming an X object.) I have been in touch, and very much helped, by several expert ImageJ users and contributors. However, having tried all the suggested processing methods, plugins and custom-written solutions, I believe that the problem remains fundamentally unresolved (BTW, there’s a recent paper (doi: 10.1088/0957-0233/26/12/125601) in which a very similar problem was studied, but this was done outside of the ImageJ system and the refinements are still in progress. Importantly, only the rod/fiber width was considered, but not their end-to-end length.

A bit out of desperation, and because of my conviction that this image segmentation and analysis problem may be of general interest and importance, I’ve decided to issue the Great Overlaid Rigid-Rod Segmentation and Analysis Challenge (GORRSAC :wink:) to find a reliable and general ImageJ processing pipeline that would recognize that the attached image includes only 7 lines and provide their individual length correctly. None of the solutions I’ve tried so far give (in my non-expert hands) a correct answer (7 lines.) I realize there’s quandary in trying to decide if the crossing point is an end of a segment or if the object continues across it. The general assumption should be that if two segments are on the opposite sides of the crossing and each lies on the line extrapolated from the other, they belong to the same object.

I’m looking forward to your comments, suggestions–and a solution to this challenge! Perhaps some of my correspondents would like to join a group effort as their ideas could contribute to a generally satisfactory solution?

Measuring line length using ridge detection

What do you think about Active Contour modeling ? (

A bunch of papers came out recently to apply this kind of algorithm to biological filaments such as actin network and microtubules (see the list below).

I have the idea of developing an IJ2 plugin to implement them but I didn’t find (yet) the time and energy to do that.

Are you aware of those algorithms ? Did you try them ?

  • SOAX: A software for quantification of 3D biopolymer networks
  • Segmentation and Tracking of Cytoskeletal Filaments Using Open Active Contours
  • 3D actin network centerline extraction with multiple active contours
  • Automatic optimal filament segmentation with sub-pixel accuracy using generalized linear models and B-spline level-sets


No, I have not tried these more complex approaches favored by biologists as they deal with curved objects and they seldom focus on the determination of the exact fiber length distribution values; we don’t care about the width (we know its value a priori), but we worry about fibers crossing, touching, sticking together.

Frankly, my interest in image recognition and processing is very utilitarian and results-oriented, a procedure I can develop and pass on to our technicians to use reliably. It is also limited to a specific materials system which always contains chopped or milled rigid and brittle fibers. Snake-like, oval, round, irregular and floppy objects are of no interest to me, and this is also probably true of anybody working on the analysis of fiber-reinforced polymer composites (

I also feel that any object recognition, segmentation and classification program or plugin that cannot resolve these seven lines correctly is failing a qualifying test; it seems to me that a proposed algorithm should first demonstrate that it is capable of correctly detecting the lines, then other, progressively more difficult shapes, such as ovals, circles, squares, rectangles–and only then moving to the characterization of more irregular shapes. As a nonspecialist in this field, I’m surprised that this problem seems to be unresolved in imageJ, esp. by image recognition and computer vision specialists.


@hadim I downloaded and tried to use SOAX with real-life images I work with. A quick trial revealed two flaws: the automated image preprocessing results in inferior-quality images, and the program is unbearably slow… Perhaps the authors would benefit from developing it as an ImageJ plugin as they could take advantage of the many preprocessing functions…


That is some of the reasons why I want to implement this method as an ImageJ2 plugin.


What do you think of the method described in the paper I cited? doi: 10.1088/0957-0233/26/12/125601


This macro worked for me:

setOption("BlackBackground", true);
run("Make Binary");
run("Ridge Detection", "line_width=3.5 high_contrast=230 low_contrast=87 extend_line show_junction_points show_ids displayresults make_binary method_for_overlap_resolution=SLOPE sigma=2 lower_threshold=3.06 upper_threshold=7.99");

You need to install the Ridge Detection plugin to run it.


@iarganda Ignacio, you are a true wizard, but I feel almost depressed and full of self-doubt… I have spent trying the Ridge Detection plugin for the last 3 weeks and never found the proper sequence and parameter settings you came up with in a moment. I’m lucky not to have betted my home garden as a prize for the solution of my Great Challenge. :wink:

Do you have any suggestions on how to go about finding the right combination of the 6+X RD parameters to identify such linear objects, including in real-life images of less than ideal quality? I found that the results of the analysis dramatically depend on the value of the sigma parameter, which makes me uncomfortable,because the object rejection criterion becomes arbitrary.


The approach is interesting. Especially the Gaussian fitlering in the Frequency space. However there is still a threshold method at the end of the filtering and I wonder if it generalizes well on different type of dataset.

I except the implementation to be easy with a script using imagej-ops. So I guess it’s worth trying to implement that


I am also curious to see how the frequency filter can deal with non rode objects (such as dust and garbage spots on a microscope coverslip).


Dear Tony Gozdz,

here is the result of an approach that I shall sketch below.

A. The image is segmented into ROIs by "Analyze Particles…"
B. The segmented ROIs are further analyzed separately
For every ROI:

  1. The coordinates of the “Ultimate Point” are determined
  2. The orientation angles of the rods are determined
  3. Lines having these orientations are constructed that pass through the “Ultimate Point”.
  4. These lines segment (cut out) the rods
  5. The lengths of the thus segmented rods are determined


  • No parameter tweaking involved or necessary.
  • The rods are assumed being straight (no curvature).
  • If more han two rods overlap, the problem becomes more involved.
  • The implementation is as an ImageJ-macro of about 200 lines. A speciall ImageJ-plugin for the orientation analysis is required.



How to realize the continuous measurement of ImageJ?

I may suggest consider a combination of oriented filters and 3D processing:

  • choose a set of orientations within 0 and 180 degrees (say 32)
  • for each orientation, apply a filter that enhances fibres oriented in this direction. I would use morphological opening or closing with linear structuring element, but other filter would be possible.
  • concatenate the results in a 3D stack, each slice corresponding to an orientation.
  • choose a threshold, and identify 3D connected components or blobs in the 3D image. The average z value of a component should correspond to the orientation, and the projection on XY plane should result in the individual fibre shape.

Processing of curved structures should be possible, by choosing adequate fitlering parameters.

The idea comes from the following article:
K. Sandau and J. Ohser (2007). The chord length transform and the segmentation of crossing fibres. Journal of Microscopy, Vol. 226, Pt 1, pp. 43–53

An example of (3D) result on the original image:

(note that the horizontal fibre appears twice because of cyclic behaviour of angles)


Hello dlegland,

Orientation-filtering isn’t easy and generally requires, as you write, post-processing. In fact, I’ve thought about orientation filtering first but found my slightly related approach more robust. (As far as I understand Tony Gozdz, length analysis of curved rods is not required.)

BTW, chord transformation dates back to at least 1972 (Moore 1972 ). However, Sandau & Ohser (2007) don’t refer to the work done in the 1970s and 1980s.




Hello George,

well, I have’n said this was the best approach, but just a possibility to try!

Anyway thank for the reference, I did not know about it.


This is also a work-in-progress in CellProfiler- you can see the PR for the IdentifyLinearObjects module here . I quickly put together a segmentation for your rods- with >5 minutes of tweaking you could probably improve it even more. Second image has measured lengths and widths.


Just wanted to thank everybody participating in this thread for your interest, time and valuable suggestions; for the moment, I’ll stay at the sidelines as I can’t really contribute any technical insights, just judge the practicality and accuracy of the proposed method from a point of view of an non-expert user. I’d like to add that I have recently tried CellProfiler as well–and even contacted one of the co-authors, but I was informed that the program has not been designed and fine-tuned to resolve and measure such linear and low-L/d objects. So, I’m impressed with @bethac07’s example! However, can I realistically expect the program to deal efficiently with 500-2000 objects, such as the example mentioned below?

If I may make one suggestion to those posters who solved the simplistic examples with 7 lines at the top of this thread, is to try to apply the proposed methodology to a real-life situation perfectly reflected in the top posting (greenish-background image) posted at; this is what I and others in the composite materials field have to deal with.

Thanks again for your ideas–I’ll keep following your interesting discussion!


Dear Tony Gozdz,

that’s a bit unfair, because the real-world image contains joints or crossings of more than two rods. Hence the test example was not representative. Furthermore, you’ve stated earlier that the width of the rods is constant which is not the case in the real-world image. Last but not least, the real-world image is badly resolved spatially.

In short I’m out. No fun!



Hi @George, sorry that life is unfair! :wink: Anyway, multiple-crossing groups are rare and possibly could be minimized by diluting the suspension, so it’s not a deal breaker. On your second point, the width is constant to within 0.1 um; it’s the images that are not perfect. In real life, there are always some tolerances. Finally, there are good, so-so and bad images. Here’s a better one (are you still game?)

Measuring line length using ridge detection

Dear Tony Gozdz,

the spatial resolution of the real sample image is bad compared to that of the test image.

I’ve started with a 400x400 excerpt taken from the top left.
Here are the results:

281 ROIs were considered.

Analysis within ROIs was limited to two rods.

Total ImageJ-macro processing time was about 11.5 seconds on the fastest current iMac.




@george, thanks! What do you mean by stating that the “Analysis within ROIs was limited to two rods?” It’s hard to tell from the attached images, but does your procedure resolve touching and crossing objects as individual full-length fiber fragments? I can’t tell…

Re the poor resolution, this is a real-life image; the first example was a synthetic image drawn by me…