<div dir="ltr">Hi all,<br><br>May be the title are not the best, but i&#39;ll explain better the problem:<br>a) I have a 2D viewer that&#39;s shows to me slices from a serie. This 2D viewer aren&#39;t VTK based.<br>b) I use this 2D viewer to mark seed points for segmentation. The segmentation works fine for various datasets, then I think the positions that&#39;s I have for marked points are ok.<br>
c) I show the results of segmentation on a 3D view ( ITKImage -&gt; VTKImage -&gt; vtkContourFilter -&gt; vtkPolyData -&gt; vtkPolyDataMapper -&gt; vtkActor, I think ). Thats works fine too.<br>d) I need to mark a point on the 2D viewer and shows this point on 3D view.<br>
<br>After some search, I do:<br><br>&nbsp;&nbsp; &nbsp;&nbsp; paraCoords = new double[3];<br>&nbsp;&nbsp; &nbsp;&nbsp; xyzCoords&nbsp; = new double[3];<br>&nbsp;&nbsp; &nbsp;&nbsp; vtkcellweights = new double[4];<br>&nbsp;&nbsp; &nbsp;&nbsp; q = new int[3];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!m_CurrentImageData)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xyzCoords[0] = 0.0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xyzCoords[1] = 0.0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xyzCoords[2] = 0.0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return xyzCoords;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q[0] = m_XPosition;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q[1] = m_YPosition;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; q[2] = m_ZPosition;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cellNum = m_CurrentImageData-&gt;ComputeCellId(q);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subID = m_CurrentImageData-&gt;GetCell( cellNum )-&gt;GetParametricCenter(paraCoords);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int &amp;subIDadd = subID;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_CurrentImageData-&gt;GetCell(cellNum)-&gt;EvaluateLocation(subIDadd, paraCoords, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xyzCoords, vtkcellweights);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return xyzCoords;<br><br><br>Well, the position, when returned, are ok. But some times this crashes ( and debugger output are useless ). Running under valgrind (I&#39;m on a linux machine), this shows a useful backtrace, that&#39;s passes to this method and go to vtkVoxel::EvaluateLocation method, where the crash occurs. I tried then to use vtkCoordinate to convert coordinates, setting all the system coordinates and getting all the converted values, and no ones are equals the values I have from my current approach. <br>
Since I&#39;m running on this problem a couple of days, someone can helps? ( another approach, whats wrong, etc ). My VTK version are 5.2 stable.<br><br>Regards,<br><br>Wagner Sales<br><br></div>