[Insight-users] itkVTKImageToImageFilter

Luis Ibanez luis.ibanez at kitware.com
Tue, 23 Mar 2004 01:50:41 -0500


Hi Yan,

You are using incompatible versions
of Insight and InsightApplications.

Please syncronize your checkouts.

The itkVTKImageToImageFilter in


      InsightApplications/Auxiliary/vtk


depends on the itkVTKImageImport in


      Insight/Code/BasicFilters


Both files should correspond to the
same release of ITK or to the same
CVS date.


About the crash... did you tried adding
a try/catch block around the Update()
invokation  ?



    Regards,



       Luis


-----------------------
Yan Pingkun wrote:
> Dear all,
>  
> In my project, I need to convert vtk image to itk image. So I write 
> following program:
>  
> ====================================================================
> VtkImageToItkImageFilterType::Pointer v2iFilter = 
> VtkImageToItkImageFilterType::New();
> v2iFilter->SetInput(stencil->GetOutput());
> this->m_pItkImage = v2iFilter->GetImporter()->GetOutput();
> v2iFilter->GetImporter()->Update();
> ====================================================================
>  
> Then I encountered two problems. The first is compiling error:
> error C2977: 'VTKImageImport' : too many template arguments
> I found that the VTKImageImport file under basicfilters folder has been 
> updated. But the
> file "itkVTKImageToImageFilter.h" is still using the old interface. So I 
> modified it and this error disappear.
>  
> The second problem is run time error. The program always crash when is 
> comes to
> v2iFilter->GetImporter()->Update();
>  
> Any body can help? Thanks!
>  
> Regards,
> Pingkun
>  
> To Mathieu: My problem may not caused by vtkImageStencil but by this 
> filter...