A napari plugin for manual registration of (a part of) an image

License PyPI Python Version

A napari plugin to affine transform images and parts of images in 2D and 3D. It was developed in the context of brain slice registration and solves multiple, related problems when working with histology slices.


You can install Partial-Aligner via pip:

pip install Partial-Aligner

To make full use of this plugin, please also install the sister plugins:

pip install Label-Creator
pip install Layer-Data-Replace
pip install World2Data


It is important to note that this plugin is part of a group of plugins (Label-Creator, Layer-Data-Replace, World2Data) which are intended to be used together.

The principle workflow with this plugin is as follows:

  1. Load an image of interest (ioi) using standard napari.
  2. Find out meaningful transformation parameters for the ioi (or part of it) based on what you see in the viewer.
  3. (optional) Save the affine transformation matrix (can later be applied to other modalities)
  4. Apply the transformation to create a new, altered version of the ioi (use plugin World2Data)

Decisions on the parameters (step 2) are made based on the problem at hand:

  • Registration: You have a second (fixed) image and you want to align your ioi to that image? Transform your whole ioi! Just play with the transformation parameters until you are happy with the alignment of ioi and fixed image.

DAPI staining (red) before (left) and after (right) manual registration on an MRI image (green).

  • Histology artifact repair: Parts of your histology slice are misplaced? Transform the misplaced parts! Label them and change the transformation parameters for the misplaced parts until you are happy with their alignment with the rest of the image.

Original slice with misplaced region (left), marked using the label function (middle) and after manual adjustment (right), where the misplaced region (green) was cut and newly positioned.

To make this plugin run reasonably fast, the affine transformations are not applied to the image data in real time. Instead, the internal napari viewing parameters are changed according to the transformation parameters. Therefore, to save transformed image data, the World2Data plugin is used, which calculates and saves the resulting image based on the internal napari viewing parameters.

Here we showcase a resulting multimodal 3D alignment of a whole mouse brain. The modalities are CT, MRI, simulated radiation dose distributions, DAPI staining and DNA-damage repair foci, with a Nissl-staining mouse atlas as template.


Contributions are very welcome. Tests can be run with tox.


Distributed under the terms of the BSD-3 license, "Partial-Aligner" is free and open source software.


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


  • 0.0.1

Last updated:

  • 14 January 2022

First released:

  • 14 January 2022


Supported data:

  • Information not submitted

Plugin type:

GitHub activity:

  • Stars: 1
  • Forks: 0
  • Issues + PRs: 2

Python versions supported:

Operating system:


  • napari-plugin-engine (>=0.1.4)
  • numpy
  • packaging
  • dask