Hi Michal,<br><br><div><span class="gmail_quote">On 7/31/07, <b class="gmail_sendername">Michal Plotkowiak</b> &lt;<a href="mailto:michal.plotkowiak@bnc.ox.ac.uk">michal.plotkowiak@bnc.ox.ac.uk</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;">
<br>thanks Luis for your help. I&#39;m still having some difficulties.<br><br>trying to compile programs from InsightApplications/Auxiliary/vtk I got the<br>following error: fatal error LNK1104:cannot open file vtkRendering.lib
</blockquote><div><br>You probably need to download and build a copy of VTK, if you haven&#39;t already. If you have already, make sure that cmake is looking in the correct lib directory.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I tried another approach. I took SurfaceExtraction code and added the following<br>lines:<br><br>typedef itk::MeshSpatialObject&lt;MeshType&gt;&nbsp;&nbsp;&nbsp;&nbsp; MeshSpatialObjectType;<br>&nbsp;&nbsp;MeshSpatialObjectType::Pointer myMeshSpatialObject =
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MeshSpatialObjectType::New();<br>&nbsp;&nbsp;myMeshSpatialObject-&gt;SetMesh(meshSource-&gt;GetOutput());<br>&nbsp;&nbsp;myMeshSpatialObject-&gt;GetMesh();<br><br>&nbsp;&nbsp;typedef itk::SpatialObjectWriter&lt;3&gt; WriterType;
<br>&nbsp;&nbsp;WriterType::Pointer writer = WriterType::New();<br>&nbsp;&nbsp;writer-&gt;SetInput(myMeshSpatialObject);<br>&nbsp;&nbsp;writer-&gt;SetFileName(&quot;mesh.mha&quot;);<br>&nbsp;&nbsp;writer-&gt;Update();<br><br>but the program crashes and I dont get any output.
<br><br>could you give me some suggestions?</blockquote><div><br>I&#39;d suggest giving the *exact* error message.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
meny thanks<br>michal</blockquote><div><br>Cheers,<br>&nbsp;- Dan<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">In message &lt;<a href="mailto:46AE5DBF.3000201@kitware.com">
46AE5DBF.3000201@kitware.com</a>&gt; Luis Ibanez &lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;<br>writes:<br>&gt;<br>&gt; Hi Michal,<br>&gt;<br>&gt;&nbsp;&nbsp;From the list of file formats listed in:
<br>&gt; <a href="http://tetgen.berlios.de/fformats.html">http://tetgen.berlios.de/fformats.html</a><br>&gt;<br>&gt; One possibility seems to be for you to use the STL file format.<br>&gt;<br>&gt; ITK doesn&#39;t directly write to it, but
<br>&gt; you can take your segmented image, save it as a<br>&gt; .vtk or .mhd images, using the itkImageFileWriter.<br>&gt;<br>&gt; Then read the image into VTK and use the vtkContourFilter<br>&gt; <a href="http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html">
http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html</a><br>&gt; and save the resulting surface as an STL file<br>&gt; using the STL Writer<br>&gt; <a href="http://www.vtk.org/doc/nightly/html/classvtkSTLWriter.html">
http://www.vtk.org/doc/nightly/html/classvtkSTLWriter.html</a><br>&gt;<br>&gt;<br>&gt; You can also do it in a single program mixing ITK and<br>&gt; VTK and converting the ITK image into a vtkImageData.<br>&gt; You will find examples of this conversion in the directory
<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; InsightApplications/Auxiliary/vtk<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;itkReadITKImage3DSegmentShowVTK.cxx<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;itkReadITKImageSegmentShowVTK.cxx<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;itkReadITKImageShowSplineVTK.cxx
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;itkReadITKImageShowVTK.cxx<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;Regards,<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<br>&gt;<br>&gt;<br>&gt; ------------------------<br>&gt; Michal Plotkowiak wrote:<br>&gt; &gt; Hi<br>
&gt; &gt;<br>&gt; &gt; could someone tell me how can I convert a segmented image stored in .mha<br>file<br>&gt; &gt; to a spatial object readable by TetGen (FE mesh generator)?<br>&gt; &gt;<br>&gt; &gt; many thanks<br>&gt; &gt; michal
<br>&gt; &gt;<br>&gt; &gt;<br>&gt;<br><br>--<br>Michal Plotkowiak<br>Doctoral Researcher<br>Oxford University LSI DTC<br><br>_______________________________________________<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org">
Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></div><br>