[ITK] [ITK-users] Image Translate with Wrapping Around

Davis Vigneault davis.vigneault at gmail.com
Wed May 7 20:20:29 EDT 2014


Ricky--

Does this filter do what you are looking for?

http://www.itk.org/Doxygen/html/classitk_1_1CyclicShiftImageFilter.html

Best,

--Davis

On May 7, 2014, at 6:36 PM, Ricky Singla <rsingla92 at gmail.com> wrote:

> 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
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140507/6338e741/attachment-0002.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list