Automatic output of threshold points along a line

Hi All,

Thanks in advance for any help.

I’m having trouble doing something that seems simple, but apparently isn’t.

Basically, I’d like to know how to automatically identify the positions along a line where a given threshold occurs.

Images I’m working with tend to look like this:

The points I’d like to identify occur along the yellow line.

I think there are several different approaches that could work, but am missing the key piece, which is how to get imageJ to output the coordinates of the threshold points along the line.

The images could be binarized/thresholded:

It may also be possible to get the crossing points from a profile plot along the line:

My goal is to write a macro that will automate the analysis and data output for sets of images. The rest of the macro seems pretty straightforward, but the missing piece is how to automatically identify the positions along the line where the threshold occurs.

Suggestions greatly appreciated…

1 Like

Good day,

when reading your post, it appears as if you have the solution already – no?

The only open question appears to be, at which gray value you like to see the threshold. If this value is known, a little ImageJ-macro will do the job.

Have a look at the macro language that is well documented with all its functions and constructs.



The BAR update site has a macro tool designed for that called Segment Profile. The original scope was to segment muscle sarcomeres but it was generalized to broader datasets. Find it under BAR> Tool Installers> or type !tools in Commander… It looks as if it already does what you are aiming at.

Nevertheless, if you need more specific functionality, you can always use it as a template to tweak with. The source is here (About BAR… command), or use the Reveal macro/tools/ command.

1 Like