Affine (block matching)
Apply slice-by-slice (2D) affine-based image registration to a multi-dimensional stack.
Description
Apply slice-by-slice (2D) affine-based image registration to a multi-dimensional stack. Images can be aligned relative to the first frame in the stack, the previous frame or a separate image in the workspace. The registration transform can also be calculated from a separate stack to the one that it will be applied to. Registration can be performed along either the time or Z axes. The non-registered axis (e.g. time axis when registering in Z) can be "linked" (all frames given the same registration) or "independent" (each stack registered separately).
This module uses the Block Matching plugin and associated MPICBG tools to detect matching regions from the input images and calculate and apply the necessary 2D affine transforms.
Parameters
Parameter | Description |
---|---|
Input image | Image from workspace to apply registration to. |
Apply to input image | When selected, the post-operation image will overwrite the input image in the workspace. Otherwise, the image will be saved to the workspace with the name specified by the "Output image" parameter. |
Output image | If "Apply to input image" is not selected, the post-operation image will be saved to the workspace with this name. |
Registration axis | Controls which stack axis the registration will be applied in. For example, when "Time" is selected, all images along the time axis will be aligned. Choices are: Time, Z. |
Other axis mode | For stacks with non-registration axis lengths longer than 1 (e.g. the "Z" axis when registering in time) the behaviour of this other axis is controlled by this parameter:
|
Fill mode | Controls what intensity any border pixels will have. "Borders" in this case correspond to strips/wedges at the image edge corresponding to regions outside the initial image (e.g. the right-side of an output image when the input was translated to the left). Choices are: Black, White. |
Show detected points | When enabled, the points used for calculation of the registration will be added as an overlay to the input image and displayed. |
Enable multithreading | When selected, certain parts of the registration process will be run on multiple threads of the CPU. This can provide a speed improvement when working on a computer with a multi-core CPU. |
Reference mode | Controls what reference image each image will be compared to:
|
Number of previous frames | Number of previous frames (or slices) to use as reference image when "Reference mode" is set to "Previous N frames". If there are insufficient previous frames (e.g. towards the beginning of the stack) the maximum available frames will be used. Irrespective of the number of frames used, the images will be projected into a single reference image using the statistic specified by "Previous frames statistic". |
Previous frames statistic | Statistic to use when combining multiple previous frames as a reference ("Reference mode" set to "Previous N frames"). |
Reference image | If "Reference mode" is set to "Specific image" mode, all input images will be registered relative to this image. This image must only have a single channel, slice and timepoint. |
Calculation source | Controls whether the input image will be used to calculate the registration transform or whether it will be determined from a separate image:
|
External source | If "Calculation source" is set to "External", registration transforms will be calculated using this image from the workspace. This image will be unaffected by the process. |
Calculation channel | If calculating the registration transform from a multi-channel image stack, the transform will be determined from this channel only. Irrespectively, for multi-channel image stacks, the calculated transform will be applied equally to all channels. |
Transformation mode | Controls the type of registration being applied:
|
Test flip (mirror image) | When selected, alignment will be tested for both the "normal" and "flipped" (mirror) states of the image. The state yielding the lower cost to alignment will be retained. |
Independent rotation | When selected, the image will be rotated multiple times, with registration optimised at each orientation. The orientation with the best score will be retained. This is useful for algorithms which perform poorly with rotated features (e.g. block matching). The increment between rotations is controlled by "Orientation increment (degs)". |
Orientation increment (degs) | If "Independent rotation" is enabled, this is the angular increment between rotations. The increment is specified in degree units. |
Show transformation(s) | When selected, the affine transform will be displayed in the results table. Fixed affine transform values such as these can be applied using the "Affine (fixed transform)" module. |
Clear between images | If "Show transformation(s)" is enabled, this parameter can be used to reset the displayed affine transform in the results table. If this option isn't selected, the new transform will be added to the bottom of the results table. |
Layer scale | Scale factor applied to input image prior to alignment of blocks. This can be used to reduce the computational cost of performing the registration. For example, a scale of 0.5 will reduce the size of the image used in the alignment process. Note: The final registration will be applied to the original size images. |
Search radius (px) | The maximum range a single block can move from its original position whilst searching for the highest quality alignment. |
Block radius (px) | Size of the individual blocks that will be used in searching for the highest quality alignment. These need to be sufficiently large to include recognisable features in a single block. |
Resolution | The number of vertices in the spring mesh, with higher numbers giving smoother results. |
Minimal PMCC r | "The PMCC coefficent r of a patch around the vertex and the overlapping patch in the other image is used as the quality measure for a match. The threshold for minimal PMCC r can be higher for aligning the same signal than for aligning changing signals. Higher values will lead to more matches rejected and thus less false positives.". Description taken from https://imagej.net/Elastic_Alignment_and_Montage.html |
Maximal curvature ratio | "The maximal curvature ratio is the threshold for edge responses. The value must be >1.0. Higher values will accept more matches alongside elongated structures and thus lead to potentially more false positives.". Description taken from https://imagej.net/Elastic_Alignment_and_Montage.html |
Closest/next closest ratio | "Correspondence candidates from local descriptor matching are accepted only if the Euclidean distance to the nearest neighbour is significantly smaller than that to the next nearest neighbour. Lowe (2004) suggests a ratio of r=0.8 which requires some increase when matching things that appear significantly distorted.". Description taken from https://imagej.net/Feature_Extraction |
Local region sigma | "The local smoothness filter inspects each match and compares how well the estimated translational offset agrees with all other matches weighted by their distance to the inspected match. To that end, a local linear transformation (typically rigid) is calculated using weighted least squares. The weight for each match is defined by a Gaussian radial distribution function (RDF) centered at the reference match. This parameter controls sigma for this RDF. A match is rejected if its transfer error relative to the estimated linear transformation is larger than an absolute threshold or larger than k× the average transfer error of all weighted matches (k is specified in the relative field). "Description taken from https://imagej.net/Elastic_Alignment_and_Montage.html |
Maximal absolute local displacement (px) | See description for "Local region sigma". |
Maximal relative local displacement (px) | See description for "Local region sigma". |