summaryrefslogtreecommitdiffstats
path: root/include/astra/ParallelBeamLineKernelProjector2D.inl
diff options
context:
space:
mode:
authorWim van Aarle <wimvanaarle@gmail.com>2015-05-26 15:43:08 +0200
committerWim van Aarle <wimvanaarle@gmail.com>2015-05-26 15:43:08 +0200
commit3117c7a61a83ca28ba00211d1eb65eaf13a7307a (patch)
tree4851ae878cf499deb2ae2f77575b3c48ecaf5d04 /include/astra/ParallelBeamLineKernelProjector2D.inl
parent9e884e760b71be354c08892f6bce2efe723917b3 (diff)
parent57668bcdd086145eb14598e32fd5d0dca711865c (diff)
downloadastra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.tar.gz
astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.tar.bz2
astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.tar.xz
astra-3117c7a61a83ca28ba00211d1eb65eaf13a7307a.zip
Merge remote-tracking branch 'upstream/master' into parallel_vec
Conflicts: astra_vc11.vcxproj.filters python/astra/functions.py src/ParallelBeamBlobKernelProjector2D.cpp src/ProjectionGeometry2D.cpp
Diffstat (limited to 'include/astra/ParallelBeamLineKernelProjector2D.inl')
-rw-r--r--include/astra/ParallelBeamLineKernelProjector2D.inl26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/astra/ParallelBeamLineKernelProjector2D.inl b/include/astra/ParallelBeamLineKernelProjector2D.inl
index dc3153d..9c58d60 100644
--- a/include/astra/ParallelBeamLineKernelProjector2D.inl
+++ b/include/astra/ParallelBeamLineKernelProjector2D.inl
@@ -55,12 +55,6 @@ void CParallelBeamLineKernelProjector2D::projectSingleRay(int _iProjection, int
template <typename Policy>
void CParallelBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, int _iProjTo, int _iDetFrom, int _iDetTo, Policy& p)
{
- // variables
- float32 detX, detY, S, T, I, x, y, c, r, update_c, update_r, offset;
- float32 lengthPerRow, lengthPerCol, inv_pixelLengthX, inv_pixelLengthY, invTminSTimesLengthPerRow, invTminSTimesLengthPerCol;
- int iVolumeIndex, iRayIndex, row, col, iAngle, iDetector, colCount, rowCount, detCount;
- const SParProjection * proj = 0;
-
// get vector geometry
const CParallelVecProjectionGeometry2D* pVecProjectionGeometry;
if (dynamic_cast<CParallelProjectionGeometry2D*>(m_pProjectionGeometry)) {
@@ -70,16 +64,22 @@ void CParallelBeamLineKernelProjector2D::projectBlock_internal(int _iProjFrom, i
}
// precomputations
- inv_pixelLengthX = 1.0f / m_pVolumeGeometry->getPixelLengthX();
- inv_pixelLengthY = 1.0f / m_pVolumeGeometry->getPixelLengthY();
- colCount = m_pVolumeGeometry->getGridColCount();
- rowCount = m_pVolumeGeometry->getGridRowCount();
- detCount = pVecProjectionGeometry->getDetectorCount();
+ const float32 inv_pixelLengthX = 1.0f / m_pVolumeGeometry->getPixelLengthX();
+ const float32 inv_pixelLengthY = 1.0f / m_pVolumeGeometry->getPixelLengthY();
+ const int colCount = m_pVolumeGeometry->getGridColCount();
+ const int rowCount = m_pVolumeGeometry->getGridRowCount();
+ const int detCount = pVecProjectionGeometry->getDetectorCount();
// loop angles
- for (iAngle = _iProjFrom; iAngle < _iProjTo; ++iAngle) {
+ #pragma omp parallel for
+ for (int iAngle = _iProjFrom; iAngle < _iProjTo; ++iAngle) {
+
+ // variables
+ float32 detX, detY, S, T, I, x, y, c, r, update_c, update_r, offset;
+ float32 lengthPerRow, lengthPerCol, invTminSTimesLengthPerRow, invTminSTimesLengthPerCol;
+ int iVolumeIndex, iRayIndex, row, col, iDetector;
- proj = &pVecProjectionGeometry->getProjectionVectors()[iAngle];
+ const SParProjection * proj = &pVecProjectionGeometry->getProjectionVectors()[iAngle];
bool vertical = fabs(proj->fRayX) < fabs(proj->fRayY);
if (vertical) {