VectorImageToImageMetricTraitsv4 with VectorImage - dynamic number of components

Hello,

The intro text to Perform Registration on Vector Images — v5.3.0 suggests that that code can be used with a VectorImage. It uses VectorImageToImageMetricTraitsv4, and the docs for that class say it works with VectorImage. However, it takes VNumberOfComponents as a template parameter, while VectorImage can have a dynamic number of components.

Is there any way to do registration of vector images with a dynamic number of components, or must it be determined at compile-time?

Thanks,
Zach

1 Like

Hello Zach!

Welcome to the ITK community ! :sun_with_face:

To test this, a VariableLengthVectorImageToImageMetricTraitsv4 could be created. It looks like VectorImageToImageMetricTraitsv4 uses the NumberOfComponent to define the type for the gradients used by the metric. This would need to be changed to VectorImage to be dynamic.