Ridge Detection

I am trying to apply ridge detection plugin on an image to get the length of random fibers, problem i am facing is that even i set the scale or dosent set the scale the length values remains the same. It there any mistake i am doing ?
Would be nice to find some solution to it.

Hello @faruuk,

Can you please post here a sample image so we can reproduce the behavior?

1 Like


In lieu of having a dataset from you to run… I tried with the built-in Blobs image sample… and I got the same output you were describing. Even after using Set Scale to rescale the image - the calculations from Ridge Detection were all in pixels. Perhaps @twagner can provide some insight on this??

It might be that you just have to do some post-processing to scale your datasets after calculation…


1 Like

Hi mate,
Kindly find attached image. I have set the scale in it. You can ofcourse remove the scale and test it .The original scale is 1pixel is equal to 15micrometer.


Hi, thanks for taking a look at my post. Kindly find attached image, i had to save it as jpeg since tiff was not uploading. The scale for this image = 1pixel = 15μm
In response to you idea that some post processing might be required, since the values with and without scale are same , so post processing will result in same values for both of them…thats what i perceives .

kind regards


Dear @faruuk and @etadobson,

By looking at the code it seems the calibration in the released version of the plugin is not taken into account. @twagner already took care of it, but he has not released the fix yet.


Thanks mate, Now i am wodering if there is any other way of measuring the lengths of my fibers?

Dear @faruuk,

sorry for the late reply, I was on vacation. I’ve released a new version of the ridge detection plugin (please updadte via update site).



I am using the ridge detection plugin to quantify actin filament branching (phalloidin stain) in HeLa cells. Can someone please explain to me how to interpret the “junctions” data output summary? I do not understand what the numbers in the X and Y column represent. I would like to use this plugin to count the number of total junctions in the cell at bare minimum and ideally, I would like to use this plugin to count the number of branches per actin filament.

@ECMicrobe, I’ve been dealing with slightly similar issues for almost two years, still without satisfactory solution as the Extend Lines option is not working in my hands as described in the Ridge Detection manual.

Your system is different than mine (many thousands of mostly straight, but often touching and crossing fiber fragments per image.) The only suggestion I could offer is to save a very small section of your image at the original resolution (set the Scale globally first), perhaps with 5-20 objects only illustrating an iffy situation (I often use a freehand tool (kidney shape icon), draw a closed line around my selection, then Edit–>Clear outside), and then observe the effect of the various parameter settings live on the image with green object outlines turned on, and then on the Results and the length distribution histogram (it’s a number-average, by the way, not weight- or volume-average; the difference is very important!) Just look up ‘polydispersity’ in polymer literature.

Typically, I convert my fiber images to an 8-bit image, perform a Background subtraction (modify the radius to get best results), Enhance Contrast, convert to Binary and then use the Ridge Detection plugin on the binary image. Once you adjust the parameters to minimize the number of Junctions and, at the same time, the number of missed objects (those without the green outlines), click OK if you like the segmentation results, rename the Summary table to Results (important!), go to the new Results table, Results–>Distribution, select Length and plot the Distribution after setting the number of bins and bin range. The Results table can also be saved in the CSV format for further processing of the weight- or volume averages, distribution fitting, etc.

If you display the ROI table, click More–>Sort to locate individual objects easily, select your object number on the image, highlight your segment number in the ROI table, go to Properties and select Size 2 or other to see your segmented object on the image.

I really wish there were a group of several interested users of Ridge Detection to figure out how to force the Extend Line to really extrapolate each line across the crossing or touching points, instead of making totally unexpected turns in a B&W image which result in wrong fragment lengths and an underestimated (sometimes overestimated) average fragment length… Several posters suggested interesting possible solutions (I like the FFT the most), but these solutions are a bit more involved and more geared to be used by image processing experts than me, a more casual user.

1 Like