<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1491" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I got a problem about connecting ITK and VTK. I can
successfully convert vtkImageData to itk image data, but I can't convert the
registered itk image into vtkImageData format. There is no problem with the
input to itk::VTKImageExport, because I can write a png file with
caster->GetOutput().</FONT></DIV>
<DIV><FONT face=Arial size=2>I would be grateful if you could take a look at my
code.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Kind regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Yan</FONT></DIV>
<DIV><FONT face=Arial
size=2>------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>#include "vtkImageExport.h"<BR>#include
"vtkImageImport.h"<BR>#include "vtkTransform.h"</FONT></DIV>
<DIV><FONT face=Arial size=2>#include "itkVTKImageImport.h"<BR>#include
"itkVTKImageExport.h"</FONT></DIV>
<DIV><FONT face=Arial size=2>#include "vtkITKUtility.h"</FONT></DIV>
<DIV><FONT face=Arial size=2>......</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> typedef itk::VTKImageExport<
OutputImageType > ImageExportType; </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> ImageExportType::Pointer
registeredItkExporter = ImageExportType::New();<BR>
registeredItkExporter->SetInput( caster->GetOutput() );<BR>
<BR> registeredItkExporter->Update();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkImageImport *registeredVtkImporter =
vtkImageImport::New();<BR> ConnectPipelines(registeredItkExporter,
registeredVtkImporter);<BR>
registeredVtkImporter->Update();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> this->RegisteredImage =
registeredVtkImporter->GetOutput();</FONT></DIV>
<DIV><FONT face=Arial
size=2> <BR><BR></DIV></FONT></BODY></HTML>