napari-crop

Crop regions in napari manually

  • Tim Morello, Marcelo Leomil Zoccoler, Johannes Soltwedel

License PyPI Python Version tests codecov DOI

🚨🚨🚨 Call for maintainers 🚨🚨🚨

If you are interested in further developing it, please get in touch or create a fork.

Crop regions in napari manually

Crop in any dimension

Cut a volume using a plane

Note:

- this functionality currently only works with 3D data

- to drag the plane, hold the 'SHIFT' key from your keyboard

Draw shapes of fixed size at given coordinates for later cropping

Note:

- the shapes are drawn with the specified width and height, but, since the crop widget is very permissive as it tends to include all pixels the shape "touches", the cropped result tends to be 1pixel larger in both dimensions. Therefore, to have a 64x64 array after cropping, it is best to set the shape sizes here to 63x63 for example.

Usage

Create a new shapes layer to annotate the region you would like to crop:

Use the rectangle tool to annotate a region. Start the crop tool from the Plugins > napari-crop > Crop region or, if available, Tools > Utilities > Crop region menu or Layer > Transform > Crop region(s). Click the Run button to crop the region.

You can also use the Select shapes tool to move the rectangle to a new place and crop another region by clicking on Run.

Hint: You can also use the napari-tabu plugin to send all your cropped images to a new napari window.


This napari plugin was generated with Cookiecutter using with @napari's cookiecutter-napari-plugin template.

Installation

You can install napari-crop via pip:

pip install napari-crop

Contributing

Contributions are very welcome.

License

Distributed under the terms of the BSD-3 license, "napari-crop" is free and open source software

Issues

If you encounter any problems, please create a thread on image.sc along with a detailed description and tag @haesleinhuepf.

Version:

  • 0.1.12

Last updated:

  • 2026-01-22

First released:

  • 2021-10-21

License:

  • Copyright (c) 2021, Robert Haa...

Supported data:

  • Information not submitted

Plugin type:

Open extension:

Save extension:

Python versions supported:

Operating system:

  • Information not submitted

Requirements:

  • napari-plugin-engine>=0.1.4
  • numpy
  • scikit-image
  • napari-tools-menu>=0.1.17
  • napari-workflows
  • 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.