- // Calculate initial rotation matrix
- GRFMTX_2D rotmtx_initial, temp;
- xlat_mtx2 (rotmtx_initial, -m_dXCenter, -m_dYCenter);
- rot_mtx2 (temp, start_angle);
- mult_mtx2 (rotmtx_initial, temp, rotmtx_initial);
- xlat_mtx2 (temp, m_dXCenter, m_dYCenter);
- mult_mtx2 (rotmtx_initial, temp, rotmtx_initial);
-
- double xd1=0, yd1=0, xd2=0, yd2=0;
- if (m_idGeometry != GEOMETRY_EQUIANGULAR) {
- xd1 = m_initPos.xd1;
- yd1 = m_initPos.yd1;
- xd2 = m_initPos.xd2;
- yd2 = m_initPos.yd2;
- xform_mtx2 (rotmtx_initial, xd1, yd1); // rotate detector endpoints
- xform_mtx2 (rotmtx_initial, xd2, yd2); // to initial view_angle
- }
-
- double xs1 = m_initPos.xs1;
- double ys1 = m_initPos.ys1;
- double xs2 = m_initPos.xs2;
- double ys2 = m_initPos.ys2;
- xform_mtx2 (rotmtx_initial, xs1, ys1); // rotate source endpoints to
- xform_mtx2 (rotmtx_initial, xs2, ys2); // initial view angle
-
- int iView;
- double viewAngle;
- for (iView = 0, viewAngle = start_angle; iView < iNumViews; iView++, viewAngle += proj.rotInc()) {
+ for (int iView = 0; iView < iNumViews; iView++) {
+ double viewAngle = start_angle + (iView * proj.rotInc());
+
+ // With OpenMP, need to calculate source and detector positions at each view
+ GRFMTX_2D rotmtx;
+ mtx2_offset_rot (rotmtx, viewAngle, m_dXCenter, m_dYCenter);
+ double xd1=0, yd1=0, xd2=0, yd2=0;
+ if (m_idGeometry != GEOMETRY_EQUIANGULAR) {
+ xd1 = m_initPos.xd1; yd1 = m_initPos.yd1;
+ xd2 = m_initPos.xd2; yd2 = m_initPos.yd2;
+ xform_mtx2 (rotmtx, xd1, yd1); // rotate detector endpoints
+ xform_mtx2 (rotmtx, xd2, yd2); // to initial view_angle
+ }
+
+ double xs1 = m_initPos.xs1, ys1 = m_initPos.ys1;
+ double xs2 = m_initPos.xs2, ys2 = m_initPos.ys2;
+ xform_mtx2 (rotmtx, xs1, ys1); // rotate source endpoints to
+ xform_mtx2 (rotmtx, xs2, ys2); // initial view angle
+