tools.NavigatorMotionTracker#

class bartorch.tools.NavigatorMotionTracker#

Bases:

Six-degree-of-freedom rigid pose from a navigator’s 2D planes, filtered over time.

Each plane is registered in 2D against the same plane of the first navigator. A plane measures the rotation about its normal and the translation along its two in-plane axes; these are linear in the rotation vector and translation of the 3D pose, which are solved for by least squares over the planes and passed to a RigidMotionEKF. The planes’ normals must span the three rotations and their in-plane axes the three translations; three orthogonal planes are the usual set. The in-plane model holds while the out-of-plane motion is small enough that each plane still intersects the anatomy of its reference.

Parameters:
filter#

The filter carrying the pose.

Type:

RigidMotionEKF

reference#

Planes of the first navigator; None before the first track().

Type:

list or None

property registration#

Registration each plane is measured with.

property pose#

Current filtered pose, about the navigator’s centre.

reset()#

Discard the reference navigator and the filtered pose.

track()#

Register one navigator against the reference and return the filtered pose.

Parameters:
  • planes (sequence of torch.Tensor or numpy.ndarray) – One 2D image per plane, in the same order at every call.

  • axes (sequence) – Per plane, (row_axis, column_axis): unit 3-vectors, in the frame the pose is wanted in, along which the image’s first and second array axes run. The two must be perpendicular.

  • dt (float, default=1.0) – Time since the previous navigator.

  • spacing (float or sequence of float, default=1.0) – In-plane pixel size, one value or one per plane. Translations are returned in its unit.

Returns:

The filtered 3D pose relative to the reference navigator, about the origin of the axes frame; zero for the first navigator.

Return type:

RigidMotionEstimate

Raises:

ValueError – If the number of planes differs from the reference, the axes are not a perpendicular pair per plane, or the planes leave a rotation or translation component unmeasured.

Examples using NavigatorMotionTracker#

Rigid head motion from navigators

Rigid head motion from navigators