Hi Hala,<br><br>I don't know about the conversion to import others formats in VTK.<br>But slice extraction aren't a difficult task.<br>Take a look at the class vtkImageReslice.<br>The following pieces of code are in C++ and can helps you to extract the slices.
<br><br>//create the matrices <br>double transversalElements[16] = { <br> 1, 0, 0, 0,<br> 0, 1, 0, 0,<br> 0, 0, 1, 0,<br> 0, 0, 0, 1 };<br><br>double coronalElements[16] = {<br> 1, 0, 0, 0,
<br> 0, 0, 1, 0,<br> 0,-1, 0, 0,<br> 0, 0, 0, 1 };<br><br>double sagittalElements[16] ={<br> 0, 0,-1, 0,<br> 1, 0, 0, 0,<br> 0,-1, 0, 0,<br> 0, 0, 0, 1 };
<br><br><br>// an example of extraction in axial<br>//'ll assume that's the image are readed and are stored in vtkImageData *m_CurrentImageData:<br> m_CurrentImageData->UpdateInformation();<br> double point[4];
<br> double temp[4];<br> int extentT[6];<br> double spacingT[3];<br> m_CurrentImageData->GetSpacing(spacingT);<br> m_CurrentImageData->GetExtent(extentT);<br> vtkMatrix4x4 *m_Matrix = vtkMatrix4x4::New();
<br> m_Matrix->DeepCopy(sagittalElements);<br> point[0] = 0.0;<br> point[1] = 0.0;<br> //sets the point to the slice to be extracted.<br> point[2] = - m_CurrentImageData->GetSpacing()[1] *m_SliceNumber;
<br><br> point[3] = 1.0;<br> m_Matrix->MultiplyPoint(point, temp);<br> m_Matrix->SetElement(0, 3, temp[0]);<br> m_Matrix->SetElement(1, 3, temp[1]);<br> m_Matrix->SetElement(2, 3, temp[2]);
<br> vtkImageReslice *m_Reslicer = vtkImageReslice::New();<br> m_Reslicer->SetResliceAxes(m_Matrix);<br> vtkImageData *m_ExtractedSlice = m_Reslicer->GetOutput();<br><br>..................<br><br>With this example and more work, I believe you'll can extract all the slices. That's are just a piece of code, are a good idea take more care about, for example, the slice interval.
<br><br>Regards,<br><br>Wagner<br><br><div><span class="gmail_quote">2007/12/4, Hala ALBakour <<a href="mailto:haloul02@yahoo.co.uk">haloul02@yahoo.co.uk</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>I am very new to 3D modelling and vtk, Actually just<br>looking around to find out if vtk would solve my<br>problem, I am wondering if vtk helps to extract 2D<br>slice data (2D image x,y coordinates) from a 3D<br>computer graphical model, originally the 3D model is
<br>imported from a standard file format like 3DS, so in<br>any case I need a plugin which helps importing such<br>file and convert it to vtk data structure,<br><br>Most importantly, does vtk data structure encapsulate<br>
x,y,z coordinates, is it possible to extract x,y<br>values at certain cut offs of z for example, what is<br>the most appropriate rendering mechanism/data<br>structure in vtk that supports this,<br><br>Would it be easier in this case to use other low
<br>levels tools like OpenGL,<br><br>Your help is highly appreciated,<br>Please advise,<br><br>Hala<br><br><br><br> __________________________________________________________<br>Sent from Yahoo! - the World's favourite mail
<a href="http://uk.mail.yahoo.com">http://uk.mail.yahoo.com</a><br><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></blockquote></div><br>