<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 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>