Automating a scan for steel segregations in ImageJ

I have a set of images that I have already processed into a high contrast, black and white. I’m attempting to write a program that can auto scan the image for the dark inclusions on a white background. Once one is found I want to use the wand tool to create an outline of each inclusion and then calculate it’s size in pixels based off of the perimeter pixels.

I am at a total loss on how I would be able to tell ImageJ to parse through an image for these inclusions. I’m a total beginner to this language and software but I do have some basic programming experience.

Take a look at the following links and they will help you get started:

I use the Fiji Script editor along with the Macro recorder. It lets you run selected lines to see that everything works up to the line that fails. Then one learns how to interpret the results…

The Fiji/ImageJ community is helpful. If you run into problems be sure to upload a test image that you used and the macro code. To include code here put it between lines that start with three back-tics (under the tilde on many keyboards)

Best wishes as you start on this journey to make reproducible analyses with Fiji/ImageJ.