Approximation module#

Approximation subpackage for napari-stress.

class napari_stress.approximation.EllipsoidExpander#

Expand a set of points to fit an ellipsoid.

Parameters:

points (napari.types.PointsData) – The points to expand.

napari_stress.approximation.expand_points_on_ellipse(fitted_ellipsoid: VectorsData, pointcloud: PointsData) PointsData#

Expand a pointcloud on the surface of a fitted ellipse.

This function takes a ellipsoid (in the form of the major axes) and a pointcloud from which the ellipsoid was derived. The coordinates of the points in the pointcloud are then transformed to their corresponding locations on the surface of the fitted ellipsoid.

Parameters:
  • fitted_ellipsoid (VectorsData)

  • pointcloud (PointsData)

Return type:

PointsData

Deprecated since version 0.3.3: This will be removed in 0.4.0. Use approximateion.EllipseExpander instead.

napari_stress.approximation.expand_points_on_fitted_ellipsoid(points: napari.types.PointsData) napari.types.PointsData#

Project a set of points on a fitted ellipsoid.

Parameters:

points (napari.types.PointsData) – The points to project.

Returns:

projected_points – The projected points.

Return type:

napari.types.PointsData

napari_stress.approximation.fit_ellipsoid_to_pointcloud(points: napari.types.PointsData) napari.types.VectorsData#

Fit an ellipsoid to a set of points.

Parameters:

points (napari.types.PointsData) – The points to fit an ellipsoid to.

Returns:

ellipsoid – The fitted ellipsoid.

Return type:

napari.types.VectorsData

napari_stress.approximation.least_squares_ellipsoid(points: PointsData) VectorsData#

Fit ellipsoid to points with a last-squares approach.

This function takes a pointcloud and fits an ellipsoid to it using a least-squares approach. The ellipsoid is returned as a set of vectors representing the major and minor axes of the ellipsoid.

Parameters:

points (PointsData)

Returns:

VectorsData

Return type:

Major/minor axis of the ellipsoid

Deprecated since version 0.3.3: This will be removed in 0.4.0. Use approximateion.EllipseExpander instead.

napari_stress.approximation.normals_on_ellipsoid(points: PointsData) VectorsData#

Fits an ellipsoid and calculates the normals vectors.

This function takes a pointcloud and calculates the normals on the ellipsoid fitted to the pointcloud.

Parameters:

points (PointsData)

Returns:

VectorsData

Return type:

Normals on the ellipsoid