I split the topic because I interpreted the same way it as you @muratmaga but I’ve read it again and realized that maybe @learn_shape refers to the C-arm angles?
Those angles are defined in DICOM. The primary positioner angle is indeed allowed to be in the +/-180deg range, while the secondary angle is always between +/-90deg. You can get the +/-180deg range if you switch to use atan2 in the script. The end result will be something like this:
nx = viewNormal[0] # R
ny = viewNormal[1] # A
nz = viewNormal[2] # S
import math
if abs(ny) > 1e-6:
primaryAngleDeg = math.atan2(nx, -ny) * 180.0 / math.pi
elif nx >= 0:
primaryAngleDeg = 90.0
else:
primaryAngleDeg = -90.0
secondaryAngleDeg = math.asin(nz) * 180.0 / math.pi
return [primaryAngleDeg, secondaryAngleDeg]