<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hello Marcus,<div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>HTH,</div><div>Brad</div><div><br></div><div><br></div><div><br><div><div>On Sep 14, 2015, at 10:39 AM, Marcos <<a href="mailto:fotosentido@gmail.com">fotosentido@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Hi,<div><br></div><div>I'm playing with this filter to rotate an image with frames/slices.</div><div>With inmediate viewing result on vtk widget.</div><div><br></div><div>My plan is </div><div><br></div><div>1) to rotate all frames 90º each time I push a button.</div><div>2) to flip all frames horizontal or vertical each time I push a button.</div><div><br></div><div>I'm playing with the values of the range:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style="">::</span><span style="color:rgb(128,0,128)">PermuteAxesImageFilter</span><span style="color:rgb(192,192,192)"> </span><span style=""><</span><span style="color:rgb(128,0,128)">float, 3</span><span style="">></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">PermuteAxesImageFilterType</span><span style="">;</span></pre></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">itk</span><span style="">::</span><span style="color:rgb(128,0,128)">FixedArray</span><span style=""><</span><span style="color:rgb(128,128,0)">unsigned</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">int</span><span style="">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">3</span><span style="">></span><span style="color:rgb(192,192,192)"> </span><span style="">order</span><span style="">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="">order</span><span style="">[</span><span style="color:rgb(0,0,128)">0</span><span style="">]</span><span style="color:rgb(192,192,192)"> </span><span style="">=</span><span style="color:rgb(192,192,192)"> </span><font color="#000080">1</font><span style="">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="">order</span><span style="">[</span><span style="color:rgb(0,0,128)">1</span><span style="">]</span><span style="color:rgb(192,192,192)"> </span><span style="">=</span><span style="color:rgb(192,192,192)"> </span><font color="#000080">0</font><span style="">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="">order</span><span style="">[</span><span style="color:rgb(0,0,128)">2</span><span style="">]</span><span style="color:rgb(192,192,192)"> </span><span style="">=</span><span style="color:rgb(192,192,192)"> </span><font color="#000080">2</font><span style="">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">rotateFilter</span><span style="">-></span><span style="">SetOrder</span><span style="">(</span><span style="">order</span><span style="">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">rotateFilter</span><span style="">-></span><span style="font-style: italic;">UpdateLargestPossibleRegion</span><span style="">();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style=""><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><div style="font-family:arial,sans-serif;white-space:normal">With (0,1,2) I get the same image. Ok. </div><div style="font-family:arial,sans-serif;white-space:normal">If I use (1,0,2), I get all frames rotated 90º AND flipped.</div><div style="font-family:arial,sans-serif;white-space:normal"><br></div><div style="font-family:arial,sans-serif;white-space:normal">Every frame has width != length, of course all frames have the same dimensions.</div><div style="font-family:arial,sans-serif;white-space:normal"><br></div><div style="font-family:arial,sans-serif;white-space:normal">I thought that maintaining the third order value as the last one, it wouldn't affect.</div><div style="font-family:arial,sans-serif;white-space:normal"><br></div><div style="font-family:arial,sans-serif;white-space:normal">Not sure if my idea is the correct.</div><div style="font-family:arial,sans-serif;white-space:normal">Please, I'd apreciate any help.</div><div style="font-family:arial,sans-serif;white-space:normal">Thank you.</div></pre></div></div>
_____________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://public.kitware.com/mailman/listinfo/insight-users<br></blockquote></div><br></div></body></html>