[Insight-developers] Advice on filter writing -- 2 arrays of images as inputs?

Dan Mueller dan.muel at gmail.com
Wed Oct 7 10:55:30 EDT 2009


Hi Kent,

You can simply fake a 2-D array using the 1-D SetNthInput. For
example, if both arrays are of length 5, array A takes indices 0-4,
array B takes indices 5-9.

I used a similar pattern to support multilevel/multiband
inputs/outputs for wavelet-based quadrature mirror filters (QMF). It's
not a perfect implementation (I was still a noob when I wrote it), but
you might get some ideas:
    http://www.insight-journal.org/browse/publication/103

Particularly take a look at gift::MultilevelMultibandImageFilter.

Hope this helps.

Cheers, Dan

2009/10/7 Bradley Lowekamp <blowekamp at mail.nih.gov>:
> Hello Kent,
> That sounds like an interesting design problem. My first thought was to make
> the custom image array a data object, but that still would not let you use
> the ImageToImage filter and would require a rewriting that class.
> What about considering the input two vector images? If you can restrict the
> input to scalars, then you might be able to internally use two
> ImageToVectorImageFilters?
> Just a thought hope it helps,
> Brad
> On Oct 6, 2009, at 6:09 PM, kent williams wrote:
>
> I have been assigned the task of converting one of those faux-ITK filters
> that people write -- you know, where they have SetInput(s), Update() and
> GetOutput(s) but it's not actually a pipeline-compatible filter -- into an
> actual ITK filter.
>
> What's blowing my mind about it is that as it stands, it takes as inputs two
> arrays of images. Not an itk::Array or itk::Vector, but a homegrown array
> class.
>
> My question is this: What is the most ITK-esque way to handle two sets of
> multiple image inputs?  SetNthInput seems fine for a class with only one
> array of homogenous inputs, but I don't know what to do with a second array.
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
> ========================================================
>
> Bradley Lowekamp
>
> Lockheed Martin Contractor for
>
> Office of High Performance Computing and Communications
>
> National Library of Medicine
>
> blowekamp at mail.nih.gov
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
>


More information about the Insight-developers mailing list