Measure object curvature

Fits a 2D spline to the backbone of objects.

Description

Fits a 2D spline to the backbone of objects. Each object in the input collection will be reduced to a single (longest skeleton path) backbone, which will be fit with the spline. Local curvature of the spline can be calculated and any measurements will be assigned to the relevant object (irrespective of whether spline objects are exported). Curvature values can be calculated as "absolute" (always greater than 0, irrespective of the direction of curvature), or "signed" (sign dependent on direction of curvature, but requires the "start" end of the backbone to be specified).

Note: Spline fitting will be performed in 2D, so any 3D objects will be projected into a single plane first.

Parameters

ParameterDescription
Input objectsObjects to which splines will be fit. A single spline will be fit to each object in this collection. Any calculated measurements will be assigned to the relevant object (irrespective of whether spline objects are exported). Note: Spline fitting will be performed in 2D, so any 3D objects will be projected into a single plane first.
Object output modeControls whether spline objects are exported:
  • "Do not store" No spline objects are output by this module.
  • "Individual control points" Specific points along the contour are exported. Each control point is itself a separate object, which is a child of the corresponding input object. As such, each input object will generally have multiple child control point objects.
  • "Full contour" All points along the spline are exported as a single object. This object is stored as a child of the corresponding input object.
Output objectsThe name assigned to the objects if they are being exported.
Export every N pointsIf spline objects are being exported (either as full contours or as individual control points), this value controls the interval between points. As such, increasing values will export fewer and fewer points.
Spline fitting methodControls how the spline is fit to the input object:
  • "LOESS (smooth fitting)" Performs a local regression (LOESS) interpolation of the line to give a smoothed representation of the object backbone (longest skeleton path). Uses Apache Math3 LoessInterpolator.
  • "Standard (fits all points)" Fit spline is formed of straight line segments between every other point along the input object backbone (longest skeleton path). This method doesn't perform any smoothing. Uses Apache Math3 SplineInterpolator.
Number of neighbours (smoothing)Number of neighbouring points used in the calculation of each spline control point. The greater the number of neighbours, the smoother the output spline.
Iterations"This many robustness iterations are done. A sensible value is usually 0 (just the initial fit without any robustness iterations) to 4". Description taken from LoessInterpolator documentation
Accuracy"If the median residual at a certain robustness iteration is less than this amount, no more iterations are done". Description taken from LoessInterpolator documentation
Relate to reference pointWhen selected, the fit spline will be oriented such that the first point is closer to the reference point (specified by measurements "X-axis reference measurement" and "Y-axis reference measurement") than the final point in the spline. Having this consistency to the spline orientation allows measurements relative to the first point to be calculated (e.g. relative location of maximum curvature along the spline). When this is not selected, there's no guarantee of which end of the spline will be "first".
X-axis reference measurementIf "Relate to reference point" is selected, this is the measurement associated with the input object that will provide the x-axis reference for determining the orientation of the spline.
Y-axis reference measurementIf "Relate to reference point" is selected, this is the measurement associated with the input object that will provide the y-axis reference for determining the orientation of the spline.
Measure absolute curvatureWhen selected (and when "Relate to reference point" is also selected), absolute curvature values will be calculated. Absolute curvatures are always greater than or equal to 0, irrespective of direction. Increasing signed curvature values indicate increasing curvatures.
Measure signed curvatureWhen selected (and when "Relate to reference point" is also selected), signed curvature values will be calculated. Signed curvatures are increasingly positive as the spline bends left and increasingly negative as the spline bends right (directions relative to path along spline, starting at first point).
Calculate angle between endsWhen selected, the angle between the two ends of the spline are calculated in degree units.
Fitting range (px)If the angle between spline ends is being calculated, this is the number of points at each end of the spline that are fit to get the orientation at that end.
Draw splineWhen selected, the fit spline(s) will be rendered as an overlay on the image specified by "Input image".
Input imageIf drawing the spline(s), this is the image onto which they will be added as overlays.
Apply to imageIf drawing the spline(s), when this is selected, the spline overlays will be added to the image specified by "Input image". If not selected, the image containing the overlays will be stored separately in the workspace with the name specified by "Output image".
Output imageIf drawing the spline(s) and "Apply to image" is not selected, this is the name with which the overlay images will be stored in the workspace.
Line widthIf drawing the spline(s), this is the width of the spline overlay lines that will be drawn.
Maximum curvature (for colour)If drawing the spline(s), the local colour of each spline will represent the local absolute curvature. This value controls the maximum absolute curvature that will correspond to the top-end of the curvature colourmap. Values above this will see the colourmap cycling.