This is an ImageJ macro for determining features of grain boundary interfaces, wherein the grains are modelled by ellipses which represent a reconstruction of the original grain boundaries.
Using the intersections of these reconstructed grain boundaries, i.e. the grain-fitting ellipses, a straight-line compromise boundary is determined. From this, the width of the compressed region as well as the total width are determined along the line perpendicular to the midpoint of the compromise boundary.
The process, including its purpose and technical significance, is described in Onasch (1993); Pierson (2014) is an open-access thesis with a description of the method.
This process has been adapted using ImageJ to solve the analysis of overlapping ellipses:
The method used by this algorithm determines the points at which two ellipses intersect using the polygonal approximation of the ROI in ImageJ. Typically ImageJ's makeEllipse function produces 72-sided polygons when rendered as regions of interest (ROIs). In practice, this means that the method is an approximation compared to analytic calculations of ellipse intersections. However this is sufficinetly accurate for the intended purpose and has the added benefit that it can be extended to any other pair of convex polygons.
- ellipse_intersections.ijm : The "Ellipse Intersections" macro provides a simple demonstration of the method which requires no additional data input. Simply open with ImageJ (or FIJI) and click Run to execute and see the results.
- onasch_grains.ijm : The "Onasch Grain Overlaps" macro is designed for processing multiple ellipses for a given image, with the ellipse data loaded as a CSV file into ImageJ's Results Table. The output results will be recorded in a new table.
- For all ellipses:
- Make ellipse ROI
- Rotate, translate, and make the intervals regular
- add to ROI manager.
- Loop through, comparing all pairs of ellipses
- Get the ROIs
- Check for intersections
- If they intersect, determine the line between the intersection points
- Find midpoint; calculate line perpendicular (L).
- Find points where L intersects the two ellipses.
- Calculate the min and max distances from those intersections
- Record distances.
- Draw the lines
In step 2.2, checking for intersections, check is performed, utilizing the nature of ellipses, to determine whether the distance between two ellipse centres is greater than the sum of the semi-major axes of the ellipses. This provides time-savings relative to the process to determine where and if two polygons intersect for all pairs of polygons.
The CSV is a data file containing coordinates for the ellipses drawn using EllipseFit. The output file may require editing to remove prefatory lines in order for ImageJ to recognize it (i.e. There should be no lines preceeding the column labels.)
The CSV file is expected to be organized with the following columns:
ID,X,Y,Max,Min,Area,R,Phi
- ID : id number for each ellipse
- x : centre x coordinate (px)
- y : centre y coordinate (px)
- max : semi-major axis of the ellipse (px)
- min : semi-minor axis of the ellipse (px)
- R : ellipse ratio ( max / min)
- Phi : orientation of the long axis of ellipse
The image input is typically a TIF of a thin section of geological material under a petrographic microscope. The desired ellipses may already be drawn on it, however this is not a data input. The image file is unnecessary, however it provides a check for the data.
Two sample data files have been provided by Marques Hatfield.
Colours and line widths of the overlays plotted with the Onasch_Grains tool can be modified by changing the input values at the top of the macro file. Hex codes are used for colour.
It is important to note that the ellipse measurements (coordinates and axes) are given in pixel units.
Ellipses drawn with and without lines drawn to measure shortening perpendicular to the compromise boundary:
To quickly visualize the results from this, the data points can be plotted on circle relative to angle and percent shortening.
- quick_orientation_plot.ijm : The macro offers two methods to choose from. (A) Points are plotted with (100-percent_shortening)/100 × plot_radius. (B) Points are plotted with (percent_shorting / max_percent_shortening) × plot_radius.
A | B |
---|---|
- Charles M. Onasch, "Determination of pressure solution shortening in sandstones", Tectonophysics, 1993, 227, pp. 145-159. DOI: 10.1016/0040-1951(93)90092-X
- Nichole Pierson, "Assessing Layer Parallel Shortening in the Easter Colorado Front Range Using Tin Section Analysis and Analog Sandbox Models". MSc Thesis, University of Nebraska - Lincoln, Department of Earth and Atmospheric Sciences, 2014. URL: http://digitalcommons.unl.edu/geoscidiss/51