Hi there,<br><br>I think I can do it with vtkImageReslice.<br><br>However, I am having problem trying to understand what the SetResliceAxesDirectionCosines does. In particular, what should the matrix look like if we set the slice orientation to say XZ or YZ.
<br><br>I would be grateful if someone could explain what the matrix would look like for these simple orientations.<br><br>Thanks,<br><br>Anja<br><br><br><div><span class="gmail_quote">On 18/08/06, <b class="gmail_sendername">
Anja Ende</b> &lt;<a href="mailto:anja.ende@googlemail.com">anja.ende@googlemail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi everyone,<br>
<br>
vtkImageViewer2 allows the user to set the slice orientation to XY, XZ
and YZ planes. I am trying to implement the same functionality in
vtkImageViewer.<br>
<br>
I call the SetExtent function on the input image data but it does not
seem to have any effect in the displayed slice. It always displays the
slice in the XY plane regardless of the extent values.<br>
<br>
So, I have something like:<br>
<br>
vtkImageData *input = this-&gt;GetInput();<br>
<br>
if (!input || !this-&gt;ImageMapper)<br>
{<br>
&nbsp;&nbsp; &nbsp;return;<br>
}<br>
<br>
input-&gt;UpdateInformation();<br>
int *w_ext = input-&gt;GetWholeExtent();<br>
<br>
// Is the slice in range ? If not, fix it<br>
int slice_min = w_ext[this-&gt;m_sliceOrientation * 2];<br>
int slice_max = w_ext[this-&gt;m_sliceOrientation * 2 + 1];<br>
<br>
if (this-&gt;m_slice &lt; slice_min || this-&gt;m_slice &gt; slice_max)<br>
{<br>
&nbsp;&nbsp; &nbsp;this-&gt;m_slice = static_cast&lt;int&gt;((slice_min + slice_max) * 0.5);<br>
}<br>
<br>
// Set the image actor<br>
switch (this-&gt;m_sliceOrientation)<br>
{<br>
&nbsp;&nbsp; &nbsp;case MyViewer::SliceOrientation_XY:<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;input-&gt;SetExtent(<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;w_ext[0], w_ext[1], w_ext[2], w_ext[3], this-&gt;m_slice, this-&gt;m_slice);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;break;<br>
<br>
&nbsp;&nbsp; &nbsp;case MyViewer::SliceOrientation_XZ:<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;input-&gt;SetExtent(<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;w_ext[0], w_ext[1], this-&gt;m_slice, this-&gt;m_slice, w_ext[4], w_ext[5]);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;break;<br>
<br>
&nbsp;&nbsp; &nbsp;case MyViewer::SliceOrientation_YZ:<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;input-&gt;SetExtent(<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;this-&gt;m_slice, this-&gt;m_slice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;break;<br>
}<br>
<br>
However, it always renders the first slice in the XY plane. Any ideas on how to fix this?<br>
<br>
Thanks,<br>
<br>
Anna

</div></blockquote></div><br>