[vtkusers] Re: [Insight-users] How to convert the result of a Surface extraction Filter(meshSource) to vtkUnstructuredGrid to visualize it?

Karthik Krishnan Karthik.Krishnan at kitware.com
Sat Mar 18 15:51:31 EST 2006


charfeddine amir wrote:

> Hi all
> I didn't find that filter (ITKmeshToVTKPolyData), 

Leila Baghdadi added some filters:
http://www.itk.org/cgi-bin/viewcvs.cgi/DeformableModelSimplexMesh/?root=InsightApplications
to convert triangle meshes in ITK to/from vtkPolyData.

> so i tried to use the MeshToUnstructuredGrid(floatMesh* mesh) method i 
> found in InsightApplications/Auxiliary/vtk/vtk2itk.cxx file.
> the problem is that the surface extraction filter produces a 
> MeshSource, although the MeshToUnstructuredGrid(..) method takes Mesh.

the SurfaceExtractionFilter ( itk::BinaryMask3DMeshSource ) *is* a 
MeshSource and its *output* is an itk::Mesh. ( a triangle mesh ). You 
should be able to convert that to a vtkPolyData, write it to a file with 
the vtkPolyDataWriter and load it up for instance in Paraview.

> so how can i convert from Meshsource to Mesh, or what should i pass to 
> that method?
> thx for help
>
> */Karthik Krishnan <Karthik.Krishnan at kitware.com>/* a écrit :
>
>     There is an ITKmeshToVTKPolyData filter in
>     InsightApplications/Auxillary. If you search InsightApplications, I
>     think there are a couple of applications that use the filter.
>
>     charfeddine amir wrote:
>
>     > Hi all,!
>     > i use a surface extraction filter like the one in the
>     > ItkSoftwareGuide.pdf page 259,
>     > and i want to visualize it with vtk,
>     > so i tried to do so :
>     >
>     > void
>     > AppBase
>     > ::visualizevolume()
>     > {
>     > meshSource = MeshSourceType::New();
>     > const OutputPixelType objectValue = static_cast( 255 );
>     > ! meshSource->SetObjectValue( objectValue );
>     > meshSource->SetInput( m_OutputVolume );
>     >
>     > connector = ConnectorType::New();
>     >
>     > connector->SetInput( meshSource->GetOutput() );
>     > vtkImageViewer * viewer = vtkImageViewer::New();
>     > vtkRenderWindowInteractor * renderWindowInteractor =
>     > vtkRenderWindowInteractor::New();
>     > viewer->SetupInteractor( renderWindowInteractor );
>     > viewer->SetInput( connector->GetOutput() );
>     > viewer->Render();
>     > viewer->SetColorWindow( 255 );
>     > viewer->SetColorLevel( 128 );!
>     > renderWindowInteractor->Start();
>     > }
>     >
>     > but at the red line, i should convert the meshSource to a
>     > vtkUnstructuredGrid (i think)
>     >
>     > how can i do that?
>     >
>     > I take a look in the file vtk2itk.cxx but it's too diffucult,
>     how can
>     > i use it?
>     >
>     > thx,
>     > Regards
>     >
>     >
>     ------------------------------------------------------------------------
>     > Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez
>     les
>     > tarifs exceptionnels pour appeler la France et l'international.
>     > Téléchargez
>     >
>     > la version beta.
>     >
>     >------------------------------------------------------------------------
>     >
>     >_______________________________________________
>     >Insight-users mailing list
>     >Insight-users at itk.org
>     >http://www.itk.org/mailman/listinfo/insight-users
>     >
>     >
>
>
> ------------------------------------------------------------------------
> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les 
> tarifs exceptionnels pour appeler la France et l'international. 
> Téléchargez 
> <http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.beta.messenger.yahoo.com> 
> la version beta.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>  
>



More information about the vtkusers mailing list