[ITK-users] Using PermuteAxesImageFilter to rotate/flip image frames

Bradley Lowekamp blowekamp at mail.nih.gov
Mon Sep 14 11:23:21 EDT 2015


Hello Marcus,

The PermuteAxesImageFilter does not do a rotation in the physical space. It changes the order of the axis in the memory, and updates the direction cosine matrix so that the physical location of each pixel is maintained. You should also look at the direction cosine of the output image.

If your view of the data does not take into consideration the direction cosine, it does not show how the image buffer should be visually interpreted.

This filter is available in 3D Slicer in the Simple Filters module. Slicer 3D viewer correctly visualizes the image in physical space. This filter is VERY boring in 3D Slicer because the output appear the same as the inputs. You must look at the meta-data to know that the image has changed.

HTH,
Brad



On Sep 14, 2015, at 10:39 AM, Marcos <fotosentido at gmail.com> wrote:

> Hi,
> 
> I'm playing with this filter to rotate an image with frames/slices.
> With inmediate viewing result on vtk widget.
> 
> My plan is 
> 
> 1) to rotate all frames 90º each time I push a button.
> 2) to flip all frames horizontal or vertical each time I push a button.
> 
> I'm playing with the values of the range:
> 
> typedef itk::PermuteAxesImageFilter <float, 3> PermuteAxesImageFilterType;
> itk::FixedArray<unsigned int, 3> order;
> order[0] = 1;
> order[1] = 0;
> order[2] = 2;
> 
> rotateFilter->SetOrder(order);
> rotateFilter->UpdateLargestPossibleRegion();
> 
> With (0,1,2) I get the same image. Ok. 
> If I use (1,0,2), I get all frames rotated 90º AND flipped.
> 
> Every frame has width != length, of course all frames have the same dimensions.
> 
> I thought that maintaining the third order value as the last one, it wouldn't affect.
> 
> Not sure if my idea is the correct.
> Please, I'd apreciate any help.
> Thank you.
> _____________________________________
> 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://public.kitware.com/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20150914/149073b5/attachment.html>


More information about the Insight-users mailing list