curvature#
Calculate various curvature metrics for traces.
Attributes#
Functions#
|
Calculate the signed angle difference between two point vecrtors in 2D space. |
Calculate the discrete angle difference per nm along a trace. |
|
Calculate the discrete angle difference per nm along a trace. |
|
|
Perform curvature analysis for a whole image of grains. |
Module Contents#
- curvature.LOGGER#
- curvature.angle_diff_signed(v1: numpy.typing.NDArray[numpy.float64], v2: numpy.typing.NDArray[numpy.float64])#
Calculate the signed angle difference between two point vecrtors in 2D space.
Positive angles are clockwise, negative angles are counterclockwise.
- Parameters:
v1 (npt.NDArray[np.float64]) – First vector.
v2 (npt.NDArray[np.float64]) – Second vector.
- Returns:
The signed angle difference in radians.
- Return type:
float
- curvature.discrete_angle_difference_per_nm_circular(trace_nm: numpy.typing.NDArray[numpy.float64]) numpy.typing.NDArray[numpy.float64]#
Calculate the discrete angle difference per nm along a trace.
- Parameters:
trace_nm (npt.NDArray[np.float64]) – The coordinate trace, in nanometre units.
- Returns:
The discrete angle difference per nm.
- Return type:
npt.NDArray[np.float64]
- curvature.discrete_angle_difference_per_nm_linear(trace_nm: numpy.typing.NDArray[numpy.float64]) numpy.typing.NDArray[numpy.float64]#
Calculate the discrete angle difference per nm along a trace.
- Parameters:
trace_nm (npt.NDArray[np.float64]) – The coordinate trace, in nanometre units.
- Returns:
The discrete angle difference per nm.
- Return type:
npt.NDArray[np.float64]
- curvature.calculate_curvature_stats_image(topostats_object: topostats.classes.TopoStats) None#
Perform curvature analysis for a whole image of grains.
Curvature statistics are added to the
Molecule.curvature_statsattribute of the traces that are being processed.- Parameters:
topostats_object (TopoStats) –
TopoStatsobject with attributegrain_crop. Should be post-splining.