InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

Add MatchCardinalityImageToImageMetricv4 for registration of labelmaps

Open
#3,934 5 comments 0 reactions 0 assignees View on GitHub
type:Enhancement
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

### Description

Currently, there is no Match Cardinality metric compatible with the "v4" registration framework.

I can use the mean square metric for binary mask registration, but to register a labelmap with many labels the difference between label `1` and `2` is penalized less than the difference between `1` and `500`. This can be managed to some extend via remapping labels and for a few labels, but does not scale.

I could one-hot encode the labelmap and use the mean square metric, since it supports vector images. This is not so bad, but probably increases memory consumption and increases the metric computation time linearly with the number of labels. Currently this workaround is not [supported by the Python wrapping](https://github.com/InsightSoftwareConsortium/ITK/blob/f0d342e0b81e690194cd3fe993316bca7570402b/Modules/Registration/Metricsv4/wrapping/itkMeanSquaresImageToImageMetricv4.wrap#L2).

### Expected behavior

It would be nice if there was a `MatchCardinalityImageToImageMetricv4`, i.e. a match cardinality metric for the v4 registration framework.

Only the v4 registration framework is supported by SimpleITK, so adding this metric would benefit SimpleITK users (see https://github.com/SimpleITK/SimpleITK/issues/1896).

As a workaround (for python users), wrapping MeanSquaresImageToImageMetricv4 for vector real types (`{WRAP_ITK_VECTOR_REAL}`) would be needed to use one-hot encoded labelmaps.
**CORRECTION**: Looking at `VectorImageToImageMetricTraitsv4`, it seems the framework must be compiled for a fixed number of components/channels.

### Actual behavior

1. It does not exist
2. The metric (and vectorimage + mean square metric) workaround is not available in ITK Python and SimpleITK

### Additional Information

I had a look into writing this new class based on the `MeanSquaresImageToImageMetricv4`, but am unsure how the [moving image gradient](https://github.com/InsightSoftwareConsortium/ITK/blob/f0d342e0b81e690194cd3fe993316bca7570402b/Modules/Registration/Metricsv4/include/itkMeanSquaresImageToImageMetricv4GetValueAndDerivativeThreader.hxx#L79) should be handled.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.