PyFrame

class multimodars.PyFrame(id, centroid, lumen, extras, reference_point)

Bases: object

Python representation of a single intravascular imaging frame.

id

Frame identifier.

Type:

int

centroid

(x, y, z) centroid of the frame.

Type:

tuple of float

lumen

Lumen contour for this frame.

Type:

PyContour

extras

Additional contour types keyed by name: "Eem", "Calcification", "Sidebranch", "Catheter", "Wall".

Type:

dict of str to PyContour

reference_point

Reference position used for alignment, if available.

Type:

PyContourPoint or None

Examples

>>> geom = PyFrame(
...     id=0,
...     centroid=(0.0, 0.0, 0.0),
...     lumen=lumen_contour,
...     extras={"Eem": eem_contour},
...     reference_point=ref_point
... )
rotate(angle_deg)

Rotate all contour points in the frame by the given angle.

Parameters:

angle_deg (float) – Rotation angle in degrees.

Returns:

frame – New frame with all contours rotated.

Return type:

PyFrame

sort_frame_points()

Sort contour points in the frame by their angular position.

Returns:

frame – New frame with contour points sorted angularly.

Return type:

PyFrame

translate(dx, dy, dz)

Translate all contour points in the frame by the given offsets.

Parameters:
  • dx (float) – Translation along the x-axis in mm.

  • dy (float) – Translation along the y-axis in mm.

  • dz (float) – Translation along the z-axis in mm.

Returns:

frame – New frame with all contours translated.

Return type:

PyFrame