From Ohm

ITK Pipeline

Medical Processing in ITK is organized as a series of filters, the processing pipeline.

Each filter does a particular job, and sends the processed data to the next stage of the pipeline.

Each filter has inputs and outputs. Configuring the pipeline is done by connecting the inputs of one filter to the output of its predecessor.

Unlike the concept of a linear pipeline which gets fed with data at its head, ITK follows a different approach, a pull-pipeline:

Each filter is derived from the templated base class

itk::ImageToImageFilter< TInputImage, TOutputImage >

N linearily connected filters:

// create filters
ReaderType::Pointer reader = ReaderType::New();
Filter1Type::Pointer filter1 = Filter1Type::New();
Filter2Type::Pointer filter2 = Filter2Type::New();
...
FilterNType::Pointer filterN = Filter2Type::New();


// connect input of filters to output of predecessors
filter1->SetInput(reader->GetOutput());
filter2->SetInput(filter1->GetOutput());
...
filterN->SetInput(filterN-1->GetOutput());

Pull the pipeline:

filterN->Update()

Processed data is available as image on:

ImageType::ConstPointer image = filterN->getOutput();

Usually, the last filter is connected the output of an image writer.

Note: Graph must not contain loops.

Retrieved from http://schorsch.efi.fh-nuernberg.de/roettger/index.php/MedicalVisualization/ITKPipeline

Page last modified on December 10, 2013, at 02:15 PM