[Insight-developers] RE: Insight code walkthrough
Luis Ibanez
ibanez@choroid.cs.unc.edu
Tue, 25 Sep 2001 18:01:37 -0400 (EDT)
Jim,
Ok,
I agree with you in that it is better to have a
separate Add filter for multiple inputs.
So, an itkNaryImageFilter was introduced in order to manage
any number of inputs and apply the same operation to all
of them in order to produce the output. This is the Nth
equivalent of the BinaryImageFilter or the UnaryImageFilter.
All the input images are assumed to be of the same type.
Deriving from it, an itkAddImageFilter was added, and the
previous one (the binary) was renamed itkAdd2ImageFilter.
itkAdd2ImageFilter should be much more efficient, so it
should be prefered for the specific case of 2 inputs.
---
Streaming seems to be ok, but
with respect to multithreading I'm not that sure,
If you have a chance, could you please take a look at
it and verify that things are well configured ?
Thanks
Luis
-------
On Tue, 25 Sep 2001, Miller, James V (CRD) wrote:
> Luis,
>
> Will and I went through your modifications yesterday. The spreadsheet has been updated.
>
> One point: You indicated that the AddImageFilter couldn't be set up to handle an arbitrary number of
> inputs because you have to do a
>
> foreach image
> foreach pixel in region
> accumulate pixel
>
> and you felt that this would not stream. In actually, this would stream very nicely. The output
> requested region would propagate to all the inputs (all inputs would have the same requested region).
> So each input would have the same "stream" region to operate on.
>
> Now, due to templating, we might want to have a separate filter for such an operation that would
> force all the input images to be the same "type". So there would only be a single input image
> template parameter and a single output image template parameter.
>