<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><br><div>&nbsp;</div>Hi luis,<br><br><span id="result_box" class="short_text"><span style="" title="">I already knew how to write polydata. </span><span style="" title=""><br>now the problem is how to extract&nbsp; surface of the image. is my code true?</span></span><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">There is no problem when I compile, but when I display the surface (bone.vtk) it's not appear as a surface.<br><br>&nbsp;<br>my code :<br><br><font size="3"><font size="2"> typedef itk::Mesh&lt;double&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MeshType;
<br>&nbsp; typedef itk::BinaryMask3DMeshSource&lt; ImageType, MeshType &gt;&nbsp;&nbsp; MeshSourceType;
<br><div class="im">&nbsp;&nbsp;&nbsp; MeshSourceType::Pointer meshSource = MeshSourceType::New();
<br></div>&nbsp;&nbsp;&nbsp; const PixelType objectValue = static_cast&lt;PixelType&gt;( 1250 );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; meshSource-&gt;SetObjectValue( objectValue );
<br>&nbsp;&nbsp;&nbsp; meshSource-&gt;SetInput( reader-&gt;GetOutput() );
<br>&nbsp;&nbsp;
<br>&nbsp; typedef itk::VTKPolyDataWriter&lt; MeshType &gt; WriterType;
<br><div class="im">&nbsp;&nbsp;&nbsp; WriterType::Pointer writer = WriterType::New();
<br>&nbsp;&nbsp;&nbsp; writer-&gt;SetFileName( "bone.vtk" );
<br></div>&nbsp;&nbsp;&nbsp; writer-&gt;SetInput( meshSource-&gt;GetOutput() );
<br>&nbsp;&nbsp;&nbsp; writer-&gt;Update();<br><br>Regards,<br><br>&nbsp;Sutrisno<br><br></font></font><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">Dari:</span></b> Luis Ibanez &lt;luis.ibanez@kitware.com&gt;<br><b><span style="font-weight: bold;">Kepada:</span></b> SUTRISNO SUTRISNO &lt;sutrisno_link@yahoo.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> itk &lt;Insight-users@itk.org&gt;<br><b><span style="font-weight: bold;">Terkirim:</span></b> Kam, 6 Mei, 2010 22:46:44<br><b><span style="font-weight: bold;">Judul:</span></b> Re: how to write *.vtk file<br></font><br><br>Hi Sutrisno,<br><br>The problem is that you are passing an <br>Image as the input to the PolyData writer. <br><br>The Writer expects that its input will be <br>an itkMesh.<br><br>Please look at the following files, as <br>
examples of usage:<br><br>&nbsp; Insight/Testing/Code/Review/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; itkVTKPolyDataWriterTest2.cxx<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; itkVTKPolyDataWriterTest.cxx<br><br><br>&nbsp;&nbsp; Regards,<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<br><br><br>-------------------------------------------------------------------<br>
<div class="gmail_quote">On Thu, May 6, 2010 at 11:38 AM, SUTRISNO SUTRISNO <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:sutrisno_link@yahoo.com" target="_blank" href="mailto:sutrisno_link@yahoo.com">sutrisno_link@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><br><font size="3">Hi luis,<br><br>You said that If I want to save surface <br>&nbsp;I must extract an itkMesh out of the image. <br>When I try extract surface from image (use <span style="font-style: italic;">SurfaceExtraction.cxx</span>) <br>
there was error :<br></font><font size="3"><br>
</font><font size="2">error: no matching function for call to
‘itk::VTKPolyDataWriter&lt;itk::Mesh&lt;double, 3u,
itk::DefaultStaticMeshTraits&lt;double, 3u, 3u, float, float,
double&gt; &gt; &gt;::SetInput(itk::OrientedImage&lt;short int,
3u&gt;*)’<br>
/usr/local/include/InsightToolkit/Review/itkVTKPolyDataWriter.txx:54:
note: candidates are: void
itk::VTKPolyDataWriter&lt;TInputMesh&gt;::SetInput(const TInputMesh*)
[with TInputMesh = itk::Mesh&lt;double, 3u,
itk::DefaultStaticMeshTraits&lt;double, 3u, 3u, float, float,
double&gt; &gt;]</font><br>
<div><br></div>my Listing :<br><br><font size="3"><font size="2">&nbsp; typedef itk::Mesh&lt;double&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MeshType;
<br>&nbsp; typedef itk::BinaryMask3DMeshSource&lt; ImageType, MeshType &gt;&nbsp;&nbsp; MeshSourceType;
<br><div class="im">&nbsp;&nbsp;&nbsp; MeshSourceType::Pointer meshSource = MeshSourceType::New();
<br></div>&nbsp;&nbsp;&nbsp; const PixelType objectValue = static_cast&lt;PixelType&gt;( 1250 );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; meshSource-&gt;SetObjectValue( objectValue );
<br>&nbsp;&nbsp;&nbsp; meshSource-&gt;SetInput( reader-&gt;GetOutput() );
<br>&nbsp;&nbsp;
<br>&nbsp; typedef itk::VTKPolyDataWriter&lt; MeshType &gt; WriterType;
<br><div class="im">&nbsp;&nbsp;&nbsp; WriterType::Pointer writer = WriterType::New();
<br>&nbsp;&nbsp;&nbsp; writer-&gt;SetFileName( argv[2] );
<br></div>&nbsp;&nbsp;&nbsp; writer-&gt;SetInput( reader-&gt;GetOutput() );
<br>&nbsp;&nbsp;&nbsp; writer-&gt;Update();</font><br><br></font><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"> <font size="3">Regards,<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sutrisno</font><br></div></div></div></blockquote></div>
</div></div>
</div><br></body></html>