BUG: var/shapes.py frame_center() returns a float
As of now, the radon cost functions simply take the floor value of the center of the frame. While this is expected for frames with an odd pixel size, this choice should be investigated further for even sized frames (ceil? sum(floor+ceil)?).
@@ -537,7 +537,7 @@ def _radon_costf(frame, cent, radint, coords):
theta = np.linspace(start=0, stop=360, num=frame_shifted_ann.shape[0],
endpoint=False)
sinogram = radon(frame_shifted_ann, theta=theta, circle=True)
- costf = np.sum(np.abs(sinogram[cent,:]))
+ costf = np.sum(np.abs(sinogram[int(cent),:]))
return costf
@@ -557,7 +557,7 @@ def _radon_costf2(frame, cent, radint, coords):
endpoint=False)))
sinogram = radon(frame_shifted_ann, theta=theta, circle=True)
- costf = np.sum(np.abs(sinogram[cent,:]))
+ costf = np.sum(np.abs(sinogram[int(cent),:]))
return costf
