[Insight-users] AddImageFilter problem...

Benjamin King king.benjamin at mh-hannover.de
Tue, 17 Feb 2004 13:20:30 +0100


Hi Sergio,

there is more information needed to track down your problem.
First of all, you could try to get some more information about the
error that is generated by catching exceptions:

    try
    {
      addFilter->Update();
    }
    catch (itk::ExceptionObject &e)
    {
      std::cerr << "The following ITK error has occured:\n" << e.what() << 
std::endl;
    }
    catch (std::exception &e)
    {
      std::cerr << "The following C++ error has occured:\n" << e.what() << 
std::endl;
    }

Note that you have to #include <stdexcept> and "itkExceptionObject.h".
Perhaps you just have a copy and paste bug:

>     addFilter->SetInput1(outputImages[0]);
>     addFilter->SetInput1(outputImages[1]);
>     addFilter->Update();    // this produces an error....***

The second line should read addFilter->SetInput2(...)

If this doesn't help, it would be nice if you could provide a minimal
compilable demonstration of the problematic code.


cheers,
    Benjamin

-- 
Benjamin King
Institut für Medizinische Informatik
Medizinische Hochschule Hannover
Tel.: +49  511  532-2663