[Insight-developers] Advice on implementing Physical Space Math Op filters.

Williams, Norman K norman-k-williams at uiowa.edu
Wed May 25 11:50:54 EDT 2011


We have a need for the various Math Operation filters --
itk::AddImageFilter, itk::SubtractImageFilter, etc to sometimes operate in
physical space.


Use case:  Add 2 images with different spacing, origin etc.

Right now there's an implicit assumption in classes derived from
itk::BinaryFunctorImageFilter.h, that the 2 input images have the same
size, and the operations take space in index space.

What I'd like to do is to add two methods to BinaryFunctorImageFilter:

void SetUsePhysicalSpace(bool);
void SetInterpolator(ImageFunction<TInputImage2,
                     TOutputImage::PixelType> *interpolator)

The Interpolator has to be an itk::ImageFunction, if we're going to
support Vector voxel types, as it's the common base class for
itk::InterpolateImageFunction and it::VectorInterpolateImageFunction.

The complication I'm not sure how to address: Are the
InterpolateImageFunction classes thread-safe, or do I need an interpolater
per thread?

If they aren't all thread-safe, then I need to instantiate an interpolator
per thread, which would require the Interpolator Type as a template
parameter. This would mean changing the template parameter signature for
every class derived from BinaryFunctorImageFilter.

Looking through the available interpolators, it looks like the should be
all thread-safe -- they have member data, but it looks to be data that
would be set once at initialization, and not written to during calls to
EvaluateAtContinuousIndex.



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list