Curvature Modules
Calculate various curvature metrics for traces.
angle_diff_signed(v1: npt.NDArray[np.float64], v2: npt.NDArray[np.float64])
Calculate the signed angle difference between two point vecrtors in 2D space.
Positive angles are clockwise, negative angles are counterclockwise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v1
|
NDArray[float64]
|
First vector. |
required |
v2
|
NDArray[float64]
|
Second vector. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The signed angle difference in radians. |
Source code in topostats\measure\curvature.py
calculate_curvature_stats_image(topostats_object: TopoStats) -> None
Perform curvature analysis for a whole image of grains.
Curvature statistics are added to the Molecule.curvature_stats attribute of the traces that are being processed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
topostats_object
|
TopoStats
|
|
required |
Source code in topostats\measure\curvature.py
discrete_angle_difference_per_nm_circular(trace_nm: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]
Calculate the discrete angle difference per nm along a trace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trace_nm
|
NDArray[float64]
|
The coordinate trace, in nanometre units. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
The discrete angle difference per nm. |
Source code in topostats\measure\curvature.py
discrete_angle_difference_per_nm_linear(trace_nm: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]
Calculate the discrete angle difference per nm along a trace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trace_nm
|
NDArray[float64]
|
The coordinate trace, in nanometre units. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
The discrete angle difference per nm. |