<div dir="ltr">Hi all,<br><br>May be the title are not the best, but i'll explain better the problem:<br>a) I have a 2D viewer that's shows to me slices from a serie. This 2D viewer aren'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's I have for marked points are ok.<br>
c) I show the results of segmentation on a 3D view ( ITKImage -> VTKImage -> vtkContourFilter -> vtkPolyData -> vtkPolyDataMapper -> 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> paraCoords = new double[3];<br> xyzCoords = new double[3];<br> vtkcellweights = new double[4];<br> q = new int[3];<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] = m_XPosition;<br> q[1] = m_YPosition;<br>
q[2] = m_ZPosition;<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>Well, the position, when returned, are ok. But some times this crashes ( and debugger output are useless ). Running under valgrind (I'm on a linux machine), this shows a useful backtrace, that'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'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>