summaryrefslogtreecommitdiffstats
path: root/src/ParallelBeamLinearKernelProjector2D.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2019-02-19 10:47:45 +0100
committerGitHub <noreply@github.com>2019-02-19 10:47:45 +0100
commit3d07f5b107eeb796573d4a74e46367cf1bfb2abf (patch)
tree63b9edf1c08fdbc50acdb61c737417b56aa7e7d1 /src/ParallelBeamLinearKernelProjector2D.cpp
parent8190865b347cd358966855519bffa64eb33a636f (diff)
parent22342b7a1bd169c474cf323709e36f553ac4aee1 (diff)
downloadastra-3d07f5b107eeb796573d4a74e46367cf1bfb2abf.tar.gz
astra-3d07f5b107eeb796573d4a74e46367cf1bfb2abf.tar.bz2
astra-3d07f5b107eeb796573d4a74e46367cf1bfb2abf.tar.xz
astra-3d07f5b107eeb796573d4a74e46367cf1bfb2abf.zip
Merge pull request #183 from wjp/par2d_dd
Add basic implementation of par2d CPU Distance Driven projector
Diffstat (limited to 'src/ParallelBeamLinearKernelProjector2D.cpp')
-rw-r--r--src/ParallelBeamLinearKernelProjector2D.cpp61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/ParallelBeamLinearKernelProjector2D.cpp b/src/ParallelBeamLinearKernelProjector2D.cpp
index 5ca1082..120b1a2 100644
--- a/src/ParallelBeamLinearKernelProjector2D.cpp
+++ b/src/ParallelBeamLinearKernelProjector2D.cpp
@@ -158,64 +158,3 @@ void CParallelBeamLinearKernelProjector2D::computeSingleRayWeights(int _iProject
projectSingleRay(_iProjectionIndex, _iDetectorIndex, p);
_iStoredPixelCount = p.getStoredPixelCount();
}
-
-//----------------------------------------------------------------------------------------
-// Splat a single point
-std::vector<SDetector2D> CParallelBeamLinearKernelProjector2D::projectPoint(int _iRow, int _iCol)
-{
- float32 xUL = m_pVolumeGeometry->pixelColToCenterX(_iCol) - m_pVolumeGeometry->getPixelLengthX() * 1.5f;
- float32 yUL = m_pVolumeGeometry->pixelRowToCenterY(_iRow) - m_pVolumeGeometry->getPixelLengthY() * 1.5f;
- float32 xUR = m_pVolumeGeometry->pixelColToCenterX(_iCol) + m_pVolumeGeometry->getPixelLengthX() * 1.5f;
- float32 yUR = m_pVolumeGeometry->pixelRowToCenterY(_iRow) - m_pVolumeGeometry->getPixelLengthY() * 1.5f;
- float32 xLL = m_pVolumeGeometry->pixelColToCenterX(_iCol) - m_pVolumeGeometry->getPixelLengthX() * 1.5f;
- float32 yLL = m_pVolumeGeometry->pixelRowToCenterY(_iRow) + m_pVolumeGeometry->getPixelLengthY() * 1.5f;
- float32 xLR = m_pVolumeGeometry->pixelColToCenterX(_iCol) + m_pVolumeGeometry->getPixelLengthX() * 1.5f;
- float32 yLR = m_pVolumeGeometry->pixelRowToCenterY(_iRow) + m_pVolumeGeometry->getPixelLengthY() * 1.5f;
-
- std::vector<SDetector2D> res;
- // loop projectors and detectors
- for (int iProjection = 0; iProjection < m_pProjectionGeometry->getProjectionAngleCount(); ++iProjection) {
-
- // get projection angle
- float32 theta = m_pProjectionGeometry->getProjectionAngle(iProjection);
- if (theta >= 7*PIdiv4) theta -= 2*PI;
- bool inverse = false;
- if (theta >= 3*PIdiv4) {
- theta -= PI;
- inverse = true;
- }
-
- // calculate distance from the center of the voxel to the ray though the origin
- float32 tUL = xUL * cos(theta) + yUL * sin(theta);
- float32 tUR = xUR * cos(theta) + yUR * sin(theta);
- float32 tLL = xLL * cos(theta) + yLL * sin(theta);
- float32 tLR = xLR * cos(theta) + yLR * sin(theta);
- if (inverse) {
- tUL *= -1.0f;
- tUR *= -1.0f;
- tLL *= -1.0f;
- tLR *= -1.0f;
- }
- float32 tMin = min(tUL, min(tUR, min(tLL,tLR)));
- float32 tMax = max(tUL, max(tUR, max(tLL,tLR)));
-
- // calculate the offset on the detectorarray (in indices)
- int dmin = (int)floor(m_pProjectionGeometry->detectorOffsetToIndexFloat(tMin));
- int dmax = (int)ceil(m_pProjectionGeometry->detectorOffsetToIndexFloat(tMax));
-
- // add affected detectors to the list
- for (int i = dmin; i <= dmax; ++i) {
- if (i >= 0 && i < m_pProjectionGeometry->getDetectorCount()) {
- SDetector2D det;
- det.m_iAngleIndex = iProjection;
- det.m_iDetectorIndex = i;
- det.m_iIndex = iProjection * getProjectionGeometry()->getDetectorCount() + i;
- res.push_back(det);
- }
- }
- }
-
- // return result vector
- return res;
-
-}