Hi all,<br><br>This answer are just for future searches in the list. <br>The code and approach are right. The problem was other, that's don't need to be mentioned here since aren't VTK related.<br><br>Regards,<br>
<br>Wagner Sales<br><br><div class="gmail_quote">2008/5/14 Wagner Sales <<a href="mailto:wsales@gmail.com">wsales@gmail.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br><br>The following message was sent in some minutes ago.<br>I'm trying to show marked points in a 2D view from a dataset in 3D view of segmented data from this dataset. To explain more:<br>a) I have a DICOM dataset<br>
b)
In 2D view I was marked some points to use in segmentation, done by
ITK. The segmentation works fine, then I think my points are marked ok.<br>
c) After segmentation, I extract the polydata and show in a 3D view.<br>d)
Then, I try to create new points in 2D view and show in 3D. The points
are created, but in 3D appears in a different location.<br>Well, I
think I need to convert the coordinates from the point and after that
set manually the position of the point (a vtkActor) in 3D view.<br>
<br>Are I'm correct? If yes, how to convert these coordinates? Are another more simple approach?<br><br>Well, taking a look at my VTK book and some examples, I think I need to translate the dataset to global coordinates. This are done by the following code:<br>
<br>double *Point::translateCoordinates(int x, int y, int z)<br>{<br> // m_CurrentImageData are a vtkImageData instance<br> if(!m_CurrentImageData)<br> {<br> xyzCoords[0] = 0.0;<br> xyzCoords[1] = 0.0;<br>
xyzCoords[2] = 0.0;<br> return xyzCoords;<br> }<br> q[0] = x;<br> q[1] = y;<br> q[2] = z;<br> cellNum = m_CurrentImageData->ComputeCellId(q);<br> subID = m_CurrentImageData->GetCell( cellNum )->GetParametricCenter(paraCoords);<br>
int &subIDadd = subID;<br> m_CurrentImageData->GetCell(cellNum)->EvaluateLocation(subIDadd, paraCoords, <br> xyzCoords, vtkcellweights);<br> return xyzCoords;<br>}<br><br>Then I'm trying to set the actor position using xyzCoords, but not working ( the point are in wrong position yet ). Any help?<br>
<br>Thks in advance,<br><font color="#888888"><font color="#888888"><br>Wagner Sales</font>
</font></blockquote></div><br>