imregister translation mode, suppress registration in second direction

5 views (last 30 days)
Hello,
is possilble to suppress second shift direction in imregister function during 'tranlastion' mode? I have some images with moving feature but only in one direction, for example x direction, and need to do registration only in this direction. Usually it works good but sometimes there is also unwanted registration in y direction. Thanks.

Accepted Answer

Matt J
Matt J on 10 May 2019
Edited: Matt J on 10 May 2019
One hack that I can think of (and I emphasize that it is only a hack) is to deliberately corrupt the images with bright horizontal line patterns and apply imregtform. That way, a strong gradient against shifts in the y-direction will be introduced into the registration cost function. I illustrate this in the example below where the true translation is [10,0.6], but with this technique the registration is forced to reach a translation estimate in which the y-component is greatly suppressed. It should work even better, however, in your case where the true translation really does have y=0.
%% Simulation
moving = dicomread('knee1.dcm');
fixed=imtranslate(moving,[10,0.6]);
[optimizer, metric] = imregconfig('monomodal');
%% Corrupt the images with bright horizontal lines
Mcorr=moving; Mcorr(1:2:end,:)=3000;
Fcorr=fixed; Fcorr(1:2:end,:)=3000;
tform0 = imregtform(moving, fixed,'translation',optimizer,metric);
tform = imregtform(Mcorr,Fcorr,'translation',optimizer,metric);
base_tform = tform0.T,
constrained_tform = tform.T
The results are
base_tform =
1.0000 0 0
0 1.0000 0
10.0000 0.6000 1.0000
constrained_tform =
1.0000 0 0
0 1.0000 0
9.9149 0.0033 1.0000
  4 Comments
Rene Riha
Rene Riha on 14 May 2019
What I can do is also just simply put tform.T(3,2)=0, use the imwarp_same function and y shift disappears completely.
Matt J
Matt J on 15 May 2019
You can do that and it might be adequate for you, but my suggested approach is much closer to actually limiting the tform model to a 1D translation.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!