Andriy,<br><br>Thank you for your assistance. I am working to integrate your code snippet with my current program. I included itkCommand.h, but am getting the error messages "expected primary-expression before "template"" and "expected `;' before "template"" at the line "template<class TInputMesh> void".
<br><br>I did not forget a ';' in the lines prior to the class creation. I even tried re-creating the makefile with ccmake before attempting to compile the code, but get the same error messages.<br><br>Do you have any suggestions as to what I may be missing?
<br><br>Thank you,<br>Catherine Peloquin<br><br><br><div><span class="gmail_quote">On 5/18/07, <b class="gmail_sendername">Andriy Fedorov</b> <<a href="mailto:fedorov@bwh.harvard.edu">fedorov@bwh.harvard.edu</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Catherine,<br><br>Below is a code snippet, which saves a mesh in RAW format (very<br>
simple), given ITK surface mesh. Hope this helps you.<br><br>Andriy Fedorov<br><br><br><br>template<class TInputMesh> void<br>TriangularSurfaceMeshWriter<TInputMesh>::WriteRawMesh(){<br> std::ofstream raw_mesh(m_FileName.c_str());
<br> raw_mesh << m_InputMesh->GetPoints()->Size() << " "<br> << m_InputMesh->GetCells()->Size() << std::endl;<br><br> typename InputMeshType::PointsContainer::ConstIterator inPointsI;
<br> typename InputMeshType::CellsContainer::ConstIterator inCellsI;<br> inPointsI = m_InputMesh->GetPoints()->Begin();<br> while(inPointsI != m_InputMesh->GetPoints()->End()){<br> typename InputMeshType::PointType curPoint;
<br> curPoint = inPointsI.Value();<br> raw_mesh << curPoint[0] << " " << curPoint[1] << " " <<<br>curPoint[2] << std::endl;<br> inPointsI++;<br>
}<br><br> inCellsI = m_InputMesh->GetCells()->Begin();<br> typedef itk::TriangleCell<typename InputMeshType::CellType> TriangleType;<br> while(inCellsI != m_InputMesh->GetCells()->End()){
<br> TriangleType *curTri;<br> typename TriangleType::PointIdIterator ptI;<br> if(inCellsI.Value()->GetType() !=<br>InputMeshType::CellType::TRIANGLE_CELL)<br> itkExceptionMacro(<<"Input surface mesh is not triangular");
<br> curTri = dynamic_cast<TriangleType*>(inCellsI.Value());<br> ptI = curTri->PointIdsBegin();<br> raw_mesh << *ptI++ << " " << *ptI++ << " " << *ptI++ << std::endl;
<br> inCellsI++;<br> }<br> raw_mesh.close();<br>}<br><br><br>> Message: 5<br>> Date: Fri, 18 May 2007 10:48:03 -0500<br>> From: "Catherine Peloquin" <<a href="mailto:cepeloquin@gmail.com">
cepeloquin@gmail.com</a>><br>> Subject: [Insight-users] Retrieving coordinates from<br>> BinaryMask3DMeshSource mesh<br>> To: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>> Message-ID:
<br>> <<a href="mailto:3a72f1140705180848h35f387f2h6e418e3aa2a62ba3@mail.gmail.com">3a72f1140705180848h35f387f2h6e418e3aa2a62ba3@mail.gmail.com</a>><br>> Content-Type: text/plain; charset="iso-8859-1"
<br>><br>> I am using the BinaryMask3DMeshSource filter example in<br>> Insight/Examples/Filters/SurfaceExtraction.cxx to create an isosurface of a<br>> series of DICOM images. I need to retrieve the coordinates of the output
<br>> mesh's nodes (or the vertices of the triangles formed by the mesh) so I can<br>> then draw the surface in Coin3D. I realize that I can also draw the surface<br>> in VTK, but I need to integrate the program into an application that uses
<br>> Coin.<br>><br>> In a previous post (located at<br>> <a href="http://public.kitware.com/pipermail/insight-users/2007-May/022211.html">http://public.kitware.com/pipermail/insight-users/2007-May/022211.html
</a>) , I<br>> attempted to follow the methods of retrieving coordinates in the PointSet<br>> example in Insight/Examples/DataRepresentation/Mesh/PointSet2.cxx, but could<br>> not find a way to get the mesh points for the points container.
<br>><br>> How is it possible to get the x, y, and z coordinates of a mesh generated by<br>> the BinaryMask3DMeshSource filter?<br>><br>> Thank you,<br>> Catherine Peloquin<br>> -------------- next part --------------
<br>> An HTML attachment was scrubbed...<br>> URL: <a href="http://public.kitware.com/pipermail/insight-users/attachments/20070518/4bc94481/attachment-0001.htm">http://public.kitware.com/pipermail/insight-users/attachments/20070518/4bc94481/attachment-0001.htm
</a><br>><br></blockquote></div><br>