[Insight-users] vtk to itk to vtk
Luis Ibanez
luis . ibanez at kitware . com
Mon, 12 May 2003 10:57:07 -0400
Hi Christophe,
The Update() call in the ITK pipeline assumes
that the image dimensions have not changed.
If, after running the pipeline once with an image, you
want to provide as input an image with a different size,
you will have to call
UpdateLargestPossibleRegion()
instead of the simple
Update()
Since by default in the ITK + VTK connections, the method
called is "Update()", this means that before updating the
VTK end of the pipeline, you must explicitly call
"UpdateLargestPossibleRegion()" on the ITK filter.
Probably the easy way to do so is as soon as you load
your new image.
The ITK pipeline is built under the assumption that
you may want to execute the pipeline many times with
different parameters in the filters, but with the same
input images.
Regards,
Luis
----------------------
Christophe Odet wrote:
> Hi all,
>
> I am trying to use an itk pipeline into a vtk pipeline. One example is
> given in:
>
> InsightApplications-1.2.0\Auxiliary\vtk\itkPNGVTKtoITKtoVTK.cxx
>
> It works well with the provided images because they have the same size.
> But if you replace the second png image with a smaller one
> the program crashes telling that the update extent is to large.
>
> 1) Bypassing the itk part of this example doesn't solve the problem. To
> solve that, You remove the first vtk actor and then create a new one and
> display it as usual. With this modification le vtk pipeline works well
> when the second image is smaller.
> 2) But, with the previous vtk modifications, if I re-activate the itk
> pipeline, the bug re-appears.
>
> Is it a pb with the itk pipeline ? or with the vtk/itk importer/exporter
> connections ? it seems that the update extents are not
> correctly transmitted through the pipelines connections when an upate is
> requested....
>
> Thanks for answers
>
> Christophe