Re: tresholding

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: tresholding

Stoyan Pavlov
Dear Martin,
Please excuse me for delaying the answer so much! We started the semester
and I am quite engaged with student's lectures and practical labs.
I am answering within the imagej mail list, because I think this should
remain there - firstly, there are professionals there who may help you much
better than I can, secondly once/if a solution to your probe is found it
can be easily searched by other colleagues facing similar challenges.

Now to the point:
I am not experienced with java script, so if you need that kind of solution
I cannot offer it (In my algorithms I use ImageJ Macro language. I know it
is a bit limited but it gets the job done.)
I can offer you a workaround:
You may set a threshold via macro language either via auto a thresholding
algorithm (using setAutoThreshold command), or manually ( using
 setThreshold) I think you can call also the thresholding applet if you
really need it to be interactive but you need to look up the command
yourself .Then measure area fraction (set measurements to areafraction and
limit to threshold). In next step you can create selection from the chosen
threshold (run("Create selection...") )and  add it to the roiManager
(roiManager("add")) and set name (Roi.setName) and fill color
(Roi.setFillColor). Add a dialog to ask for next threshold and there you'll
have it :result table with the measured fractions and a set of color coded
rois. You can also add these to a non destructive overlay of the image or
save separately as a roiset. Of course there are a bit dialogues and if
else's to add to automate this but the principle solution is this. I would
probably start with a dialog asking for user input of the number of
thresholds and the colors coding each threshold. Then will come a loop to
generate each RoI based on each threshold and finally a dialog for saving
the image with the overlay and the roiset.
These tutorials are really helpful for learning the macro language for
automating tasks in imagej: (
If this is not what you were looking for, I am sorry but it is as much as I
can offer.
I am sorry but currently I just can't write a complete solution to offer
Best wishes and good luck

На 19.09.2017 г. 5:46 пр.об. "Braekevelt Martin" <
[hidden email]> написа:

Hi Stoyan,

I just had time to work on the thresholding but even with your clear inputs
I cannot find.

If it’s not too much trouble for ou I would like to send you an image as

The image is of a wire covered by rubber.

It is a grey scale image on a white background.

In the class threshold function there is only possibility to select red,
over/under on the histogram distribution of the pixels.

What I need I an interactive threshold to define the amount(%)of uncovered
area (white), an intermediate level of grey, and the black( darkest areas)
in the picture by a 3 colored overlay of the 3 different tresholded areas
as a false color image.

The area should always be the same so this can be a fixed selection in the
ROI manager.

In my previous software that was an easy flexible thing to work with, you
could select up to 7 different selections of pixel values, each with their
own color and immediate results in % present.

I am not very skilled in programming within ImageJ, so I am little stuck.

If you don’t have time for help me I understand, no problem.

Kindest regards, and thanks in advance

Braekevelt Martin

Global Metallographic Lab Process Owner(GLaM)

Oude Heerweg 5



Tel. +32 56 767114 <+32%2056%2076%2071%2014>

Mobile :+32475805738 <+32%20475%2080%2057%2038>

::DISCLAIMER:: This e-mail is confidential and intended for use by the
addressee only. If you are not the intended recipient, please notify us
immediately and delete this e-mail, as well as any attachment.

ImageJ mailing list: