[Insight-users] VTK - ITK - VTK Pipeline problems

Istvan Matis i_matis at yahoo.de
Sat Oct 29 14:43:23 EDT 2005


Hello ITK users,

I am using a complex pipeline to convert vtkImageData to itk Image, apply some filters on it (each time a different filter) like smoohting, segmentation, then convert back to VTK in order to visualize it.
My problem is that I receive various errors, "unhandled exceptions" sometimes in the itk sources sometimes in system dlls, usually when I want to apply the itk filters for the 2nd time.

I am using the same pipeline several times on several (different) images read into VTK.
As I understood, if one element (object) in the VTK->ITK->VTK pipeline is destroyed the whole pipeline will crash. In order to prevent this I use vtkImageCast to "Clone" the final vtk output in order to separate the output vtkImageData from the whole pipeline. 

Here is the sketch of the pipeline:

vtkImageData Input -> 
-> vtkImageCast ->
-> vtkImageData Input 2 ->
-> itk::VTKImageToImageFilter ->
-> itk::Image ->
-> " different itk filter each time: ex: itk::ConnectedThresholdImageFilter or itk::CurvatureFlowImageFilter " ->
-> itk::Image Output ->
-> itk::ImageToVTKImageFilter ->
-> vtkImageData Output ->
-> vtkImageCast ->
-> vtkImageData Output 2

I use ->Update() at every step!

By the way I am using itk 2-0-0, vtk 4-4, VC++6 with SP6, WinXP Pro.

Is a solution to recreate (Delete() and New()) all the itk and vtk filters in the pipeline each time they need to be used? I observed that if I destroy even one of these filters the whole thing crashes, and not immediately, but sooner or later, somewhere when vtk needs the data.

My question is: 
How can I separate the resulting vtkImage from the whole vtk-itk-vtk pipeline once it was processed? 
Or more generally: 
How can I reuse the whole pipeline on different images with different sizes and attributes?

Any hints will be gratefully apreciated.

Sincerelly,
Istvan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20051029/9a382db4/attachment.html


More information about the Insight-users mailing list