[Insight-developers] pipeline update problem fixed

Damion Shelton dmshelto@andrew.cmu.edu
Thu, 25 Apr 2002 17:38:17 -0400


Hi,

I've managed to fix the weird pipeline update problems I was having. A few 
observations:

1) Luis's application model (see the ThinPlateSplines example) helps to 
promote safe pipeline design.

2) The image IO update weirdness can be a bit confusing. In the application 
context it presents the following problem:

I have a bunch of ivars, which are pipeline members. I also have function 
called CreateITKPipeline, which connects the inputs and outputs 
appropriately but doesn't update the pipeline. Presumably the reader is 
part of the pipeline.

Because current implementation, discussed earlier this week, requires the 
following syntax:

  loader->SetFileName(metaImageFileName);
  loader->Update();
  input_image  = loader->GetOutput();

...it's necessary to split the pipeline into two pieces, which are created 
at different points in the code. If you attempt something like:

  loader->SetFileName(metaImageFileName);
  fooFilter->SetInput(loader->GetOutput() );
  etc.

in the CreateITKPipeline() function, updating the end of the pipeline 
causes a crash.

Consequently, the program has to be designed something like:

1) Create reader
2) Set file name
3) Update reader
4) Create main ITK pipeline
5) Update ITK pipeline

This is not a huge inconvenience, but is a little bit counterintuitive. 
Other than that, the combination of ITK, VTK, and FLTK is working out quite 
well.

-Damion-