This was the process used to generate the masks and the regions of interest (ROIs) from the SEM images using ImageJ.
Add all the holes as ROIs
File > Openthe desired image.Analyze > Tools > ROI Manager...to open the ROI manager tool.- Using the ellipse (or other) selection tool from the toolbar, draw a ROI around the desired hole.
- Click
Add [t]in the ROI manager to add your selection to the ROI list. - Repeat steps 3 & 4 for each hole.
Save the ROIs
- Once all the desired ROIs are in the ROI list, make sure none of them are highlighted by clicking
deselectin the ROI manager. - Click
More > Save...in the ROI manager and save your ROIs. It should try to save a.zipfile containing the.roiROI file for each selection. If it's saving a.roifile, likely one of the ROIs is highlighted.
Create a binary mask from the ROIs
- With all the ROIs in the ROI list, highlight all of them by
CTRL+ClickorCTRL+A. - Right-click the selection and
OR (Combine)the ROIs. Edit > Selection > Create Maskto open a new window with the created binary mask.- With the binary image in focue,
File > Save Asand select a desired file type to save in. Usually TIFF files are appropriate.
Create formatted CSV of hole dimensions
- Open the detailed list of ROIs in the ROI manager using
More > List. - Save the detailed list using
File > Save As...in new window that popped up to save a preliminary CSV file. - In the terminal, navigate to the folder where you saved the CSV and run
python format_roi_csv.py [filename.csv]to format the data. Add the arguments-s [x, y]to sort in a direction or-m [metadata.txt]to read metadata from another file.
Update ROIs
File > Openthe desired image.- In the ROI Manager,
More > Open...the ROI zip file. - To edit an existing ROI, highlight it in the ROI manager. Then, adjust your selection as desired. Once finished, click
Updatein the ROI manager. Save in the same way as before.