for row,col in ti.ndrange(view_num,dect_elem_count_horizontal_oversamplesize):
xs = sid * ti.cos(array_angel_taichi[row])
# if row == 10 and col == 10:
# print(xs)
ys = sdd * ti.sin(array_angel_taichi[row])
zs = 0
if self.curved_dect:
gamma_prime = (array_u_taichi[col] + offcenter_bias) / sdd
xd = -sdd * ti.cos(array_angel_taichi[row] + gamma_prime) + sid * ti.cos(array_angel_taichi[row])
yd = -sdd * ti.sin(array_angel_taichi[row] + gamma_prime) + sid * ti.sin(array_angel_taichi[row])
else:
xd = -(sdd - sid) * ti.cos(array_angel_taichi[row]) + (array_u_taichi[col] + offcenter_bias) * ti.cos(array_angel_taichi[row] - PI / 2.0)
if row == 10 and col == 10:
print(xd)
yd = -(sdd - sid) * ti.sin(array_angel_taichi[row]) + (array_u_taichi[col] + offcenter_bias) * ti.sin(array_angel_taichi[row] - PI / 2.0)
# source to detector element distance
if row == 10 and col == 10:
print(xd)
这种情况 输出两个都是相同的数值-16.908978
-16.908978
但是将if中的self去掉 调用形参 出了if循环之后值就会一直在变是为啥。(形参里调用的时候就是传的self.curved_dect)