Skip to content

Instantly share code, notes, and snippets.

@tferr
Last active February 26, 2026 16:36
Show Gist options
  • Select an option

  • Save tferr/2f4dbb7c52df154a6e14a1fecd1e785a to your computer and use it in GitHub Desktop.

Select an option

Save tferr/2f4dbb7c52df154a6e14a1fecd1e785a to your computer and use it in GitHub Desktop.

Manual Registration in SNT's BVV

Basics

Display Modes

Mode What gets rendered
Fused All active (checked) sources overlaid
Source Only the current (radio-selected) group

Groups Panel

When multiple images are loaded, each image's channels appear as a named group in the Groups panel. Two controls are available per group:

  • Radio button: selects the current group. In Source display mode, only the current group is rendered, allowing you to inspect each image in isolation. Switching radio buttons toggles between images
  • Checkbox: toggles group activity (visible/hidden). In Fused display mode, unchecking a group hides all its channels from the render. With both checkboxes checked, both images are overlaid simultaneously

Source Transforms Panel

The Source Transforms card provides controls for multi-image transform management:

Control Description
Save Transform Saves the current transform of a selected group to an XML file
Load Transform Loads a previously saved XML transform and applies it to a selected group
Export Transformed Image Applies the manual transform of a selected group to its image data and writes the resampled result to a 16-bit TIFF file. See Exporting the Registered Image

Registering Two Multi-Channel Images

1. Orient the view

Use the mouse to rotate the scene to a viewpoint where the misalignment is clearly visible. Use Fused mode (both groups checked) to overlay both images.

2. Select the moving source

In the Sources panel, click the radio button next to any channel of the moving image (Group 2) to make it the current source.

3. Enter manual transform mode

Press T to enter BVV's manual transform mode. A message appears in the viewer confirming the mode is active. In this mode:

  • Left-drag: rotates the current source
  • Right-drag / scroll: translates the current source
  • All other channels in Group 2 should follow automatically via Live Sync (Source Transforms panel)

4. Align the images

With Fused mode active and both groups checked, move the moving image until it overlaps the reference. Toggle between Fused and Source display modes to check alignment from both images' perspectives.

Press T again to exit manual transform mode and lock the current position. The transform will be applied to the other channels in the group.

5. Save the transform

Open the Source Transforms panel and click Save Transform. Select Group 2 (the moving image) when prompted and choose a save location. The transform is saved as an XML file:

6. Reload a saved transform (optional)

Click Load Transform in the Source Transforms panel, select the XML file, and the transform will be applied to the matching group.

7. Export the registered image (optional)

Export Transformed Image bakes the manual transform into pixel data by resampling the moving image onto a chosen target grid, producing a standard TIFF. The result is saved as a 16-bit TIFF.

A two-choice prompt appears:

Moving image (source with transform)

Select the group whose manual transform you want to apply. This is the image that was moved during registration (Group 2 in the two-image workflow above). Its current transform (the full composition of the calibration (pixel size) transform and the manual registration transform) is what gets baked into the output.

Reference image (defines output grid)

Select the group that defines the pixel grid of the output file: its dimensions, voxel size, and spatial extent. The moving image is resampled so that every output voxel corresponds to the equivalent world-space location in the reference.

Choosing the reference image (Group 1) as the target grid is the standard choice: the result is a new volume of the moving image in the same coordinate frame as the reference.

Choosing the moving image itself as the target grid resamples the transformed data back onto its own original grid. It is effectively a sanity check that produces a transformed copy at the moving image's native resolution.

Transform Shortcuts

Entering / Exiting T-mode

Key Action
T Enter manual transform mode for the current source/group
T again Commit transform and exit
Esc Abort (discard changes)

While in T-mode

Action Normal Fast (Shift) Slow (Ctrl)
Rotate left/right ← → (1°) Shift+← → (10°) Ctrl+← → (0.1°)
Translate in Z , / . or scroll Shift+scroll Ctrl+scroll
Drag rotate left-drag Shift+left-drag Ctrl+left-drag
Drag translate right-drag
Select rotation axis Shift + X, Y, Z
Zoom in/out ↑ ↓ or Ctrl+Shift+scroll Shift+↑↓ Ctrl+↑↓

Tips for Precision

  • 0.1° increments: use Ctrl+← →: the finest rotation step available
  • Lock rotation axis: press X, Y, or Z to constrain keyboard rotation to a world axis before nudging with arrow keys
  • Align to principal plane first: use the view alignment shortcuts (Shift+Z, Shift+X, Shift+Y) to snap to XY/XZ/ZY before entering T-mode — gives a clean, predictable starting orientation
  • Fine translation: hold Ctrl while right-dragging for slower, more controlled panning

Notes

  • Adjust render quality (Scene Controls → gear menu) to Low for faster interaction during alignment, then switch to High for final inspection.
  • The Reset view button in Scene Controls re-centers and re-fits the scene to the viewport at any time.
  • Transforms are applied as fixed source transforms: they move the image data in 3D space independently of the camera
  • When exporting registered images: When a single source serves as both moving and reference, a transformed copy of itself will be created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment