ENH: Check rotation axis is along Y in FDK reconstruction - #998
Conversation
SimonRit
left a comment
There was a problem hiding this comment.
Thanks for taking care of this. I'd suggest to allow some (possibly configurable) tolerance
| if (std::abs(matrices[i][1][0]) > 1e-6 || std::abs(matrices[i][1][1] - 1.) > 1e-6 || | ||
| std::abs(matrices[i][1][2]) > 1e-6) |
There was a problem hiding this comment.
Too strong, we want to allow some misalignment. I would suggest checking the dot product between this second column vector and (0,1,0) and to checking it's not below a certain threshold, e.g. sqrt(3)/2 (i.e., cos(pi)/6)
ded8ad1 to
14ac0ef
Compare
SimonRit
left a comment
There was a problem hiding this comment.
Thanks for your efforts! Can be merged when the CI will be green.
| { | ||
| // Dot product between the second column vector of the rotation matrix and (0,1,0), | ||
| // normalized to obtain the cosine of the angle with the Y axis | ||
| const double norm = std::sqrt(matrices[i][1][0] * matrices[i][1][0] + matrices[i][1][1] * matrices[i][1][1] + |
There was a problem hiding this comment.
Each column of a rotation matrix is a unit vector I believe so norm can be dropped I think.
There was a problem hiding this comment.
Each column of a rotation matrix is a unit vector I believe so norm can be dropped I think.
Right, I fixed it, thanks !
Fix #335