Hi everyone,<br><br>I am having problems transforming a point using vtkTransform object.<br><br>My setup is as follows:<br><br>I have 3 orthogonal views in the XY, YZ and XZ planes. I am using 3 vtkImageReslice objects to generate these slices.
<br><br>Now, I have oblique slicing working which is basically vtkTransform object with translation and rotation parameters.<br><br>Now, what I am trying to do is update the views based on selection on one of the other views.
<br><br>Say, someone selected a point (x, y, z) on one of the views... I want to update the other views so that selected point is visible.<br><br>I have tried various approaches:<br><br>The first was to use the TranformPoint function in the vtkTransform and get the corresponding point in the view...
<br><br>myX = origin[0] + spacing[0] * x;<br>myY = origin[1] + spacing[1] * y;<br>myZ = origin[2] + spacing[2] * z;<br><br>then,<br><br>double * tp = myTransform-&gt;TransformPoint(myX, myY, myZ);<br>Then, convert the points back..
<br><br>cpX = (tp[0] - origin[0]) / spacing[0];<br>// same for others<br><br>This for some reason does not return the correct values....<br><br>I also tried setting the reslice axes of the vtkImageReslice like:<br><br>vtkMatrix4x4 tm = myTransform-&gt;GetMatrix();
<br>vtkMatrix4x4 sm = mySlicer-&gt;GetResliceAxes();<br><br>vtkMatrix4x4 * newM = vtkMatrix4x4::New();<br>vtkMatrix4x4::Multiply4x4(tm, sm, newM);<br><br>mySlicer-&gt;SetResliceAxes(newM);<br><br>This also is off. Also, results varies depending on whether I call
<br>mySlicer-&gt;UpdateInformation() here or now...<br><br>So, basically given x, y, z in original image data in pixels, I need to map it to transformed data and locate that point in display coordinates...<br><br>I hope someone out there can give me some pointers on this...
<br><br>Cheers,<br><br>Anja<br><br><br><br>