Andriy,<br><br>Thank you for your assistance.&nbsp; I am working to integrate your code snippet with my current program.&nbsp; I included itkCommand.h, but am getting the error messages &quot;expected primary-expression before &quot;template&quot;&quot; and &quot;expected `;&#39; before &quot;template&quot;&quot; at the line &quot;template&lt;class TInputMesh&gt; void&quot;.&nbsp; 
<br><br>I did not forget a &#39;;&#39; in the lines prior to the class creation.&nbsp; 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> &lt;<a href="mailto:fedorov@bwh.harvard.edu">fedorov@bwh.harvard.edu</a>&gt; 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&lt;class TInputMesh&gt; void<br>TriangularSurfaceMeshWriter&lt;TInputMesh&gt;::WriteRawMesh(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;std::ofstream raw_mesh(m_FileName.c_str());
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raw_mesh &lt;&lt; m_InputMesh-&gt;GetPoints()-&gt;Size() &lt;&lt; &quot; &quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&lt; m_InputMesh-&gt;GetCells()-&gt;Size() &lt;&lt; std::endl;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typename InputMeshType::PointsContainer::ConstIterator inPointsI;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typename InputMeshType::CellsContainer::ConstIterator inCellsI;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inPointsI = m_InputMesh-&gt;GetPoints()-&gt;Begin();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(inPointsI != m_InputMesh-&gt;GetPoints()-&gt;End()){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typename InputMeshType::PointType curPoint;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;curPoint = inPointsI.Value();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raw_mesh &lt;&lt; curPoint[0] &lt;&lt; &quot; &quot; &lt;&lt; curPoint[1] &lt;&lt; &quot; &quot; &lt;&lt;<br>curPoint[2] &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inPointsI++;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inCellsI = m_InputMesh-&gt;GetCells()-&gt;Begin();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typedef itk::TriangleCell&lt;typename InputMeshType::CellType&gt; TriangleType;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(inCellsI != m_InputMesh-&gt;GetCells()-&gt;End()){
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TriangleType *curTri;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typename TriangleType::PointIdIterator ptI;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(inCellsI.Value()-&gt;GetType() !=<br>InputMeshType::CellType::TRIANGLE_CELL)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;itkExceptionMacro(&lt;&lt;&quot;Input surface mesh is not triangular&quot;);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;curTri = dynamic_cast&lt;TriangleType*&gt;(inCellsI.Value());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ptI = curTri-&gt;PointIdsBegin();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raw_mesh &lt;&lt; *ptI++ &lt;&lt; &quot; &quot; &lt;&lt; *ptI++ &lt;&lt; &quot; &quot; &lt;&lt; *ptI++ &lt;&lt; std::endl;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inCellsI++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raw_mesh.close();<br>}<br><br><br>&gt; Message: 5<br>&gt; Date: Fri, 18 May 2007 10:48:03 -0500<br>&gt; From: &quot;Catherine Peloquin&quot; &lt;<a href="mailto:cepeloquin@gmail.com">
cepeloquin@gmail.com</a>&gt;<br>&gt; Subject: [Insight-users] Retrieving coordinates from<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BinaryMask3DMeshSource&nbsp;&nbsp;mesh<br>&gt; To: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>&gt; Message-ID:
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<a href="mailto:3a72f1140705180848h35f387f2h6e418e3aa2a62ba3@mail.gmail.com">3a72f1140705180848h35f387f2h6e418e3aa2a62ba3@mail.gmail.com</a>&gt;<br>&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;
<br>&gt;<br>&gt; I am using the BinaryMask3DMeshSource filter example in<br>&gt; Insight/Examples/Filters/SurfaceExtraction.cxx to create an isosurface of a<br>&gt; series of DICOM images.&nbsp;&nbsp;I need to retrieve the coordinates of the output
<br>&gt; mesh&#39;s nodes (or the vertices of the triangles formed by the mesh) so I can<br>&gt; then draw the surface in Coin3D.&nbsp;&nbsp;I realize that I can also draw the surface<br>&gt; in VTK, but I need to integrate the program into an application that uses
<br>&gt; Coin.<br>&gt;<br>&gt; In a previous post (located at<br>&gt; <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>&gt; attempted to follow the methods of retrieving coordinates in the PointSet<br>&gt; example in Insight/Examples/DataRepresentation/Mesh/PointSet2.cxx, but could<br>&gt; not find a way to get the mesh points for the points container.
<br>&gt;<br>&gt; How is it possible to get the x, y, and z coordinates of a mesh generated by<br>&gt; the BinaryMask3DMeshSource filter?<br>&gt;<br>&gt; Thank you,<br>&gt; Catherine Peloquin<br>&gt; -------------- next part --------------
<br>&gt; An HTML attachment was scrubbed...<br>&gt; 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>&gt;<br></blockquote></div><br>