[ITK] DisconnectPipeline() on multiple output filter

Nicolas Gallego nicgallego at gmail.com
Mon Jul 14 09:09:15 EDT 2014


Hi,

I have implemented a filter with two outputs of different type inspired by
the example []. This filter is used inside a loop, so I learned from an
earlier post in this list that I should call the method
DisconnectPileline() on the image pointers I use hold the intermediate
results before using them as inputs of my pipeline on the next iteration.
Something like this

.....
TImage1::Pointer im1;
TImage2::Pointer im2;

... initialization code...
filter->SetInput1( im1 );
filter->SetInput2( im2 );

for( int i = 0; i < nIter; i++) {
    filter->Update();
    TImage1::Pointer tmp1 = filter->GetOutput1();
    TImage2::Pointer tmp2 = filter->GetOutput2();




The problem is that it only works on the principal output, when I call the
method on the second output, I get the following execution error,

---------------------------------------------------------------------------------------------------------------------------
itk::ExceptionObject (0000000000ACF300)
Location: "unknown"
File:
d:\itk4.5\insighttoolkit-4.5.0\modules\core\common\include\itkImage.hxx
Line: 138
Description: itk::ERROR: Image(0000000002FDBDF0): itk::Image::Graft()
cannot cast class itk::DataObject const * __ptr64 to class itk::Image<class
itk::Vector<fl
oat,3>,3> const * __ptr64
---------------------------------------------------------------------------------------------------------------------------

and when I use PipelineDisconnect() only on the principal output, my
pipeline is Updated twice as it is still connected, and the program does
not crash but the results are numerically incorrect. Any ideas to solve
this issue? I know I should submit an example code that reproduces the
error, I will try to extract it and post it later, but for the moment I
would be happy to get some ideas about how to debug this issu.

Thank you very much,

Nicolás Gallego-Ortiz
Université catholique de Louvain, Belgium
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140714/767e4a6f/attachment-0001.html>


More information about the Community mailing list