I have used this filter before, but I always wondered why you have to use a filter to change properties like orientation, origin and spacing, especially when there are methods for changing them in the image object itself. Can someone perhaps clear this up for me?<div>
<br></div><div>Thanks!<br><br><div class="gmail_quote">2009/9/24 Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi Shoosh,<br>
<br>
  This is not the correct way of modifying the orientation of an image.<br>
<br>
<br>
In general you should never attempt to change the content of an image<br>
that is the output of a filter or a reader.<br>
<br>
The correct way of changin the orientation of an image is to use the<br>
<br>
<br>
    itkChangeInformationFilter<br>
<br>
<a href="http://www.itk.org/Insight/Doxygen/html/classitk_1_1ChangeInformationImageFilter.html" target="_blank">http://www.itk.org/Insight/Doxygen/html/classitk_1_1ChangeInformationImageFilter.html</a><br>
<br>
Call on it<br>
<br>
   ChangeDirectionOn()<br>
<br>
and<br>
<br>
    SetOutputDirection( newdirection)<br>
<br>
<br>
<br>
   Regards,<br>
<br>
<br>
<br>
        Luis<br>
<br>
<br>
<br>
<br>
-----------------------<br>
shoosh moosh wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
How do I change the orientation of a 3D image.  This is the code segment I have but I get the following error:<br>
<br>
std::cout&lt;&lt; &quot;Direction is &quot; &lt;&lt; reader1-&gt;GetOutput()-&gt;GetDirection() &lt;&lt;std::endl ;<br>
reader1-&gt;GetOutput()-&gt;SetDirection(0, {1,0,0} );<br>
reader1-&gt;GetOutput()-&gt;SetDirection(1, {0,-1,0} );<br>
reader1-&gt;GetOutput()-&gt;SetDirection(2, {0,-1,0} );<br>
std::cout&lt;&lt; &quot;New direction is &quot; &lt;&lt; reader1-&gt;GetOutput()-&gt;GetDirection() &lt;&lt;std::endl ;<br>
<br>
<br>
[100%] Building CXX object CMakeFiles/rsf.dir/rsf.o<br>
/home/shoosh/Desktop/CSF/rsf/rsf.cxx: In function ‘int main(int, char**)’:<br>
/home/shoosh/Desktop/CSF/rsf/rsf.cxx:105: error: expected primary-expression before ‘{’ token<br>
/home/shoosh/Desktop/CSF/rsf/rsf.cxx:106: error: expected primary-expression before ‘{’ token<br>
/home/shoosh/Desktop/CSF/rsf/rsf.cxx:107: error: expected primary-expression before ‘{’ token<br>
make[2]: *** [CMakeFiles/rsf.dir/rsf. o] Error 1<br>
make[1]: *** [CMakeFiles/rsf.dir/all] Error 2<br>
make: *** [all] Error 2<br>
<br>
<br>
------------------------------------------------------------------------<br></div></div>
See all the ways you can stay connected to friends and family &lt;<a href="http://www.microsoft.com/windows/windowslive/default.aspx" target="_blank">http://www.microsoft.com/windows/windowslive/default.aspx</a>&gt;<br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Patrik Brynolfsson<br><br><br>
</div>