[Insight-users] View of a Mesh and Image data.
Samuel Rodríguez Bescos
srodrigu@gbt.tfo.upm.es
Wed, 25 Sep 2002 10:26:44 +0200
Thank Luis for your help,
Sam
----- Original Message -----
From: "Luis Ibanez" <luis.ibanez@kitware.com>
To: "Samuel Rodríguez Bescos" <srodrigu@gbt.tfo.upm.es>
Cc: <insight-users@public.kitware.com>
Sent: Wednesday, September 25, 2002 2:30 AM
Subject: Re: [Insight-users] View of a Mesh and Image data.
>
> Hi Samuel,
>
>
> ITK itself does not provide any visualization functionalities.
>
>
>
> One possible option is to take advantage of the connection
> between ITK and VTK.
>
>
> You can connect the ITK image (produced as output of any itk
> filter) into a VTK filter. This is done using the classes:
>
> - itk::VTKImageExporter
> - vtkImageImporter
>
> An example illustrating how to this is available at
>
> Insight/Auxiliary/vtk/
>
> in the file:
>
> itkVTKtoITKtoVTK.cxx
>
>
> The image is connected by code similar to the following.
>
> typedef itk::Image<float, 3> ImageType;
> typedef itk::VTKImageExport<ImageType> ImageExportType;
>
> ImageExportType::Pointer itkexporter = ImageExportType::New();
> itkexporter->SetInput( ....the last filter in the ITK pipeline....);
>
> vtkImageImport* vtkimporter = vtkImageImport::New();
>
>
vtkimporter->SetUpdateInformationCallback(itkexporter->GetUpdateInformationC
allback());
>
vtkimporter->SetPipelineModifiedCallback(itkexporter->GetPipelineModifiedCal
lback());
>
vtkimporter->SetWholeExtentCallback(itkexporter->GetWholeExtentCallback());
> vtkimporter->SetSpacingCallback(itkexporter->GetSpacingCallback());
> vtkimporter->SetOriginCallback(itkexporter->GetOriginCallback());
> vtkimporter->SetScalarTypeCallback(itkexporter->GetScalarTypeCallback());
>
vtkimporter->SetNumberOfComponentsCallback(itkexporter->GetNumberOfComponent
sCallback());
>
vtkimporter->SetPropagateUpdateExtentCallback(itkexporter->GetPropagateUpdat
eExtentCallback());
> vtkimporter->SetUpdateDataCallback(itkexporter->GetUpdateDataCallback());
> vtkimporter->SetDataExtentCallback(itkexporter->GetDataExtentCallback());
>
vtkimporter->SetBufferPointerCallback(itkexporter->GetBufferPointerCallback(
));
> vtkimporter->SetCallbackUserData(itkexporter->GetCallbackUserData());
>
>
>
> This will allow you to use any of the VTK means for visualizing the
> volume data set. An Update() in the VTK pipeline will trigger an update
> on the ITK pipeline and image data will be transfer between the two.
>
>
>
>
> For visualizing the Mesh, you can map the ITK Mesh into a VTK mesh
> by following the example in
>
>
> Insight/Auxiliary/vtk2itk.cxx
>
>
> The itk::Mesh is mapped here into a vtkUnstructuredGrid, that you can
> then render using VTK filters.
>
> If you render both objects in the same vtkRenderWindow you can manage
> to overlap them in space.
>
>
>
> Please let us know if you need additional details for doing this
> visualization.
>
>
>
> Thanks
>
>
> Luis
>
>
> ==========================================================
> Samuel Rodríguez Bescos wrote:
>
> > Hello again,
> >
> >
> >
> > Could everybody tell me how can I represent the Mesh resulted of the
> > DeformableMeshFilter and the initial data in the same view.
> >
> >
> >
> > Thanks in advance,
> >
> >
> >
> > Sam
> >
>
>