ImageJ Tutorial Area and Threshold
Oct 15, 2023
Tutorial video for using ImageJ software to determine area fraction by two different methods. Area fraction can then be used in conjunction with the phase diagram lever rule to predict composition of a Bi-Sn alloy microstructure. You can use the software to also determine proeutectic phase and to quantify the eutectic microstructure. Thanks to TA Christian Robert for making this video tutorial.
*Note, everywhere in the video where he says "proeutectoid" he means to say "proeutectic" because Bi-Sn has no eutectoid reaction but it does have a eutectic reaction
Hey guys, this is Christian. I just want to give you guys a quick tutorial on how to use ImageJ.
So I posted this link here, and apparently it doesn't work.
But if you scroll down to DrSparks' comment, he has a link that does work. I just tried it.
And so if you go there, there's an option to download ImageJ.
And it should download a zip file, and you'll have to extract it and install.
It should be pretty quick. It's a really small file, so that shouldn't take you too long.
And then once you finally get it downloaded and you open it up, you get this little ImageJ bar.
And so I'm going to show you a quick few tools to use that.
So what you need to do for ImageJ is upload or open an image.
And so my suggestion is just to go to the homework, and then take a screenshot of that particular problem,
this microscopy image here.
And so we can just grab that.
Make sure you don't get any of the outside white, because that'll skew some of your measurements.
So take it a little bit from the inside.
So you'll grab that, and then you'll open that up in there.
Now I'm going to open a different image so that I'm not doing your homework for you.
It'll look really similar to this homework problem.
It's just a different composition of the same stuff.
So if we go to Open in ImageJ, top.
And I'm going to want, I believe it is this one.
Nope, that's the same one. So we'll close that.
There we go. This one's a little bit different.
Okay, so I'll show you two easy tools on how to make measurements in ImageJ.
And ImageJ is actually a really versatile tool for image processing and making kind of simple measurements.
Like you can measure how many pixels of this entire image are gray and white.
And that's one of the things that we'll do today.
So first I'm going to show you how to make area measurements from a selection.
So if you use this tool right here, the freehand selection tool,
you can actually draw lines around these big globs.
And you'll want to do that.
That's one of the ways that you can make a calculation for problem one of this week's homework.
And so what you'll do is you'll drag kind of around these big blobs.
You'll do a better job than me.
These are called pro-eutectoids.
And we'll talk about those in class and what they look like on a phase diagram.
And so what you'll want to do is just draw this freehand selection around it.
I'm going to go a little bit quicker so I don't waste your time.
And if you want to draw around other ones, which you will,
you need to hold shift or else it'll deselect your last one.
And so you just keep doing this.
I'll draw a few more, and then I'll show you how to make the measurement.
When you do it, you'll want to make circles around all of these pro-eutectoid regions.
These are the dark gray sections, and those actually correspond to tin.
And the white corresponds to bismuth.
So once you have all these circled, what you can do to measure the area of these
compared to the whole thing, you can go to this Analyze tool and click Measure.
And what that does is it gives you this results box,
and it tells you that the area of what you have selected is 80,229 pixels.
And so if you had all of them selected,
it would tell you exactly how many pixels of this image are pro-eutectoid.
Sorry, pro-eutectic.
Excuse me.
You'll learn the difference between those.
And so what you can do to find the fraction is you can take this number here, the 80,229,
and divide it by the total number of pixels.
And you can figure that out by just multiplying these two numbers up here on the left by each other.
And that will give you the total number of pixels in the entire area.
So that's one way that you could make this calculation using the lever rule.
And I'll show you another one.
It's a little bit more versatile, I think.
I'm going to make solutions for both methods.
So you want to deselect everything.
You can do that just by clicking anywhere.
And if you go to this image, first you'll need to change it to 8-bit.
That just makes it black and white.
It already was black and white, but since you took a screenshot, it thinks that there's colors in it.
So after you change the type, you can go to Adjust and then Threshold.
And now what we're going to do is you get this little threshold box.
And you can see that it selected almost everything that was white.
And what we're going to do is adjust these little bars here to change these thresholds to select all that we want to select.
And so we want to select everything that's white because that corresponds to bismuth,
and that will help you figure out your composition.
And now you notice that as you change it, sometimes it kind of washes out all of the dark gray stuff.
So you just need to kind of adjust it.
You can see all these little white specks in here.
You'd like to select all of those, but just because of contrast,
you won't be able to select all of them without washing out some of it.
So just find a happy medium.
I think somewhere around here probably looks pretty good
because if you go further, it starts to select some of your gray.
So maybe around here.
And now what that does, it tells you that if you see this number here,
60.73% of your total pixels are white, and then the rest are gray.
And so you can use that.
That corresponds to an area fraction, so the total area of this image.
You can assume that that's the same as the volume fraction,
and then you'll need to use the densities to figure out the mass fraction.
So that's a pretty big hint on how to do problem one.
And if you have any questions on how to use ImageJ, ask one of the TAs,
and they should be able to help you out.

