<html><body><div>Thanks David,<br></div><div><br data-mce-bogus="1"></div><div>That's what I was doing at first, and it seemed to have the same issues  :>/ </div><div><br data-mce-bogus="1"></div><div>But perhaps I did something incorrectly, and I will take another look at the first approach.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Rick<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br>On Oct 26, 2016, at 11:52 AM, David Gobbi <david.gobbi@gmail.com> wrote:<br><br><div><blockquote type="cite"><div class="msg-quote"><div dir="ltr">Hi Rick,<div><br></div><div>I cannot recommend using SetResliceAxesOrigin() to set the center of rotation.  Instead, it's best to build the 4x4 matrix that does the transformation that you need, and call SetResliceAxes(matrix).</div><div><br></div><div>For rotation around a point, you need a matrix that translates the center-of-rotation to (0,0,0), applies a rotation about (0,0,0), and then translates back again.</div><div><br></div><div> - David</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 10:30 AM, Richard Frank <span dir="ltr"><<a href="mailto:rickfrank@me.com" data-mce-href="mailto:rickfrank@me.com">rickfrank@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div><div>Hi</div><div><br></div><div>I'm trying to modify the vtkExample to use vtkImageReslice about a point not at the center of the volume.<br></div><div><br></div><div>A link to my code is below, which is the Cxx folder from the Imaging Examples, with modifications to the ImageSlicing sub project.<br></div><div><br></div><div><br></div><div><a href="https://1drv.ms/f/s!AvWAuQy-GUrmgyOyOKmDWSHhZUPk" rel="noreferrer" data-mce-href="https://1drv.ms/f/s!AvWAuQy-GUrmgyOyOKmDWSHhZUPk">https://1drv.ms/f/s!AvWAuQy-<wbr>GUrmgyOyOKmDWSHhZUPk</a><br data-mce-bogus="1"></div><div><br></div><div>Also, here is a link to my input data, a small mha file which is easy to see:<br></div><div><br></div><div><a href="https://1drv.ms/u/s!AvWAuQy-GUrmg0YOY0ql2vr1StOU" rel="noreferrer" data-mce-href="https://1drv.ms/u/s!AvWAuQy-GUrmg0YOY0ql2vr1StOU">https://1drv.ms/u/s!AvWAuQy-<wbr>GUrmg0YOY0ql2vr1StOU</a><br data-mce-bogus="1"></div><div><br></div><div>if you load the file, you will see an axial view. The volume has an origin of (0,0,0). I compute the center of the volume, and then position the actor on that center point (actors are positioned by the center point).</div><div><br></div><div>This is analogous to what our application under development does - we position the slice actor in world coordinates using the DICOM Image Position Patient at the top left (depending on orientation) + center offset of the volume.<br></div><div><br></div><div>In my example code, when you load up for the first time and left click, and "rotate" with the mouse, I draw an angle widget for your convenience whose joint is on the center of rotation. I compute the matrix for the rotation, and set that in the reslice matrix, followed by  the origin. This works perfectly, and the slice rotates about its center.<br></div><div><br></div><div>If you right click, you will change the ctr of rotation in world coordinates.</div><div>ImageReslice-><wbr>SetResliceAxesOrigin(<wbr>rotationCenter[0], rotationCenter[1], rotationCenter[2]);</div><div><br></div><div>When you then rotate with left mouse, the angle widget joint is in the correct place in the view but  the the image rotates about a point which I can't quite determine.<br></div><div><br></div><div>The new center of rotation that the reslice uses seem to be proportionally related to how far away from the center of the image that is right clicked on - the closer to the center of the slice clicked, the less the center of rotation moves away from the click.<br></div><div><br></div><div>It seems like there's something I'm missing about how the center of rotation works. <br></div><div><br></div><div>Any help appreciated.<br></div><div><br></div><div><br></div><div>Thanks<br></div><div><br></div><div>Rick<br></div><div><br></div><div><br></div></div></blockquote></div><br></div></div></blockquote></div></div></body></html>