Hi everyone,<br><br>I had posted yesterday about the rotation not being around the center of the data slice, even after calling vtkImageChangeInformation.<br><br><a href="http://public.kitware.com/pipermail/vtkusers/2006-September/087065.html">
http://public.kitware.com/pipermail/vtkusers/2006-September/087065.html</a><br><br>I figured out which call was causing that problem. However, I am still not sure how to fix it.<br><br>I was calling AutoCropOutputOn() on the reslicer but it does not like that when doing rotations it seems!!!
<br><br>So, when I remove this call, it rotates fine but some other things mess up now!!<br><br>Anyways, if someone wants to reproduce the problem and maybe help me in the process (shameless, I know), here is some code that will reproduce this:
<br><br>vtkImageChangeInformation * imageChangeInformation = vtkImageChangeInformation::New();<br>imageChangeInformation-&gt;SetInput(readerG-&gt;GetOutput());<br>imageChangeInformation-&gt;CenterImageOn();<br>imageChangeInformation-&gt;Update();
<br><br>vtkImageReslice * slicer = vtkImageReslice::New();<br>// TURNING THIS ON, will mess up rotations<br>//slicer-&gt;AutoCropOutputOn();<br>slicer-&gt;SetResliceAxesDirectionCosines(1, 0, 0, 0, 1, 0, 0, 0, 1);<br>slicer-&gt;SetOutputDimensionality(2);
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>vtkTransform * transform = vtkTransform::New();<br>slicer-&gt;SetResliceTransform(transform);<br><br>transform-&gt;RotateZ(30);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>slicer-&gt;SetInput(imageChangeInformation-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>double origin[3];<br>double spacing[3];<br>imageChangeInformation-&gt;GetOutput()-&gt;GetOrigin(origin);<br>imageChangeInformation-&gt;GetOutput()-&gt;GetSpacing(spacing);<br><br>slicer-&gt;SetResliceAxesOrigin(0, 0, origin[2] + 50 * spacing[2]);
<br><br>viewer-&gt;SetInput(slicer-&gt;GetOutput()); // this is a vtkImageViewer<br>viewer-&gt;Render();<br>