cicwi/WalnutReconstructionCodes

About pixel and detector center

Closed this issue · 1 comments

lets consider a projection image with resolution of w*h.
We first assume that the physical coordinate of pixel is defined at its center point.
If w is odd, for example w=3, then the detector center in pixel space could be denoted as (0,0).
But if w is even, for example w=4, there will be no corresponding pixel to the detector center, in other words, detector center could not be represented in pixel space, and there will be no pixel (0,0)
as shown in the appending fig.

oddeven pixel

now given a pixel (m,n), and the detector center point c in world space, we aim to obtain the physical coordinate x of the given pixel.
the horizontal basis vector is u, the vertical basis vector is v.
if w/h is odd, (w/h=3, m/n=-1,0,1), then x could be given by
x = c + mu + nv
if w/h is even, (w/h=4, m/n=-2,-1,1,2), then x could be given by
x = c + (m-sign(m)*0.5)u + (n-sign(n)*0.5)v

is that clear? how would you solve such odd/even ambiguity?

I have solved this issue. we need first derive the coords of pixel (0,0) x_00. then we could get the coords of pixel (m,n) x_mn
x_00 = c - (floor(w/2) + floor((w+1)/2) - (w+1)/2) u - (floor(h/2) + floor((h+1)/2) - (h+1)/2) v
x_mn = x_00 + mu + nv
it carefully solve the odd/even ambiguity.