Use an exisitng projective matrix for generating DRRs
Is it possible to generate DRRs based on an existing projective matrix?
I did a room geometry calibration which resulted in a 3x4 projective matrix (DICOM coordinate in mm to pixel coordinate on flat panel detector), and I'd like to generate a DRR based on a CT and this projective matrix. I tried to decompose that projective matrix into the various parameters (-r, -c, -g etc...) that plastimatch/drr takes, but I am not sure how to do so cleanly. If I prioritize the fact that the rotational matrix is orthogonal, then I can use QR decomposition to decompose the projective matrix. But doing use would result in rectangular-shaped pixels (different alpha and beta in https://plastimatch.org/proj_mat_file_format.html)
I skimmed through the source code, and it seems that this can be implemented somewhere in void drr_render_volume_perspective
by directly reading a projective matrix from argument into Proj_matrix *pmat
, without calculating anything else, but I don't know nearly enough about the code to implement this myself.
Thank you for your consideration.