A plugin to obtain parameters for affine transform used to register two views of the same object, e.g as obtained with dual-view microscopes.
napari-manual-registration
is a napari plugin that is part of the Tapenade project. Tapenade is a tool for the analysis of dense 3D tissues acquired with deep imaging microscopy. It is designed to be user-friendly and to provide a comprehensive analysis of the data.
If you use this plugin for your research, please cite us.
A. Registration by annotating salient landmarks | B. Registration by selecting explicit transformation parameters |
---|---|
While working with large and dense 3D and 3D+time gastruloid datasets, we found that being able to visualise and interact with the data dynamically greatly helped processing it. During the pre-processing stage, dynamical exploration and interaction led to faster tuning of the parameters by allowing direct visual feedback, and gave key biophysical insight during the analysis stage.
When using our automatic registration tool to spatially register two views of the same organoid, we were sometimes faced with the issue that the tool would not converge to the true registration transformation. This happens when the initial position and orientation of the floating view are too far from their target values. We thus designed a Napari plugin to quickly find a transformation that can be used to initialize our registration tool close to the optimal transformation. From two images loaded in Napari representing two views of the same organoid, the plugin allows the user to
annotate matching salient landmarks (e.g bright dead cells or lumen-like structures) in both the reference and floating views, from which an optimal rigid transformation can be found automatically using principal component analysis.
manually define a rigid transformation by continually varying 3D rotations and translations while observing the results until a satisfying fit is found
The plugin obviously requires napari to run. If you don't have it yet, follow the instructions here.
The simplest way to install napari-manual-registration
is via the napari plugin manager. Open Napari, go to Plugins > Install/Uninstall Packages...
and search for napari-manual-registration
. Click on the install button and you are ready to go!
You can also install napari-manual-registration
via pip:
pip install napari-manual-registration
To install latest development version :
pip install git+https://github.com/jules-vanaret/napari-manual-registration.git
The plugin provides two methods to register two views of the same object. The first method consists in manually drawing landmarks in both views, from which the optimal transformation is found automatically using principal component analysis. The second one consists in selecting manually each transformation parameter (rotation and translation) while observing the result in real-time, either in 2D or 3D (the user can switch between 2D and 3D at any time).
[!CAUTION] Be aware that the visualization does not accomodate for voxel anisotropy, so we recommend using isotropic data, or to resize you anisotropic data to an isotropic voxel size (e.g by using napari-tapenade-processing).
Steps:
File > Open files...
menu.Plugins > Manual Registration
menu to open the plugin.Create landmarks layers
button to create two new Labels layers that will be used to annotate the landmarks in the reference and floating views.Format layers for landmarks matching
button so that your layers are automatically formatted for you to begin the registration process. Napari offers a wide range of customisation options for the layers appearances, so feel free to play with them if our formatting does not fit your preferences. ;)landmarks_floating
layer in the layer list to select it. Activate the paint brush
button in the layer properties widget. This will allow you to draw landmarks in the floating view.Brush size
slider in the layer properties widget. The shape of the "blob" you draw does not matter, as the plugin currently only uses the center of mass of the "blob" to locate the landmark.+
button in the layer properties widget to increase the label value. This will allow you to draw another landmark. Change label value after each landmark you draw. Repeat steps 10 to 12 until you have annotated all the salient landmarks in the floating view.landmarks_reference
layer in the layer list to select it.+
button in the layer properties widget each time you draw a new widget. Repeat steps 15 to 17 until you have annotated all the salient landmarks in the reference view.Run landmark registration
button. The plugin will automatically find the optimal transformation that aligns the floating landmarks to the reference landmarks using principal component analysis. Choose directory
button. The transformation parameters will be saved in a .json
file in this directory. Finally, click on the Save to JSON
button to save the transformation parameters.We describe below the steps to register two views of the same object in a purely 3D manner. Note that the plugin also allows to switch between 2D and 3D at any time, and 2D view is described in the next section.
Steps:
File > Open files...
menu.Plugins > Manual Registration
menu to open the plugin.Format layers for explicit registration
button so that your layers are automatically formatted for you to begin the registration process. Napari offers a wide range of customisation options for the layers appearances, so feel free to play with them if our formatting does not fit your preferences. ;)Translations
and Rotations
sliders. The floating layer will be transformed in real-time according to the selected parameters. Choose directory
button. The transformation parameters will be saved in a .json
file in this directory.Save to JSON
button to save the transformation parameters.Steps (the steps 1 to 5 are the same as for the 3D registration):
Toggle 2D/3D view
button (it resembles a square when in 2D mode, or a cube when in 3D mode).Translations
and Rotations
sliders. The floating layer will be transformed in real-time according to the selected parameters.Choose directory
button. The transformation parameters will be saved in a .json
file in this directory. Finally, click on the Save to JSON
button to save the transformation parameters.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.
Distributed under the terms of the BSD-3 license, "napari-manual-registration" is free and open source software
If you encounter any problem using this plugin, please file an issue on the GitHub repository.
This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.