ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.19k stars 380 forks source link

Registration of Labelled Images vs Interpolation During Registration #1774

Closed alund closed 2 months ago

alund commented 2 months ago

I am trying to use antsRegistration to register a label image to another label image. I'm using mutual information as the metric, with the number of bins equal to the number of distinct (consecutive) labels. My expectation is that each label will end up in its own bin, and mutual information only cares about probabilities of the various bins (and therefore labels) being paired and not about the bin values themselves.

Interpolation of label values can cause this to break down if done improperly. Interpolating between label 5 and label 11 shouldn't yield label 8. Something like b-spline interpolation can, in some cases, yield values outside the original range of values, potentially distorting the histogram bins, though I'm not sure if the histogram bins used by MI are calculated before or after interpolation.

The command line help for antsRegistration as well as Anatomy of an antsRegistration call say that the interpolation specified with -n/--interpolation is only used to warp (and possibly inverse warp) the final output image(s). This seems to imply that any other interpolation done during the registration process is not affected by that flag and is, presumably, uncontrollable. Is this true? What kind of interpolation is done?

In my case, it's not that I don't get a registration, or that the registration is bad. The interpolation should only affect the borders between labels. The interiors where interpolation is not a large factor seem to be enough to keep things working. But maybe it could be better? Or are there other strategies for solving this problem that I should be considering?

gdevenyi commented 2 months ago

I don't have technical answers here, but previous work in registering label-like material I've seen was done by creating pseudo-mris from the label sets to more closely satisfy the assumptions of the registration tools, https://pubmed.ncbi.nlm.nih.gov/16406816/

cookpa commented 2 months ago

I'm not sure how the metric bins would line up in this case.

ANTs uses the default linear interpolator for the metrics, this is not modifiable from the command line.

ITK does have a label metric. It might be worth trying this out with SimpleITK.

For small numbers of labels, using multiple channels for the registration, with label probabilities and the MeanSquares metric, works pretty well, though I've usually used this in combination with scalar images (eg, T1w + a few labels).

Others recommend using a signed distance transform rather than a label probability (computed with SimpleITK or c3d) and the Mattes metric. Mattes works best on continuous images, it's not the best with hard binary label boundaries.

alund commented 2 months ago

Thank you @gdevenyi and @cookpa for the quick responses. That gives me some avenues for further exploration.