<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
have you tried to set:<BR>
<BR><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
reslice->SetOutputDimensionality(2);<BR>
<BR>
This will cause the z-component of the resliced image position to zero.</FONT></FONT><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 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 your<BR>> > inbox. Sign up now.<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=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2' target='_new'>See how.</a></body>
</html>