cwmok / C2FViT

This is the official Pytorch implementation of "Affine Medical Image Registration with Coarse-to-Fine Vision Transformer" (CVPR 2022), written by Tony C. W. Mok and Albert C. S. Chung.
MIT License
132 stars 4 forks source link

Integrate affine transformation #10

Closed cong-code closed 1 year ago

cong-code commented 1 year ago

Hi, how to integrate multiple affine parameters obtained from coarse-to-fine registration into one finnal affine parameter?

cwmok commented 1 year ago

Hi @cong-code,

In short, we don't integrate multiple affine parameters. We found that it is the best to simply use the affine parameters from the final stage (the finest resolution).

cong-code commented 1 year ago

Thank you for your reply. If I want to integrate multiple affine transformations, should I add them directly as the final result?

cwmok commented 1 year ago

No, you should do the affine matrix multiplication instead of addition.

cong-code commented 1 year ago

Understand, does the affine matrix refer to the 3X4 transformation matrix? Shall I directly use the one-dimensional vector output by the final model for multiplication?

cwmok commented 1 year ago

Yes, the affine matrix is the 3x4 transformation. You have to pad it to 4x4 in order to do the matrix multiplication.

cong-code commented 1 year ago

Thanks !