The system for calculating patient positional displacement between DRs and DRRs was developed based on a 2D‐3D registration algorithm.14, 15, 16 The system can calculate the positional displacements between the DR and DRR. A flowchart of the calculation algorithm for our system is shown in Fig. 2. The system uses two main procedures, which are 2D matching and roll optimization. The 2D matching step is intended to reduce the calculation costs, as the creation of DRRs, which have a very high calculation cost, only then occurs in the first iteration. The investigation of patient positional displacement between the DR and DRR optimized six parameters d=(dx,dy,dz,dθx,dθy,dθz), indicating lateral, longitudinal, and vertical directions and pitch, roll, and rotation, respectively. The value d0=(dx,dyV,dθz) was optimized on the vertical images for 2D matching; d1=(dz,dyH,dθx) was optimized on the horizontal images for 2D matching. The variables indicate the lateral axis, vertical axis, and rotation on each image. After 2D matching, dy was calculated as dy=(dyV+dyH)/2. Additionally, d2=dθy was optimized on both images for roll optimization. When d2 was calculated in the roll optimization step, the other five parameters (dx,dy,dz,dθx,dθz), calculated in the 2D matching steps, were directly used. The steepest descent method and the golden section method were used to optimize 2D matching; the golden section method was used for roll optimization.