imodcurvature(1) imodcurvature(1)
NAME
imodcurvature - Measures radius of curvature of model objects
SYNOPSIS
imodcurvature options in_model out_model
DESCRIPTION
This program will compute the local radius of curvature of objects in a
model and encode that value into the model as a color or a 2D or 3D
point size. It can compute either a 2D or a 3D radius of curvature by
fitting circles or spheres to contours. For fitting in 2D, it computes
the radius of curvature at each point in a contour by fitting to a seg-
ment of the contour centered on the point; the length of this segment
is set by a parameter called the window length. This parameter should
be varied to explore the tradeoff between averaging over larger areas
and having a less noisy result. This 2D fitting should be very reli-
able because the search for the center and radius of the circle is ini-
tialized by an explicit solution for the circle through three widely
spaced points along the contour. However, the 2D fitting will produce
a gradient of curvatures in a spherical object because the radius of
cross-sections decreases away from the equator.
The 3D fitting is activated by specifying a parameter for the range in
Z over which to fit. The objects to be fit must contain a mesh (pro-
duced by Imodmesh) so that connections between contours can be
deduced. In this case the program computes the radius for each point
by sampling points from contours above and below the point in Z. The
fit of 4 parameters to these sample points may be somewhat less reli-
able because it is still initialized by the explicit solution for a
circle fit to the central contour. No fit is done to a point unless
there is at least one contour above and one contour below the point in
Z. Here one may need to explore the effects of varying both the window
length and the Z range.
If contours are in arbitrary planes rather than in Z planes, the -ro
option allows them to be individually rotated into the best-fitting
plane, and the 2D curvature can then be determined.
A radius of curvature is encoded into the model only if it falls within
the range of the lower and upper criteria set with the -rc option. In
addition, a criterion for the root mean square error of the fit may be
set with the -fc option, in which case a radius is encoded only if the
fit gave an error less than this criterion.
The radius value can be used to set a color, a 3D point size, or a 2D
symbol size for each individual point that meets the criteria. One or
a few colors can be specified with the -co option, or a full false-
color palette can be used with the -pa option. In addition, the curva-
ture values can be stored directly in the model, in which case 3dmod
will display the values in false color by default. This method allows
dynamic control over the display. With either method for color dis-
play, the model needs to be remeshed to see the colors in the model
view of 3dmod. The 3D points are useful for seeing the exact values
of the radius by opening the Surface/Contour/Point dialog in 3dmod.
They could also be useful for visualizing the fit in the 3dmod Zap
window, provided that one selects the option in the Edit Object dialog
to show the spheres only on their central section. These spheres will
impair the display in the model view window, however. An alternative
is to encode the radius as circular symbols; however, they will only
have the right size at the particular zoom specified with the -sy
option.
Options
Imodcurvature uses the PIP package for input (see the manual page for
pip). Options can be specified either as command line arguments
(with the -) or one per line in a command file (without the -):
-in OR -InputFile File name
Name of input model file. If it is not entered with this option
it must be entered with the first non-option argument.
-OutputFile File name
Name of output model file. If it is not entered with this
option it must be entered with the second non-option argument.
-wl OR -WindowLength Two floats
Length in pixels over which to fit a circle to the contour data
around a point. The default is the sum of the lower and upper
radius criteria (i.e., the mean diameter). The radius will not
be determined in contours less than this length for closed con-
tour objects, or less than half this length for open contour
objects. In the latter case, the window will be reduced for
fitting to points near the ends of the contour.
-zr OR -ZRangeToFit Floating point
Range of contours in Z to include for fitting to a sphere. The
value should specify the actual distance in Z after Z-scaling,
if any. The default is 0 to fit just one contour at a time to a
circle.
-rc OR -RadiusCriterion Two floats
Lower and upper criteria for radius of curvature. When the
radius at a point is within this range, it will be encoded into
the model.
-fc OR -FitCriterion Floating point
Criterion for root mean squared error of the local fit to a cir-
cle. If a non-zero value is entered, then the RMS error must be
less than the given value for a radius of curvature to be
encoded at that point. With the default value of 0, the curva-
ture will be encoded regardless of the error of the fit.
-ob OR -ObjectsToDo List of integer ranges
List of objects to encode
-ro OR -RotateToXYPlane
Rotate contours that are not all in one X/Y plane into the best-
fitting X/Y plane. Circles will be fit to the rotated contour.
This option cannot be used with the -zr option for spherical
fitting.
-ps OR -PointSize
Use spherical point size to encode radius of curvature. Each
point that meets the criterion will be given a point size equal
to the radius of curvature; other points will have individual
point sizes set to 0.
-sy OR -SymbolZoom Floating point
Use circular symbols to encode radius of curvature, where the
circles will have the right size when the image is displayed
with the given zoom factor.
-co OR -Color Three integers
Use this entry to specify one or more colors to change points to
when their radius of curvature meets the criteria. Enter r,g,b
values between 0 and 255. When multiple colors are entered, the
behavior is controlled by the -di option. (Successive entries
accumulate)
-di OR -DivideRange
When multiple colors are entered, by default they will be
applied to successive objects being analyzed. If this option is
entered, then the range of radii between the low and high crite-
rion will be subdivided by the number of colors, and points
within each subrange will be assigned to a different color.
-pa OR -UsePalette File name
Use a 256-color false color palette for the colors. Enter a
filename to read a color table from a file, or "s", "standard",
or any abbreviation thereof for the standard palette from 3dmod,
or "i", "inverted", or any abbreviation thereof for an inverted
palette from 3dmod. This option will automatically subdivide
the radius range into 256 levels. A color table file can have
one of two forms. One form starts with a line with 256, then
has 256 lines with red, green, and blue values from 0-255. The
other form starts with the number of lines to follow; then each
following line has a red, green, and blue value (0-255) plus an
arbitrary integer indicating the relative location of that value
along the 256-color range. These location values must be in
order. If the colors being specified are to be equally spaced,
the location values can simply be sequential values.
-st OR -StoreValues
Store the curvature values directly in the model. They can then
be visualized as intensity variations or in false color by acti-
vating the option to "Show stored values" in the Values panel of
the model view Object Edit window of 3dmod. This option allows
dynamic adjustment of the displayed colors.
-sa OR -SampleSpacing Floating point
Spacing of sample points along contour for fitting (default 2)
-ve OR -Verbose
The verbose output will show the number of points being fit, the
center and radius, and the root mean squared error for each
point being fit. It could be useful for getting a sense of the
RMS errors.
-tc OR -TestCircleFits
Test circle fitting by fitting a circle to each contour in
object 1 and putting a point with the given location and radius
in a new object.
-ts OR -TestSphereFits Two integers
Test sphere fitting by making a new object with the points being
fit to and the fitted sphere for the given contour and point
number.
-StandardInput
Read parameter entries from standard input
AUTHOR
David Mastronarde
SEE ALSO
3dmod, imodmesh
BUGS
Email bug reports to mast at colorado dot edu.
BL3DEMC 3.11.2 imodcurvature(1)