Professional Documents
Culture Documents
Locate the file small.ppm within the share/oof2/examples directory in your OOF2 installation.
Open the Microstructure page and click New from Image File to create a new microstructure.
2. The micrograph features eight distinct colors, each corresponding exactly to a microstructural
feature. Since the correspondence between colors and features is trivial, we can group pixels
automatically.
Go back to the Microstructure page and you will see that 8 pixel groups have been created for the
microstructure.
3. Now, open the Skeleton page, where we will spend most of the time in this tutorial.
The top part contains a Skeleton Selector and administrative features. The Skeleton Selector is the
two pull-down menus labelled Microstructure and Skeleton. The first lets you choose a
Microstructure and the second lets you choose a Skeleton belonging to that Microstructure.
The Skeleton Status pane on the left is a display for Skeleton summary data such as number of
nodes and elements.
The Skeleton Modification pane on the right contains a bunch of skeleton modification tools that we
will use to adapt a Skeleton to the material boundaries in its Microstructure.
As in other cases, to give a skeleton a user-defined name, check the little square box and type in a
name of your liking.
The number of elements in the initial skeleton can be set with the parameters, x_elements and
y_elements.
You can choose the element shape with the skeleton_geometry parameter.
For this tutorial, just use the default values for the initial skeleton: x_elements=4, y_elements=4,
and skeleton_geometry=QuadSkeleton.
For a Skeleton to be a good representation of a Microstructure, the Elements in the Skeleton must
not cross boundaries between different pixel types. Two pixels are defined to have the same type if
they have the same Material assigned to them and if they belong to the same pixel groups. Since we
haven't assigned Materials yet, and since we've assigned groups according to pixel color, in this
tutorial pixel color is synonymous with pixel type.
Except for one yellow element at the top-right corner of the skeleton, all the elements are
heterogeneous, meaning that these elements contain pixels of two or more pixel types.
6. Let us subdivide these heterogeneous elements as the first step towards making them
homogeneous.
In the Skeleton Modification pane in the Skeleton page, set the method pull-down menu to Refine.
The parameter targets determines which elements should be refined. Select Heterogeneous
Elements and set its threshold to be 1.0, meaning any heterogeneous elements will be refined. (All
elements with a homogeneity less than 1.0 will be refined. The homogeneity is the largest fraction
of an element's area belonging to a single pixel type.)
The second parameter criterion determines whether to accept or reject the resulting refinement.
Select Unconditional.
The parameter degree controls the degree of subdivision. It specifies into how many segments each
edge of an element will be divided.
Each refinement degree has a parameter rule_set that contains two options. The conservative
rule_set preserves the topology of the target element. That is, if you refine a quadrilateral, you'll get
only quadrilaterals, whenever possible. The liberal rule_set may mix triangles and quadrilaterals, if
the mix yields a better result.
Finally, the parameter alpha determines how elements are refined when there are two or more
possibilities. When alpha is near zero, oof2 chooses the arrangement that produces elements with
the best shapes. When alpha is near one, it tries to make the elements as homogeneous as possible.
Set alpha to 0.5.
Every element (except one in the top-right corner) has been divided into 9 elements. As a result, a
larger fraction of the Microstructure's area is covered by homogeneous elements.
At the bottom of the Skeleton Status pane in the Skeleton page, there is a Homogeneity Index. This
number indicates the homogeneity of the entire skeleton.
As the skeleton becomes more homogeneous and adapts to material boundaries, the Homogeneity
Index gets closer to 1.
This time, leave targets set to Heterogeneous Elements and set threshold to 0.9, so that only
elements less than 90% homogeneous will be refined.
9. The Skeleton looks okay -- no material boundary is very far from an element boundary -- but the
element boundaries don't really coincide with the material boundaries. More work is necessary.
You don't want to refine a skeleton to the point where it inevitably inherits the jagged pixel
boundaries of the micrograph.
Thus, we need a different approach to resolve issues with the elements near the material boundaries.
OOF2 provides three different methods of moving nodes in adapting to material boundaries -- Snap
Nodes, Anneal, and Move Nodes.
Snap Nodes first looks for boundary points -- intersections between material boundaries and
element edges -- and moves nodes to the corresponding points, if the result is favorable.
Anneal, on the other hand, moves nodes to randomly chosen points and accepts only the ones that
are beneficial.
The Move Nodes toolbox in the Graphics window allows you to move nodes manually.
11. Select the Snap Nodes method in the Skeleton Modification pane in the Skeleton page.
This tool will move nodes of target elements to the material boundary points along the edges of the
elements.
Select Heterogeneous Elements for the targets parameter and set the threshold to be 0.9, meaning it
will attempt to move nodes of elements with homogeneity less than 0.9.
12. For the criterion parameter, select Average Energy and set its parameter alpha to be 1.
By setting alpha=1, we've told the Snap Nodes tool that it's ok if moving a node creates badly
shaped elements, as long as doing so makes them more homogeneous. (We'll fix the bad shapes
next.)
Click OK to make changes. The Homogeneity Index increases from 0.957 to 0.989.
13. Because Snap Nodes considered only homogeneity, some elements have been badly distorted
while adapting themselves to the material boundaries.
This modification tool automatically removes badly shaped elements, provided the changes meet a
certain criterion.
Set criterion to Average Energy and set alpha to 0.8. With this setting, the Rationalize tool will only
make changes that lower the average energy E of the affected elements. alpha determines how E is
computed.
Three rationalization techniques are listed. Move the mouse pointer over each technique to get
more information about it. Make sure all three are selected and click OK, while keeping the default
values for their parameters.
The summary for the modification is displayed in the OOF Messages window. Also, in the graphics
window, you will notice that many of the badly shaped elements are gone.
14. Open the Skeleton Selection page in the main OOF2 window. This page provides tools for
selecting Skeleton components -- elements, segments, and nodes -- and for manipulating groups of
them.
From the Element Selection Operations pane in the right side of the page, select Select By
Homogeneity for the parameter Action and set its threshold to be 0.9, to select all elements less than
90% homogeneous.
15. Return to the Skeleton page and select Split Quads for the modification method. This tool
splits target quadrilaterals into two triangles. A split is accepted only if it meets a specified
criterion.
A quadrilateral element can be split along either of its two diagonals. The split_how parameter
determines how OOF2 decides which diagonal to choose. Geographic examines the element's
neighbors to see if it's likely that there's a material boundary crossing the target element on a
diagonal. TrialAndError splits a quadrilateral along the both diagonals and chooses the better of the
two. Set split_how to Geographic.
16. A handful of quadrilaterals have been split, but some badly shaped triangles were generated.
Select Rationalize and apply it to the Skeleton with the same settings as before.
17. Go back to the Skeleton Selection page and again select elements by homogeneity with the
threshold set to 0.9.
18. Return to the Skeleton page and select Anneal for the modification method. Anneal moves
nodes randomly and accepts or rejects the new positions according to the given criterion. On each
iteration, Anneal attempts to move each node once, but it chooses the nodes in a random order.
Select Selected Elements for its targets, meaning it will attempt to move nodes of the selected
elements only.
For criterion, select Average Energy with alpha of 0.9.
Set T to be 0.0 and also set delta to be 1.0. Move the mouse over these parameters to get more
information.
For iteration, select Conditional Iteration, which stops annealing when certain conditions are met.
Set condition to Acceptance Rate, and set the acceptanceRate parameter to 7. This will terminate
the annealing procedure if it starts accepting fewer than 7% of the attempted moves.
Set extra to 3, to require that the condition be satisfied for three consecutive iterations before
actually terminating the procedure.
Leave maximum set to 100, setting an absolute limit on the number of iterations.
Click OK.
19. If you recall, we set alpha to 0.9 during the anneal. This put a strong emphasis on homogeneity,
thus many elements may have been distorted severely.
20. Open the Skeleton Selection page and select elements by homogeneity with threshold = 0.9.
You will notice that the number of elements selected is significantly reduced.
21. Return to Skeleton page and do the Anneal one more time with the same settings as before.
22. Again, we need to Rationalize the skeleton before we move on to the next step.
23. Open the Skeleton Selection page and select elements by homogeneity with the threshold being
0.9.
There should be very few elements selected. (Because of randomness in some modification
methods, your results may vary.)
There should be very few elements selected, meaning that most of the elements have been adapted
to the material boundaries successfully.
24. Move back to the Skeleton page and check the Homogeneity Index.
We'll now turn our attention to elements' quality, more precisely, their shape.
The tools for improving the skeleton's quality include Swap Edges, Merge Triangles, and Smooth.
These tools, however, can potentially affect material boundaries that have been established already.
Thus, we need to be extra careful not to disturb the existing boundaries. The best way to avoid this
potentially sorry situation is to pin down all the nodes along the boundaries.
In the pull-down menu labelled Method, Select Pin Internal Boundary Nodes. Click OK.
All the nodes along the boundaries should be selected and displayed as yellow dots.
These nodes are not going to move at all, until they are unpinned.
26. Go back to the Skeleton page in the OOF2 main window and select Swap Edges for the
modification method. This takes any two neighboring elements and reorients their shared edge.
Also, it is a good idea to Rationalize the skeleton to remove potential bad elements created by the
swap.
27. In addition to Swap Edges, you can merge two neighboring triangles into a quadrilateral.
By doing this, you're accepting any changes, unless they produce elements for which the
homogeneity drops below the specified value or the shape energy goes above the specified value.
28. We're going to give the skeleton finishing touches by applying Smooth. Smooth works much
like Anneal, except that instead of picking node positions randomly, it moves each node to the
average position of its neighbors.
Select Limited Unconditional for criterion and set its parameters alpha to 0.5, homogeneity to 0.9,
and shape_energy to 0.4.
Click OK.
29. The Save/Skeleton command in the File menu in the main OOF2 window, and the Save button
on the Skeleton page both allow you to save Skeletons to a file.
The format parameter in the file selector dialog box was discussed in the Microstructure tutorial.
When you save a Skeleton, its Microstructure is saved with it in the data file. Loading the data file
with the Load/Data or Load/Script commands from the File menu restores both the Microstructure
and the Skeleton.
30. You must like what you see in the graphics window. Anyway, we have covered most of the
issues related to Skeleton modifications.
Related topics not covered in this tutorial include Active Areas, and the Move Node toolbox.