CopickFilamentCurve
copick.models.CopickFilamentCurve
Bases: BaseModel
The editable or fitted representation of a filament's centreline, from which its points are regenerated.
The curve is optional; points stay the canonical centreline. See docs/datamodel.md (Filaments, Editable
curves) for the specification, and copick.util.filaments for the reference implementation.
Attributes:
-
kind(str) –"catmull-rom"(passes through its control points; interactive tracing),"linear", or"bspline"(a fitted B-spline, stored exactly). Other kinds are kept as they are but never evaluated. -
control_points(List[Tuple[float, float, float]]) –[[x, y, z], ...]in Angstrom, in the direction ofpoints; the B-spline coefficients for"bspline". -
step(float) –Arc-length spacing of the regenerated
points, in Angstrom. -
alpha(Optional[float]) –Catmull-Rom parameterisation; 0.5 (centripetal) when not given.
-
degree(Optional[int]) –B-spline degree (1-5).
-
knots(Optional[List[float]]) –B-spline knots, clamped.
-
smoothing(Optional[float]) –The fit's smoothing factor (scipy's
s). Descriptive only.
passes_through_control_points
Whether the curve passes through every control point (all but bspline).
validate_curve
Check a curve of a known kind against its kind's rules.
anchors
The points the curve passes through: its control points, or a B-spline at its knots.
is_current_for
Whether this curve still describes points (never, for an unknown kind).
from_tck
from_tck(tck, step: float, smoothing: Optional[float] = None, scale: float = 1.0) -> CopickFilamentCurve
A bspline curve from scipy's splprep output.
Parameters:
-
tck–(knots, [cx, cy, cz], degree), with the coefficients of the x, y and z coordinates. -
step(float) –Arc-length spacing of the regenerated points, in Angstrom.
-
smoothing(Optional[float], default:None) –The fit's smoothing factor, recorded on the curve.
-
scale(float, default:1.0) –Factor from the fit's coordinates to Angstrom (the voxel spacing for a fit in voxels).
Returns:
-
CopickFilamentCurve–The curve.