Fit Ellipsoid

A plugin to that fits an ellipsoid to a set of user clicked points in 3D

  • Pierre Weiss

License GNU GPL v3.0 PyPI Python Version

codecov napari hub npe2

A plugin to find the best ellipsoid to fit a set of points clicked by the user. With just a few clicks (10 is the absolute minimum) around the cells/nuclei boundaries, the plugin fits an ellipsoid and returns its parameters. This can be used to analyze tissue geometry, mecanical stress, provide training databases for segmentation algorithms,...

FitEllipsoid widget example


Installation

You can install fitellipsoid via pip:

conda create -n fitellipsoid-env python=3.11
conda activate fitellispoid-env
pip install -U 'napari[all]'
pip install fitellipsoid
napari

🧪 Usage Instructions

  1. Open your 3D image stack in Napari.

  2. Launch the FitEllipsoid plugin from the plugin menu.

  3. Select the point layer created by the plugin and begin clicking along the boundary of your object:

    • 🖱️ Left-click to add a point
    • 🖱️ Right-click to remove the last added point
  4. Once you've added at least 10 points, click on the "Fit Ellipsoid" button.

  5. A blue ellipsoid will be fitted and displayed.

    • ✅ If the shape fits well, you're done with that object.
    • ❌ If it doesn't, return to the corresponding point layer and add or adjust points.
  6. Repeat the process for all objects you'd like to segment.
    The plugin automatically adds a new point layer after each fit.

  7. When you're finished, save the results as a .csv file and optionally export a segmentation mask.

Contributors

  • Pierre Weiss - Project lead, core plugin development
  • Clément Cazorla - Added the segmentation mask generation

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the GNU GPL v3.0 license, "fitellipsoid" is free and open source software

Issues

If you encounter any problems, please [file an issue] along with a detailed description.

Version:

  • 0.0.6

Last updated:

  • 2025-04-11

First released:

  • 2025-04-08

License:

  • GNU GENERAL PUBLIC LICENSE ...

Supported data:

  • Information not submitted

Plugin type:

Open extension:

Save extension:

Python versions supported:

Operating system:

  • Information not submitted

Requirements:

  • napari>=0.5.6
  • npe2
  • numpy
  • magicgui
  • qtpy
  • scikit-image
  • tifffile
  • scipy
  • pandas
  • pathlib
  • tox; extra == "testing"
  • pytest; extra == "testing"
  • pytest-cov; extra == "testing"
  • pytest-qt; extra == "testing"
  • napari; extra == "testing"
  • pyqt5; extra == "testing"
Website by the napari team, original design by CZI. Go to napari main website.