<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
It took me a day to figure out:<BR> <BR>// first convert from display to world in the resliced coordinate<BR><FONT size=2>vtkRenderer& rndr = *interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer();<BR>rndr.SetDisplayPoint(currPos[0], currPos[1], 0);<BR>rndr.DisplayToWorld();<BR></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>double</FONT></FONT><FONT size=2> point[4];<BR>rndr.GetWorldPoint(point);<BR></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// the value in the third component is fake, why???<BR></FONT></FONT><FONT size=2>point[2] = 0.0;<BR> <BR>// next, convert back to the original vtkImageData coordinate system<BR>vtkImageReslice* reslice = ImageReslice;<BR>reslice->GetOutput()->UpdateInformation();<BR>vtkImageData& slice = *reslice->GetOutput();<BR>vtkMatrix4x4 *matrix = reslice->GetResliceAxes();<BR></FONT><FONT size=2></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>double</FONT></FONT><FONT size=2> center[4];<BR>matrix->MultiplyPoint(point, center);<BR></FONT><BR> <BR>Hope this works!<BR><BR>Xiaofeng Zhao<BR><BR><BR> <BR>> Date: Wed, 24 Mar 2010 16:09:57 -0400<BR>> From: tutmann@gmail.com<BR>> To: vtkusers@vtk.org<BR>> Subject: [vtkusers] 3D-position of vtkImageReslice<BR>> <BR>> Hello,<BR>> <BR>> I'm building an application based on ImageProcessing/Cxx/ImageSlicing.cxx.<BR>> Currently I'm on my way of writing my own interactor style in order to<BR>> have more flexible interaction freedom.<BR>> <BR>> Rotation, windowing and zoom works fine - but now I want to move my<BR>> Volume by dragging the mouse. The movement should be in sync with the<BR>> mouse motion.<BR>> Therefore I'd like to find out the real 3D-Position (in the volume) of<BR>> the EventPosition and the LastEventPosition.<BR>> But I don't know how to do that. The Display chain is like:<BR>> <BR>> vtkImageData -> vtkImageReslice -> vtkImageMapToColors -><BR>> vtkImageActor -> vtkRenderer -> vtkViewPort<BR>> <BR>> <BR>> How can I find out the amount of translation that has to be applied to<BR>> the ResliceAxes-Matrix? (I already have the right direction - am just<BR>> missing the scaling value of the translation).<BR>> <BR>> <BR>> Thank you for your help!<BR>> <BR>> Henning<BR>> _______________________________________________<BR>> Powered by www.kitware.com<BR>> <BR>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<BR>> <BR>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>> <BR>> Follow this link to subscribe/unsubscribe:<BR>> http://www.vtk.org/mailman/listinfo/vtkusers<BR>                                            <br /><hr />Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. <a href='http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_2' target='_new'>Sign up now.</a></body>
</html>