The manual image registration tool is available in the DataViewer app. The tool allows one to interactively align an image from a .dat file to a reference image. The geometric transformations are then applied to the misaligned .dat file.
Important
If you are using the umIToolbox app, click here to access the old manual aligment tool. This tool will be deprecated in a later version of the umIT toolbox.
Click on the Fine tuning button to show/hide the panel.
Here, one can set custom steps and move the misaligned frame incrementally by clicking on the up/down arrows. This is useful to perform small movements otherwise challenging with the mouse cursor.
Applies the coregistration to the misaligned .dat file.
A tform.mat file will also be saved in the .dat file's directory containing the geometric transformation affine2d object.
Important
This section is disabled for when the app is deployed as executable.
Saves the affine2d object with the geometric transformation to a .mat file.
Follow these steps for aligning data open in the DataViewer app.
Open the image to be aligned in DataViewer.
Then go to Utilities → Manual Coregistration to launch the tool. Note that a frame from the current data is set as the Misaligned file (in magenta)
Select the reference file/frame (in green). Here, one can use an image from Matlab's workspace or directly from a .dat file.
Once the reference and the misaligned images are loaded, the options panel becomes visible and one can use the mouse cursor to align the frame (in magenta). See the Options section for a description of the available options to help with the coregistration.
Tip
Use the fine tuning panel to perform small and precise adjustments to the coregistration. In the panel, select the movement, the step resolution and click on the up/down arrows to move the image.
Once the moving image (magenta) is placed in the optimal position, click on the Align button to apply to the misaligned data.
Important
This section does not apply to app deployed as executable.
This tool can also be used as a standalone in Matlab. In this mode, one can use either .dat files or images from Matlab's workspace. Here are the different ways of launching the app as standalone from Matlab command window:
Here is an example of a custom function that uses the manual image registration tool as standalone to generate the geometric transformation object (tform) and apply the coregistration to an image:
function [alignedImage, tform] = alignImage(fixImg,movImg) % This function calls the manualAlignFrames tool to manually coregister % the image "movImg" to the reference image "fixImg" and outputs the % registered image and the geometric transformation object. % Launch the tool: h = manualAlignFrames(fixImg,movImg); % Inside the app, align the movImg and save the geometric transformation % object to Matlab's base workpace to a variable named "tform" and close % the app. waitfor(h); % Copy the variable "tform" from the base workspace: tform = evalin('base','tform'); % Apply the geometric transformation to the misaligned image: alignedImage = imwarp(movImg,tform,'nearest','OutputView',imref2d(size(fixImg))); end