EllipsoidImageExpander#

Expand a set of points to fit an ellipsoid estimated from a 3D image volume. The ellipsoid is estimated from the image volume using a thresholding method and least squares fitting.s

The ellipsoid equation is of the form:

\[Ax^2 + By^2 + Cz^2 + Dxy + Exz + Fyz + Gx + Hy + Iz = 1\]

where A, B, C, D, E, F, G, H, I are the coefficients of the ellipsoid equation and x, y, z are the coordinates of the points. The parameters of this equation are fitted to the input image volume using least squares fitting.

param fluorescence:

The type of fluorescence to use for estimating the ellipsoid. Can be either ‘interior’ or ‘surface’. Default is ‘interior’.

type fluorescence:

str

napari_stress.approximation.EllipsoidImageExpander.coefficients_#

Coefficients of the fitted ellipsoid. The coefficients are of the form (3, 2, 3); The first dimension represents the three axes of the ellipsoid (major, medial and minor). The second dimension represents the components of the ellipsoid vectors (base point and direction vector). The third dimension represents the dimension of the space (z, y, x).

Type:

napari.types.VectorsData

napari_stress.approximation.EllipsoidImageExpander.axes_#

Lengths of the axes of the ellipsoid.

Type:

np.ndarray

napari_stress.approximation.EllipsoidImageExpander.center_#

Center of the ellipsoid.

Type:

np.ndarray

napari_stress.approximation.EllipsoidImageExpander.properties#

Dictionary containing properties of the expansion with following keys: - mean_curvature: np.ndarray

Calculate point-wise mean curvature \(H_i\) for an ellipsoid.

The formula for \(H_i\) is given as:

\[H(U, V) = \frac{ a_0 a_1 a_2 \Bigg( 3 \left(a_0^2 + a_1^2\right) + 2 \left(a_2^2\right) + \left(a_0^2 + a_1^2 - 2 a_2^2\right) \cos(2V) - 2 \left(a_0^2 - a_1^2\right) \cos(2U) \sin^2(V) \Bigg) }{ 8 \Bigg( \left(a_0 a_1 \cos(V)\right)^2 + \left(a_2 \sin(V)\right)^2 \Big( \left(a_1 \cos(U)\right)^2 + \left(a_0 \sin(U)\right)^2 \Big) \Bigg)^{1.5} }\]
  • principal_curvatures1: np.ndarray

    First principal curvature at the input points. Calculated as the maximum curvature at the input points:

  • principal_curvatures2: np.ndarray

    Second principal curvature at the input points. Calculated as the minimum curvature at the input points.

  • h0_ellipsoid: np.ndarray

    Averaged mean curvature \(H_0\) on the ellipsoid, calculated as the mean of the point-wise mean curvature \(H_i\).

  • h_e123_ellipsoid: np.ndarray

    Maximum, medial and minimum mean curvature of the ellipsoid.

Type:

dict

napari_stress.approximation.EllipsoidImageExpander.fluorescence#

The type of fluorescence used for estimating the ellipsoid. Can be either ‘interior’ or ‘surface’. Default is ‘interior’.

Type:

str

napari_stress.approximation.EllipsoidImageExpander.fit(image: 'napari.types.ImageData')#

Fit an ellipsoid to a 3D image volume using least squares fitting.

napari_stress.approximation.EllipsoidImageExpander.expand(points: 'napari.types.PointsData')#

Project a set of points onto their respective position on the fitted ellipsoid.

napari_stress.approximation.EllipsoidImageExpander.fit_expand(image: 'napari.types.ImageData')#

Fit an ellipsoid to a 3D image volume and then expand the points.

Examples

# Instantiate and fit an ellipsoid expander to a 3D image volume
expander = EllipsoidImageExpander(fluorescence='interior')
expander.fit(image)
# Expand the points on the fitted ellipsoid
fitted_points = expander.fit_expand(image, n_points=512)