Interactive registration
It is possible to manually transform a neuroglancer layer using ngtools.
Interactive shifts
The active layer can be transformed using predefined key presses. We define the following shortcuts:
| Key | Action name | Description |
|---|---|---|
| Ctrl+I | rotate-layer-x+ |
Rotate about the x axis, clockwise |
| Ctrl+J | rotate-layer-y+ |
Rotate about the y axis, clockwise |
| Ctrl+K | rotate-layer-z+ |
Rotate about the z axis, clockwise |
| Ctrl+Alt+I | rotate-layer-x- |
Rotate about the x axis, anticlockwise |
| Ctrl+Alt+J | rotate-layer-y- |
Rotate about the y axis, anticlockwise |
| Ctrl+Alt+K | rotate-layer-z- |
Rotate about the z axis, anticlockwise |
| I | translate-layer-x+ |
Translate along the x axis, positively |
| J | translate-layer-y+ |
Translate along the y axis, positively |
| K | translate-layer-z+ |
Translate along the z axis, positively |
| I | translate-layer-x- |
Translate along the x axis, negatively |
| J | translate-layer-y- |
Translate along the y axis, negatively |
| K | translate-layer-z- |
Translate along the z axis, negatively |
| Ctrl+Shift+I | zoom-layer-x+ |
Zoom along the x axis |
| Ctrl+Shift+J | zoom-layer-y+ |
Zoom along the y axis |
| Ctrl+Shift+K | zoom-layer-z+ |
Zoom along the z axis |
| Ctrl+Shift+L | zoom-layer-all+ |
Zoom along all axes |
| Alt+Shift+I | zoom-layer-x- |
Unzoom along the x axis |
| Alt+Shift+J | zoom-layer-y- |
Unzoom along the y axis |
| Alt+Shift+K | zoom-layer-z- |
Unzoom along the z axis |
| Alt+Shift+L | zoom-layer-all- |
Unzoom along all axes |
As soon as one of these actions is triggered, three sliders are defined in the shader of the active layer. These sliders allow the scale of each type of action (translation, rotation or zoom) to be tuned. These sliders are defined via
#uicontrol float translation_scale slider(min=-5, max=5, default=0, step=0.01)
#uicontrol float rotation_scale slider(min=0, max=90, default=1, step=0.1)
#uicontrol float zoom_scale slider(min=-5, max=5, default=0, step=0.01)
and look like this:

- The rotation slider defines the number of degrees applied by one key press.
- Translation are expressed in terms of "model space units", which are
usually defined by the output dimensions of the topmost layer. These units
are scaled by
2 ** translation_scale. Therefore, whentranslation_scale == 0, each key press applies a translation of one model unit; whentranslation_scale == 1, each key press applies a translation of two model units; and whentranslation_scale == -1, each key press applies a translation half a model unit. - The zoom slider defines the numbers of powers of two (or one over two)
applied by each zoom or unzzom key press. When
zoom_scale == 0, each key press zooms by a factor2(or unzoom by a factor 0.5); whenzoom_scale == 1, each key press zooms by a factor4; and whenzoom_scale == -1, each key press zooms by a factorsqrt(2).
Cursor-based translation
The shortcut Ctrl+T applies a translation that brings the location
pointed by the mouse cursor to the location of the crosshair.
This action is named translate-layer-mouse-to-crosshair.
Landmark-based registration
It is also possible to apply a translation, rigid body transformation, similtude or affine transform that minimizes the distance between two (paired) point clouds. The point clouds can be defined (or reset) using the following shortcuts:
| Key | Action name | Description |
|---|---|---|
| Ctrl+M | add-moving-landmark |
Add a landmark attached to the moving image |
| Ctrl+F | add-fixed-landmark |
Add a landmark attached to the fixed image |
| Alt+M | pop-moving-landmark |
Remove the last moving landmark |
| Alt+F | pop-fixed-landmark |
Remove the last fixed landmark |
These actions automatically create two annotation layers named
::landmarks::fixed and ::landmarks::moving. These layers can be
deleted after use, or if one wishes to clear existing landmarks.
Warning
The correspondence between the fixed and moving landmarks is defined by the order in which they are defined.
Once the two pointclouds are defined, a transformation can be fitted and applied using any of these shortcuts:
| Key | Action name | Description |
|---|---|---|
| Alt+T | translate-layer-landmarks |
Fit and apply a translation |
| Alt+R | rigid-transform-layer-landmarks |
Fit and apply a rigid body transform |
| Alt+S | similitude-transform-layer-landmarks |
Fit and apply a similitude |
| Alt+A | affine-transform-layer-landmarks |
Fit and apply an affine transform |
The moving point cloud also gets transformed, and can then be augmented with additional landmarks and re-used.