OOF2: The Manual
Name
Smooth (Smooth) — Move nodes to the average position of their neighbors and accept ones that meet the acceptance criterion.
Synopsis
Smooth
(targets
,criterion
,T
,iteration
)
Details

Base class:
SkeletonModifier

Parameters:
targets
 Which nodes to move. Type: An object of the
FiddleNodesTargets
class. criterion
 Acceptance criterion Type: An object of the
SkelModCriterion
class. T
 Failed moves will be accepted if T>0 and exp(diffE/T) > r, where diffE is the energy gained and r is a random number between 0 and 1. Type: A real number.
iteration
 Iteration method. Type: An object of the
IterationManager
class.
Description
Smooth
moves Nodes
to the
average positions of their neighbors in order
to smooth out gradients in Node
density in a Skeleton
.
Typically, it takes about 3 iterations of
Smooth
to get desirable result. The general
procedure for a single iteration is as follows:

Collect target nodes according to the given
targets
parameter. The collectedNodes
are reordered randomly to avoid any potential artifacts from the original ordering ofNodes
. This reordering is repeated at every iteration. 
Give each
Node
a single chance to move to the average position of its neighbors. For this purpose, neighbors are defined asNodes
that share aSegment
with theNode
being moved.Figure 6.98(a) shows a
Node
(the red dot) that is about to move to the average position of its neighbors (the green dots). 
A node move is accepted only if the move satisfies the specified acceptance criterion. Moved nodes that fail to meet the criterion will spring back to their respective original positions, as shown in Figure 6.59(b).

If the move is unacceptable according to the acceptance
criterion
, OOF2 may still accept the move if the smoothing is being done at a nonzero temperature. The parameterT
sets the effective temperature of the annealing process. Unacceptable moves are accepted with a probabilitywhere is the difference between the effective energies of the new and old
Element
configurations.
Smoothing a Skeleton
usually requires a number of iterations. The
smoothing algorithm converges very quickly, so it's usually
sufficient to set the iteration
parameter to
FixedIteration(iterations
=3
)
to perform exactly three iterations. Nonetheless, it is possible
to use conditional
iteration, which can repeatedly smooth the Skeleton
until the
energy drop
or acceptance
rate per iteration becomes too small.
Figure 6.99 shows a Skeleton
in which the
Elements
near the perimeter of the circle have been refined more than those
elsewhere, resulting in an uneven Node
distribution.
After 3 iterations of smoothing, the Skeleton
looks much better in
Figure 6.100.
Statistics for each step of the smoothing process are printed in the OOF2 Message window. For example,
Iteration 1: E = 1.0480e+02, deltaE=2.6308e+00 ( 2.510%), Acceptance Rate = 55.3% Iteration 2: E = 9.0358e+01, deltaE=9.1959e01 ( 1.018%), Acceptance Rate = 47.9% Iteration 3: E = 8.5505e+01, deltaE=2.0926e01 ( 0.245%), Acceptance Rate = 40.1% Iteration 4: E = 8.4485e+01, deltaE=3.1806e02 ( 0.038%), Acceptance Rate = 37.2% Iteration 5: E = 8.4317e+01, deltaE=3.5836e03 ( 0.004%), Acceptance Rate = 35.6%
The listing shows the iteration number, the total energy
(E
) of the Skeleton
, the absolute
change in energy (deltaE
) during
the iteration, the percentage change in energy, and the move acceptance rate.
If the change in energy or the acceptance rate gets too small, the
smoothing process is not being effective at improving the Skeleton
.
Notice in the example that the energy change per step is
decreasing exponentially, indicating rapid convergence.