Skip to main content

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

Project description

Partial-Aligner

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.


Installation

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

Usage

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.

https://user-images.githubusercontent.com/36212786/149530462-51a53631-bf74-459b-ab4e-572c52cf2692.mov

Contributing

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

License

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

Issues

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Partial-Aligner-0.0.1.tar.gz (14.7 kB view hashes)

Uploaded Source

Built Distribution

Partial_Aligner-0.0.1-py3-none-any.whl (10.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page