## 3 Methods  
To better utilize the image anatomical information of CT and MRI modalities, we propose an image registration framework named DTR-GAN. The network structure is depicted in Figure 1. DTR-GAN comprises a registration network and a dual contrastive learning translation network based on the GAN, named DT-GAN, to achieve end-to-end registration.  
The bidirectional translation network DT-GAN includes TP and TR networks, which represent the two mapping directions from the source image \(X\) to the target image \(Y\) and the target image \(Y\) to the source image \(X\), respectively. Inspired by VoxelMorph, we employ a registration network that consists of U-net [29] and a Spatial Transformer Network (STN) [30] to warp the source image into the warped image. When the source image \(X\) and target image \(Y\) are used as input, the registration network R predicts an optimal mapping \(\phi\) to achieve an excellent alignment of the warped image \(X^{{}^{\prime}}_{w}\) with the target image \(Y\). Meanwhile, translation networks TP and TR take \(X\) and \(Y\) as inputs, respectively, to output the transformed images \(Y^{{}^{\prime}}\) and \(X^{{}^{\prime}}\). The STN transforms the input images into warped images, where the source image \(X\) is warped into the registered image \(X^{{}^{\prime}}_{w}\) and the translated image \(Y^{{}^{\prime}}\) is warped into the registered image \(Y^{{}^{\prime}}_{w}\). The entire process can be summarized as follows:  
\[\left\{\begin{aligned} \phi&=R(X,Y)\\ Y^{{}^{\prime}}&=TP(X)\\ X^{{}^{\prime}}&=TR(Y)\\ Y^{{}^{\prime}}_{w}&=STN(Y^{{}^{\prime}},\phi)=Y^{{}^{ \prime}}\circ\phi=R(TP(X),R(X,Y))\\ X^{{}^{\prime}}_{w}&=STN(X,\phi)=X\circ\phi=R(X,R(X,Y))\end{aligned}\right. \tag{1}\]  
Figure 1: (**A**) shows the structure of the DTR-GAN framework. DTR-GAN consists of TP, R, and TR networks. Our proposed method learns two mappings between MRI and CT images in the translation network, which simplifies the complex multimodal image registration to unimodal image registration. (**B**) shows the structure of the translation network TP for \(X\to Y\) transformation. (**C**) depicts the structure of the translation network TR for \(Y\to X\) transformation.  
The loss of the translation network includes the adversarial loss, \(L_{GAN}\); contrastive loss, \(L_{PatchNCE_{X}}(TP,H_{X},H_{Y},X)\) and \(L_{PatchNCE_{X}}(TR,H_{X},H_{Y},Y)\); and similarity loss, \(L_{sim_{X}}(TP,TR)\) and \(L_{sim_{Y}}(TP,TR)\). Adversarial loss \(L_{GAN}\) strives to minimize the disparity between the generated image and the corresponding target image, contrastive loss keeps the original structure of the image to retain the shape consistency in the image-to-image translation, and similarity loss avoids mode collapse in the translation process. The loss of the registration network includes the mixed similarity loss, \(L_{reg}(R)\) and \(L(TP,R)\), as well as the smooth loss \(L_{smooth}(\phi)\), which maintains the appearance consistency between the warped image \(X^{{}^{\prime}}_{w}\) and the target image \(Y\), making the warped transformed image \(Y^{{}^{\prime}}_{w}\) and target image \(Y\) consistent in appearance. The smooth loss \(L_{smooth}(\phi)\) is utilized to prevent the discontinuity in the deformation field. The detailed calculation procedure for each loss function is shown in the subsequent section.