[ITK-users] Image Translate with Wrapping Around

Ricky Singla rsingla92 at gmail.com
Wed May 7 18:36:29 EDT 2014


Hi there!

I am trying to perform a variation of an image translation, but am not
quite sure how to go about it using ITK filters. As I understand it, in a
typical image translation, if you move the image more than the image bounds
you end up losing pixel data. The data (when translated) that exceeds the
bounds would be lost. I'm trying to have this data wrap-around. That is if
I moved a image vertically downwards, I'd like the lost data to appear at
the top.

>From what I saw, I don't think this falls under the category of translation
or rotation. Are there any existing filters that would do this?

Thanks!

For those familiar with MATLAB, an example of this would be along the lines
of:

m = 100;
n = 200;
img = zeroes(m,n);

% some work done on img

for dx = -5:5

for dy = -10:10

xRange = 1:m; % A vector where xRange[i] = i

yRange = 1:n; % A vector where yRange[i] = i

xRotated = xRange + dx -1;

yRotated = yRange + dy -1;

xRotated = mod(xRotated, m) + 1;
yRotated = mod(yRotated, n) + 1;

translatedImg = img(xRotated, yRotated); % image translation, with wrap
around.

%% Other work with translatedImg

end

end

Cheers,
Ricky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140507/67dc849a/attachment.html>


More information about the Insight-users mailing list