<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>> Date: Mon, 28 Jun 2010 18:06:10 -0400<br>> Subject: Re: [vtkusers] 3D-position of vtkImageReslice<br>> From: tutmann@gmail.com<br>> To: xf10036@hotmail.com<br>> CC: vtkusers@vtk.org<br>> <br>> yes, I did it. strange - still z-off coordinates.<br>> <br>> 2010/6/28 Xiaofeng Z <xf10036@hotmail.com>:<br>> > have you tried to set:<br>> ><br>> > reslice->SetOutputDimensionality(2);<br>> ><br>> > This will cause the z-component of the resliced image position to zero.<br>> ><br>> > Xiaofeng Zhao<br>> ><br>> ><br>> ><br>> ><br>> >> Date: Mon, 28 Jun 2010 15:46:48 -0400<br>> >> Subject: Re: [vtkusers] 3D-position of vtkImageReslice<br>> >> From: tutmann@gmail.com<br>> >> To: xf10036@hotmail.com<br>> >> CC: vtkusers@vtk.org<br>> >><br>> >> Hi Xiaofeng,<br>> >><br>> >> it's me again with the 3D-Position issue in a vtkImageReslice.<br>> >> It seems to work great for relative positions like interactions for<br>> >> translations and stuff.<br>> >> But when I use it to paint directly into an image, I find, that the<br>> >> reported position is off in the direction of the viewer. The offset<br>> >> depends on the scale of the transform.<br>> >> So for my scale-settings a hack like this works somehow:<br>> >><br>> >> point[2] = 0.38; // Hack<br>> >><br>> >> But this cannot possibly the solution. Do you have any idea how to<br>> >> correct for this?<br>> >><br>> >> Thank you,<br>> >><br>> >> Henning<br>> >><br>> >> 2010/3/25 Xiaofeng Z <xf10036@hotmail.com>:<br>> >> > It took me a day to figure out:<br>> >> ><br>> >> > // first convert from display to world in the resliced coordinate<br>> >> > vtkRenderer& rndr =<br>> >> > *interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer();<br>> >> > rndr.SetDisplayPoint(currPos[0], currPos[1], 0);<br>> >> > rndr.DisplayToWorld();<br>> >> > double point[4];<br>> >> > rndr.GetWorldPoint(point);<br>> >> > // the value in the third component is fake, why???<br>> >> > 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>> >> > double center[4];<br>> >> > matrix->MultiplyPoint(point, center);<br>> >> ><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<br>> >> >> 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<br>> >> >> http://www.kitware.com/opensource/opensource.html<br>> >> >><br>> >> >> Please keep messages on-topic and check the VTK FAQ at:<br>> >> >> 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>> >> > ________________________________<br>> >> > Hotmail is redefining busy with tools for the New Busy. Get more from<br>> >> > your<br>> >> > inbox. Sign up now.<br>> ><br>> > ________________________________<br>> > Hotmail is redefining busy with tools for the New Busy. Get more from your<br>> > 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>