<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
What do you mean by "scale of transformation"?<br><br>Xiaofeng Zhao<br>
<a href="http://www.xzing.org"></a><br><br><br><br>&gt; Date: Mon, 28 Jun 2010 18:06:10 -0400<br>&gt; Subject: Re: [vtkusers] 3D-position of vtkImageReslice<br>&gt; From: tutmann@gmail.com<br>&gt; To: xf10036@hotmail.com<br>&gt; CC: vtkusers@vtk.org<br>&gt; <br>&gt; yes, I did it. strange - still z-off coordinates.<br>&gt; <br>&gt; 2010/6/28 Xiaofeng Z &lt;xf10036@hotmail.com&gt;:<br>&gt; &gt; have you tried to set:<br>&gt; &gt;<br>&gt; &gt; reslice-&gt;SetOutputDimensionality(2);<br>&gt; &gt;<br>&gt; &gt; This will&nbsp;cause the z-component of the resliced&nbsp;image position to zero.<br>&gt; &gt;<br>&gt; &gt; Xiaofeng Zhao<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;&gt; Date: Mon, 28 Jun 2010 15:46:48 -0400<br>&gt; &gt;&gt; Subject: Re: [vtkusers] 3D-position of vtkImageReslice<br>&gt; &gt;&gt; From: tutmann@gmail.com<br>&gt; &gt;&gt; To: xf10036@hotmail.com<br>&gt; &gt;&gt; CC: vtkusers@vtk.org<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Hi Xiaofeng,<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; it's me again with the 3D-Position issue in a vtkImageReslice.<br>&gt; &gt;&gt; It seems to work great for relative positions like interactions for<br>&gt; &gt;&gt; translations and stuff.<br>&gt; &gt;&gt; But when I use it to paint directly into an image, I find, that the<br>&gt; &gt;&gt; reported position is off in the direction of the viewer. The offset<br>&gt; &gt;&gt; depends on the scale of the transform.<br>&gt; &gt;&gt; So for my scale-settings a hack like this works somehow:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; point[2] = 0.38; // Hack<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; But this cannot possibly the solution. Do you have any idea how to<br>&gt; &gt;&gt; correct for this?<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Thank you,<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Henning<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; 2010/3/25 Xiaofeng Z &lt;xf10036@hotmail.com&gt;:<br>&gt; &gt;&gt; &gt; It took me a day to figure out:<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; // first convert from display to world in the resliced coordinate<br>&gt; &gt;&gt; &gt; vtkRenderer&amp; rndr =<br>&gt; &gt;&gt; &gt; *interactor-&gt;GetRenderWindow()-&gt;GetRenderers()-&gt;GetFirstRenderer();<br>&gt; &gt;&gt; &gt; rndr.SetDisplayPoint(currPos[0], currPos[1], 0);<br>&gt; &gt;&gt; &gt; rndr.DisplayToWorld();<br>&gt; &gt;&gt; &gt; double point[4];<br>&gt; &gt;&gt; &gt; rndr.GetWorldPoint(point);<br>&gt; &gt;&gt; &gt; // the value in the third component is fake, why???<br>&gt; &gt;&gt; &gt; point[2] = 0.0;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; // next, convert back to the original vtkImageData coordinate system<br>&gt; &gt;&gt; &gt; vtkImageReslice* reslice = ImageReslice;<br>&gt; &gt;&gt; &gt; reslice-&gt;GetOutput()-&gt;UpdateInformation();<br>&gt; &gt;&gt; &gt; vtkImageData&amp; slice = *reslice-&gt;GetOutput();<br>&gt; &gt;&gt; &gt; vtkMatrix4x4 *matrix = reslice-&gt;GetResliceAxes();<br>&gt; &gt;&gt; &gt; double center[4];<br>&gt; &gt;&gt; &gt; matrix-&gt;MultiplyPoint(point, center);<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Hope this works!<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Xiaofeng Zhao<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&gt; Date: Wed, 24 Mar 2010 16:09:57 -0400<br>&gt; &gt;&gt; &gt;&gt; From: tutmann@gmail.com<br>&gt; &gt;&gt; &gt;&gt; To: vtkusers@vtk.org<br>&gt; &gt;&gt; &gt;&gt; Subject: [vtkusers] 3D-position of vtkImageReslice<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Hello,<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; I'm building an application based on<br>&gt; &gt;&gt; &gt;&gt; ImageProcessing/Cxx/ImageSlicing.cxx.<br>&gt; &gt;&gt; &gt;&gt; Currently I'm on my way of writing my own interactor style in order to<br>&gt; &gt;&gt; &gt;&gt; have more flexible interaction freedom.<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Rotation, windowing and zoom works fine - but now I want to move my<br>&gt; &gt;&gt; &gt;&gt; Volume by dragging the mouse. The movement should be in sync with the<br>&gt; &gt;&gt; &gt;&gt; mouse motion.<br>&gt; &gt;&gt; &gt;&gt; Therefore I'd like to find out the real 3D-Position (in the volume) of<br>&gt; &gt;&gt; &gt;&gt; the EventPosition and the LastEventPosition.<br>&gt; &gt;&gt; &gt;&gt; But I don't know how to do that. The Display chain is like:<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; vtkImageData -&gt; vtkImageReslice -&gt; vtkImageMapToColors -&gt;<br>&gt; &gt;&gt; &gt;&gt; vtkImageActor -&gt; vtkRenderer -&gt; vtkViewPort<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; How can I find out the amount of translation that has to be applied to<br>&gt; &gt;&gt; &gt;&gt; the ResliceAxes-Matrix? (I already have the right direction - am just<br>&gt; &gt;&gt; &gt;&gt; missing the scaling value of the translation).<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Thank you for your help!<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Henning<br>&gt; &gt;&gt; &gt;&gt; _______________________________________________<br>&gt; &gt;&gt; &gt;&gt; Powered by www.kitware.com<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Visit other Kitware open-source projects at<br>&gt; &gt;&gt; &gt;&gt; http://www.kitware.com/opensource/opensource.html<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>&gt; &gt;&gt; &gt;&gt; http://www.vtk.org/Wiki/VTK_FAQ<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Follow this link to subscribe/unsubscribe:<br>&gt; &gt;&gt; &gt;&gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; ________________________________<br>&gt; &gt;&gt; &gt; Hotmail is redefining busy with tools for the New Busy. Get more from<br>&gt; &gt;&gt; &gt; your<br>&gt; &gt;&gt; &gt; inbox. Sign up now.<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; Hotmail is redefining busy with tools for the New Busy. Get more from your<br>&gt; &gt; inbox. See how.<br>                                               <br /><hr />Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. <a href='http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1' target='_new'>Learn more.</a></body>
</html>