summaryrefslogtreecommitdiffstats
path: root/include/astra/ParallelBeamBlobKernelProjector2D.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/ParallelBeamBlobKernelProjector2D.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/ParallelBeamBlobKernelProjector2D.inl')
-rw-r--r--include/astra/ParallelBeamBlobKernelProjector2D.inl32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/astra/ParallelBeamBlobKernelProjector2D.inl b/include/astra/ParallelBeamBlobKernelProjector2D.inl
index 203eb51..1945cdd 100644
--- a/include/astra/ParallelBeamBlobKernelProjector2D.inl
+++ b/include/astra/ParallelBeamBlobKernelProjector2D.inl
@@ -31,21 +31,21 @@ template <typename Policy>
void CParallelBeamBlobKernelProjector2D::project(Policy& p)
{
projectBlock_internal(0, m_pProjectionGeometry->getProjectionAngleCount(),
- 0, m_pProjectionGeometry->getDetectorCount(), p);
+ 0, m_pProjectionGeometry->getDetectorCount(), p);
}
template <typename Policy>
void CParallelBeamBlobKernelProjector2D::projectSingleProjection(int _iProjection, Policy& p)
{
projectBlock_internal(_iProjection, _iProjection + 1,
- 0, m_pProjectionGeometry->getDetectorCount(), p);
+ 0, m_pProjectionGeometry->getDetectorCount(), p);
}
template <typename Policy>
void CParallelBeamBlobKernelProjector2D::projectSingleRay(int _iProjection, int _iDetector, Policy& p)
{
projectBlock_internal(_iProjection, _iProjection + 1,
- _iDetector, _iDetector + 1, p);
+ _iDetector, _iDetector + 1, p);
}
//----------------------------------------------------------------------------------------
@@ -53,12 +53,6 @@ void CParallelBeamBlobKernelProjector2D::projectSingleRay(int _iProjection, int
template <typename Policy>
void CParallelBeamBlobKernelProjector2D::projectBlock_internal(int _iProjFrom, int _iProjTo, int _iDetFrom, int _iDetTo, Policy& p)
{
- // variables
- float32 detX, detY, x, y, c, r, update_c, update_r, offset, invBlobExtent, inv_pixelLengthX, inv_pixelLengthY, weight, d;
- int iVolumeIndex, iRayIndex, row, col, iAngle, iDetector, colCount, rowCount, detCount;
- int col_left, col_right, row_top, row_bottom, index;
- const SParProjection * proj = 0;
-
// get vector geometry
const CParallelVecProjectionGeometry2D* pVecProjectionGeometry;
if (dynamic_cast<CParallelProjectionGeometry2D*>(m_pProjectionGeometry)) {
@@ -68,16 +62,22 @@ void CParallelBeamBlobKernelProjector2D::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, x, y, c, r, update_c, update_r, offset, invBlobExtent, weight, d;
+ int iVolumeIndex, iRayIndex, row, col, iDetector;
+ int col_left, col_right, row_top, row_bottom, index;
- proj = &pVecProjectionGeometry->getProjectionVectors()[iAngle];
+ const SParProjection * proj = &pVecProjectionGeometry->getProjectionVectors()[iAngle];
bool vertical = fabs(proj->fRayX) < fabs(proj->fRayY);
if (vertical) {