3D image registration in Dragonfly with Elastix
Align two CT volumes in Dragonfly, choose rigid or deformable registration, and review the result before publishing an aligned image or warped segmentation.
Volume registration maps a moving image onto a fixed reference. The Prototype Apps Elastix panel connects Dragonfly Channels to the elastix toolkit and lets you review a transform before publishing its result. It supports translation, rigid, affine and B-spline transforms, including chained stages.
Choose a transform for your question
Start with rigid registration when you need to remove a specimen's overall translation and rotation. Examples include repeat CT scans or preparing reference and loaded scans for digital volume correlation (DVC).
Use local deformation only when it belongs to the analysis goal, such as mapping an atlas or transferring a segmentation between changing shapes. Do not apply deformable registration before measuring deformation with DVC: it can remove the displacement you want to measure.
Prepare the inputs
Load and publish the fixed and moving Channels. Check their voxel spacing and calibration, and choose mask ROIs if background should be excluded. Elastix uses physical millimetres and supports anisotropic spacing. The two images do not have to have identical dimensions.
Enable Volume Registration (Elastix) in Prototype Apps and restart Dragonfly if you have just installed it. On first use, set up its isolated numpy + itk-elastix environment from the Setup step. Registration reads the full volumes into memory, so begin with a crop when working with large scans.
Run and inspect the registration
- Select the fixed reference, moving Channel, timestep and optional masks in Input & Masks.
- Start with the rigid transform chain. Choose the image metric: Mattes mutual information for different modalities, SSD for comparable intensities, or NCC for a linear intensity relationship.
- Review the proposed run in Preview & Run. Select an ROI or MultiROI to warp only if you need to transfer that segmentation, then run registration.
- Review the reported stages, RMS comparison where available and alignment in the images. For local deformation, the rigid + B-spline chain adds a deformation stage; its grid spacing controls the spatial scale.
- Use Apply & Export to publish the registered Channel or warped labels. Publishing is a separate action; the fitted transform files remain in the job folder.
Understand the result and its limits
RMS is an intensity-difference measure, not a direct measurement of geometric registration error. Check corresponding structures in multiple slices, especially when modalities differ. The panel reports an unavailable comparison when image shapes prevent a before/after RMS calculation.
The plugin uses nearest-neighbour interpolation for warped ROI and MultiROI labels. A smaller B-spline grid can fit finer changes but may overfit. Keep the transform and parameter record so that the output can be traced to its inputs.