<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> </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 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> <br>my code :<br><br><font size="3"><font size="2"> typedef itk::Mesh<double> MeshType;
<br> typedef itk::BinaryMask3DMeshSource< ImageType, MeshType > MeshSourceType;
<br><div class="im"> MeshSourceType::Pointer meshSource = MeshSourceType::New();
<br></div> const PixelType objectValue = static_cast<PixelType>( 1250 ); <br> meshSource->SetObjectValue( objectValue );
<br> meshSource->SetInput( reader->GetOutput() );
<br>
<br> typedef itk::VTKPolyDataWriter< MeshType > WriterType;
<br><div class="im"> WriterType::Pointer writer = WriterType::New();
<br> writer->SetFileName( "bone.vtk" );
<br></div> writer->SetInput( meshSource->GetOutput() );
<br> writer->Update();<br><br>Regards,<br><br> 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 <luis.ibanez@kitware.com><br><b><span style="font-weight: bold;">Kepada:</span></b> SUTRISNO SUTRISNO <sutrisno_link@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> itk <Insight-users@itk.org><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> Insight/Testing/Code/Review/<br> itkVTKPolyDataWriterTest2.cxx<br> itkVTKPolyDataWriterTest.cxx<br><br><br> Regards,<br><br><br> Luis<br><br><br>-------------------------------------------------------------------<br>
<div class="gmail_quote">On Thu, May 6, 2010 at 11:38 AM, SUTRISNO SUTRISNO <span dir="ltr"><<a rel="nofollow" ymailto="mailto:sutrisno_link@yahoo.com" target="_blank" href="mailto:sutrisno_link@yahoo.com">sutrisno_link@yahoo.com</a>></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> 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<itk::Mesh<double, 3u,
itk::DefaultStaticMeshTraits<double, 3u, 3u, float, float,
double> > >::SetInput(itk::OrientedImage<short int,
3u>*)’<br>
/usr/local/include/InsightToolkit/Review/itkVTKPolyDataWriter.txx:54:
note: candidates are: void
itk::VTKPolyDataWriter<TInputMesh>::SetInput(const TInputMesh*)
[with TInputMesh = itk::Mesh<double, 3u,
itk::DefaultStaticMeshTraits<double, 3u, 3u, float, float,
double> >]</font><br>
<div><br></div>my Listing :<br><br><font size="3"><font size="2"> typedef itk::Mesh<double> MeshType;
<br> typedef itk::BinaryMask3DMeshSource< ImageType, MeshType > MeshSourceType;
<br><div class="im"> MeshSourceType::Pointer meshSource = MeshSourceType::New();
<br></div> const PixelType objectValue = static_cast<PixelType>( 1250 ); <br> meshSource->SetObjectValue( objectValue );
<br> meshSource->SetInput( reader->GetOutput() );
<br>
<br> typedef itk::VTKPolyDataWriter< MeshType > WriterType;
<br><div class="im"> WriterType::Pointer writer = WriterType::New();
<br> writer->SetFileName( argv[2] );
<br></div> writer->SetInput( reader->GetOutput() );
<br> writer->Update();</font><br><br></font><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"> <font size="3">Regards,<br><br><br> Sutrisno</font><br></div></div></div></blockquote></div>
</div></div>
</div><br></body></html>