Updated input during runtime

(Gordian) #1


i have a question regarding dynamic input into a running pipeline that takes a while to finish.
If I start a registration pipeline, it is possible to update the input (e.g. the input source spawned a new image).

Therefore I need a listener that singals a new image and update the image reader to read in the new image. The pipeline should replace the current input image with the new image in the next iteration.
(In the case of a registration the current transformation should be kept because it should not start all over again.)

Does ITK provide this functionality?
Thanks in advance.

(Matt McCormick) #2

Hello @Gordian,

The ITKv4 Registration Framework, i.e. itk::ImageRegistrationMethodv4 works with the ITK pipeline model. That is, it will not require re-reading or re-preprocessing the inputs unless they have changed. If you want to re-use the output transform from a previous run as the initial transform for a subsequent Update, then that should be called explicitly.


(Gordian) #3

The part with the changing input is the case I wanted to discuss.
I start the registration and before the registration finished a new input image is provided. The new input image is not very different from the old one. I can use the last computed transformation as the initiat transform input.
But as far as I see I have to stop the current registration process. Get the last computed transform and start a new registration process with the new input image.
So I need to provide a observer that triggers an Event if new images are appear.
Can I use the itk::Events for this?


(Matt McCormick) #4

When the new image comes in, you could try calling AbortGenerateData() on the itk::ImageRegistrationMethodv4, then take the output transform and use it as the initial transform (I have not tested this, though).