Voxel wise multiplication of vector images and vector constants

(Gabriel A. Devenyi) #1

I’m working on cleaning up the MINC support (IO and Transforms) in ITK, and my last step is to properly handle the MINC non-linear deformation files. The major change is to convert the coordinate system every single voxel vector element from RAS to LPS, equivalent to multiplication with (-1,-1,0). See https://github.com/InsightSoftwareConsortium/ITK/pull/147

From my reading, https://itk.org/Doxygen/html/classitk_1_1MultiplyImageFilter.html doesn’t seem to support templating (is that the right term?) over a vector, only images, or constants.

So the question arises, do I write some special code for the TransforMINC module, or do I make some modifications to the MultiplyImageFilter. Would there be other users of such functionality?

(Bradley Lowekamp) #2

I would just use the unary functor generator filter with a lambda expression.

I can post more details if you need them when I’m available.


(Gabriel A. Devenyi) #3

This filter does indeed look like what I want to do.

I’ll take a look at the examples and see if I can successfully copy the methods and apply it.

I’ll follow up if I have any questions.

(Matt McCormick) #4

Depending on the implementation, directly using itk::MultiThreaderBase::ParallelizeImageRegion may be preferred to avoid the filter call.

(Gabriel A. Devenyi) #5

Thanks @matt.mccormick

I went the ParallelizeImageRegion route and now have an addition to my patch at https://github.com/InsightSoftwareConsortium/ITK/pull/147