diff options
-rw-r--r-- | include/astra/ConeProjectionGeometry3D.h | 6 | ||||
-rw-r--r-- | include/astra/ConeVecProjectionGeometry3D.h | 6 | ||||
-rw-r--r-- | include/astra/ParallelProjectionGeometry3D.h | 7 | ||||
-rw-r--r-- | include/astra/ParallelVecProjectionGeometry3D.h | 6 | ||||
-rw-r--r-- | include/astra/ProjectionGeometry3D.h | 15 | ||||
-rw-r--r-- | src/ConeProjectionGeometry3D.cpp | 79 | ||||
-rw-r--r-- | src/ConeVecProjectionGeometry3D.cpp | 54 | ||||
-rw-r--r-- | src/GeometryUtil3D.cpp | 84 | ||||
-rw-r--r-- | src/ParallelProjectionGeometry3D.cpp | 73 | ||||
-rw-r--r-- | src/ParallelVecProjectionGeometry3D.cpp | 55 |
10 files changed, 0 insertions, 385 deletions
diff --git a/include/astra/ConeProjectionGeometry3D.h b/include/astra/ConeProjectionGeometry3D.h index c1750b0..8e811ea 100644 --- a/include/astra/ConeProjectionGeometry3D.h +++ b/include/astra/ConeProjectionGeometry3D.h @@ -188,12 +188,6 @@ public: virtual void projectPoint(double fX, double fY, double fZ, int iAngleIndex, double &fU, double &fV) const; - virtual void backprojectPointX(int iAngleIndex, double fU, double fV, - double fX, double &fY, double &fZ) const; - virtual void backprojectPointY(int iAngleIndex, double fU, double fV, - double fY, double &fX, double &fZ) const; - virtual void backprojectPointZ(int iAngleIndex, double fU, double fV, - double fZ, double &fX, double &fY) const; }; diff --git a/include/astra/ConeVecProjectionGeometry3D.h b/include/astra/ConeVecProjectionGeometry3D.h index 81adb98..924b89b 100644 --- a/include/astra/ConeVecProjectionGeometry3D.h +++ b/include/astra/ConeVecProjectionGeometry3D.h @@ -150,12 +150,6 @@ public: virtual void projectPoint(double fX, double fY, double fZ, int iAngleIndex, double &fU, double &fV) const; - virtual void backprojectPointX(int iAngleIndex, double fU, double fV, - double fX, double &fY, double &fZ) const; - virtual void backprojectPointY(int iAngleIndex, double fU, double fV, - double fY, double &fX, double &fZ) const; - virtual void backprojectPointZ(int iAngleIndex, double fU, double fV, - double fZ, double &fX, double &fY) const; protected: virtual bool initializeAngles(const Config& _cfg); diff --git a/include/astra/ParallelProjectionGeometry3D.h b/include/astra/ParallelProjectionGeometry3D.h index d4b34ea..998decc 100644 --- a/include/astra/ParallelProjectionGeometry3D.h +++ b/include/astra/ParallelProjectionGeometry3D.h @@ -149,13 +149,6 @@ public: virtual void projectPoint(double fX, double fY, double fZ, int iAngleIndex, double &fU, double &fV) const; - virtual void backprojectPointX(int iAngleIndex, double fU, double fV, - double fX, double &fY, double &fZ) const; - virtual void backprojectPointY(int iAngleIndex, double fU, double fV, - double fY, double &fX, double &fZ) const; - virtual void backprojectPointZ(int iAngleIndex, double fU, double fV, - double fZ, double &fX, double &fY) const; - /** * Creates (= allocates) a 2D projection geometry used when projecting one slice using a 2D projector diff --git a/include/astra/ParallelVecProjectionGeometry3D.h b/include/astra/ParallelVecProjectionGeometry3D.h index 01e7295..a937c17 100644 --- a/include/astra/ParallelVecProjectionGeometry3D.h +++ b/include/astra/ParallelVecProjectionGeometry3D.h @@ -151,12 +151,6 @@ public: virtual void projectPoint(double fX, double fY, double fZ, int iAngleIndex, double &fU, double &fV) const; - virtual void backprojectPointX(int iAngleIndex, double fU, double fV, - double fX, double &fY, double &fZ) const; - virtual void backprojectPointY(int iAngleIndex, double fU, double fV, - double fY, double &fX, double &fZ) const; - virtual void backprojectPointZ(int iAngleIndex, double fU, double fV, - double fZ, double &fX, double &fY) const; protected: virtual bool initializeAngles(const Config& _cfg); diff --git a/include/astra/ProjectionGeometry3D.h b/include/astra/ProjectionGeometry3D.h index a665c6c..2cff9f1 100644 --- a/include/astra/ProjectionGeometry3D.h +++ b/include/astra/ProjectionGeometry3D.h @@ -320,21 +320,6 @@ public: int iAngleIndex, double &fU, double &fV) const = 0; - /* Backproject a point onto a plane parallel to a coordinate plane. - * The 2D point coordinates are the (unrounded) indices of the detector - * column and row. The output is in 3D coordinates in units. - * are in units. The output fU,fV are the (unrounded) indices of the - * detector column and row. - * This may fall outside of the actual detector. - */ - virtual void backprojectPointX(int iAngleIndex, double fU, double fV, - double fX, double &fY, double &fZ) const = 0; - virtual void backprojectPointY(int iAngleIndex, double fU, double fV, - double fY, double &fX, double &fZ) const = 0; - virtual void backprojectPointZ(int iAngleIndex, double fU, double fV, - double fZ, double &fX, double &fY) const = 0; - - /** Returns true if the type of geometry defined in this class is the one specified in _sType. * * @param _sType geometry type to compare to. diff --git a/src/ConeProjectionGeometry3D.cpp b/src/ConeProjectionGeometry3D.cpp index 11a244d..abd9124 100644 --- a/src/ConeProjectionGeometry3D.cpp +++ b/src/ConeProjectionGeometry3D.cpp @@ -266,84 +266,5 @@ void CConeProjectionGeometry3D::projectPoint(double fX, double fY, double fZ, fU = detectorOffsetXToColIndexFloat( (fS * (m_fOriginSourceDistance + m_fOriginDetectorDistance)) / fD ); } -void CConeProjectionGeometry3D::backprojectPointX(int iAngleIndex, double fU, double fV, - double fX, double &fY, double &fZ) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SConeProjection *projs = genConeProjections(1, m_iDetectorColCount, m_iDetectorRowCount, - m_fOriginSourceDistance, - m_fOriginDetectorDistance, - m_fDetectorSpacingX, m_fDetectorSpacingY, - &m_pfProjectionAngles[iAngleIndex]); - - SConeProjection &proj = projs[0]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fX - proj.fSrcX) / (px - proj.fSrcX); - - fY = proj.fSrcY + a * (py - proj.fSrcY); - fZ = proj.fSrcZ + a * (pz - proj.fSrcZ); - - delete[] projs; -} - -void CConeProjectionGeometry3D::backprojectPointY(int iAngleIndex, double fU, double fV, - double fY, double &fX, double &fZ) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SConeProjection *projs = genConeProjections(1, m_iDetectorColCount, m_iDetectorRowCount, - m_fOriginSourceDistance, - m_fOriginDetectorDistance, - m_fDetectorSpacingX, m_fDetectorSpacingY, - &m_pfProjectionAngles[iAngleIndex]); - - SConeProjection &proj = projs[0]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fY - proj.fSrcY) / (py - proj.fSrcY); - - fX = proj.fSrcX + a * (px - proj.fSrcX); - fZ = proj.fSrcZ + a * (pz - proj.fSrcZ); - - delete[] projs; -} - -void CConeProjectionGeometry3D::backprojectPointZ(int iAngleIndex, double fU, double fV, - double fZ, double &fX, double &fY) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SConeProjection *projs = genConeProjections(1, m_iDetectorColCount, m_iDetectorRowCount, - m_fOriginSourceDistance, - m_fOriginDetectorDistance, - m_fDetectorSpacingX, m_fDetectorSpacingY, - &m_pfProjectionAngles[iAngleIndex]); - - SConeProjection &proj = projs[0]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fZ - proj.fSrcZ) / (pz - proj.fSrcZ); - - fX = proj.fSrcX + a * (px - proj.fSrcX); - fY = proj.fSrcY + a * (py - proj.fSrcY); - - delete[] projs; -} - - } // end namespace astra diff --git a/src/ConeVecProjectionGeometry3D.cpp b/src/ConeVecProjectionGeometry3D.cpp index d9033d6..eb605d8 100644 --- a/src/ConeVecProjectionGeometry3D.cpp +++ b/src/ConeVecProjectionGeometry3D.cpp @@ -258,60 +258,6 @@ void CConeVecProjectionGeometry3D::projectPoint(double fX, double fY, double fZ, } -void CConeVecProjectionGeometry3D::backprojectPointX(int iAngleIndex, double fU, double fV, - double fX, double &fY, double &fZ) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SConeProjection &proj = m_pProjectionAngles[iAngleIndex]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fX - proj.fSrcX) / (px - proj.fSrcX); - - fY = proj.fSrcY + a * (py - proj.fSrcY); - fZ = proj.fSrcZ + a * (pz - proj.fSrcZ); -} - -void CConeVecProjectionGeometry3D::backprojectPointY(int iAngleIndex, double fU, double fV, - double fY, double &fX, double &fZ) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SConeProjection &proj = m_pProjectionAngles[iAngleIndex]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fY - proj.fSrcY) / (py - proj.fSrcY); - - fX = proj.fSrcX + a * (px - proj.fSrcX); - fZ = proj.fSrcZ + a * (pz - proj.fSrcZ); -} - -void CConeVecProjectionGeometry3D::backprojectPointZ(int iAngleIndex, double fU, double fV, - double fZ, double &fX, double &fY) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SConeProjection &proj = m_pProjectionAngles[iAngleIndex]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fZ - proj.fSrcZ) / (pz - proj.fSrcZ); - - fX = proj.fSrcX + a * (px - proj.fSrcX); - fY = proj.fSrcY + a * (py - proj.fSrcY); -} - //---------------------------------------------------------------------------------------- bool CConeVecProjectionGeometry3D::_check() diff --git a/src/GeometryUtil3D.cpp b/src/GeometryUtil3D.cpp index 047c0c9..28a7a9c 100644 --- a/src/GeometryUtil3D.cpp +++ b/src/GeometryUtil3D.cpp @@ -159,88 +159,4 @@ void computeBP_UV_Coeffs(const SConeProjection& proj, double &fUX, double &fUY, } -// TODO: Handle cases of rays parallel to coordinate planes - -void backprojectPointX(const SPar3DProjection& proj, double fU, double fV, - double fX, double &fY, double &fZ) -{ - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fX - px) / proj.fRayX; - - fY = py + a * proj.fRayY; - fZ = pz + a * proj.fRayZ; -} - -void backprojectPointY(const SPar3DProjection& proj, double fU, double fV, - double fY, double &fX, double &fZ) -{ - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fY - py) / proj.fRayY; - - fX = px + a * proj.fRayX; - fZ = pz + a * proj.fRayZ; - -} - -void backprojectPointZ(const SPar3DProjection& proj, double fU, double fV, - double fZ, double &fX, double &fY) -{ - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fZ - pz) / proj.fRayZ; - - fX = px + a * proj.fRayX; - fY = py + a * proj.fRayY; -} - - - -void backprojectPointX(const SConeProjection& proj, double fU, double fV, - double fX, double &fY, double &fZ) -{ - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fX - proj.fSrcX) / (px - proj.fSrcX); - - fY = proj.fSrcY + a * (py - proj.fSrcY); - fZ = proj.fSrcZ + a * (pz - proj.fSrcZ); -} - -void backprojectPointY(const SConeProjection& proj, double fU, double fV, - double fY, double &fX, double &fZ) -{ - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fY - proj.fSrcY) / (py - proj.fSrcY); - - fX = proj.fSrcX + a * (px - proj.fSrcX); - fZ = proj.fSrcZ + a * (pz - proj.fSrcZ); -} - -void backprojectPointZ(const SConeProjection& proj, double fU, double fV, - double fZ, double &fX, double &fY) -{ - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fZ - proj.fSrcZ) / (pz - proj.fSrcZ); - - fX = proj.fSrcX + a * (px - proj.fSrcX); - fY = proj.fSrcY + a * (py - proj.fSrcY); -} - - } diff --git a/src/ParallelProjectionGeometry3D.cpp b/src/ParallelProjectionGeometry3D.cpp index 554dfcd..1d29ad6 100644 --- a/src/ParallelProjectionGeometry3D.cpp +++ b/src/ParallelProjectionGeometry3D.cpp @@ -215,79 +215,6 @@ CParallelProjectionGeometry2D * CParallelProjectionGeometry3D::createProjectionG return pOutput; } -void CParallelProjectionGeometry3D::backprojectPointX(int iAngleIndex, double fU, double fV, - double fX, double &fY, double &fZ) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SPar3DProjection *projs = genPar3DProjections(1, m_iDetectorColCount, m_iDetectorRowCount, - m_fDetectorSpacingX, m_fDetectorSpacingY, - &m_pfProjectionAngles[iAngleIndex]); - - SPar3DProjection &proj = projs[0]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fX - px) / proj.fRayX; - - fY = py + a * proj.fRayY; - fZ = pz + a * proj.fRayZ; - - delete[] projs; -} - -void CParallelProjectionGeometry3D::backprojectPointY(int iAngleIndex, double fU, double fV, - double fY, double &fX, double &fZ) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SPar3DProjection *projs = genPar3DProjections(1, m_iDetectorColCount, m_iDetectorRowCount, - m_fDetectorSpacingX, m_fDetectorSpacingY, - &m_pfProjectionAngles[iAngleIndex]); - - SPar3DProjection &proj = projs[0]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fY - py) / proj.fRayY; - - fX = px + a * proj.fRayX; - fZ = pz + a * proj.fRayZ; - - delete[] projs; -} - -void CParallelProjectionGeometry3D::backprojectPointZ(int iAngleIndex, double fU, double fV, - double fZ, double &fX, double &fY) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SPar3DProjection *projs = genPar3DProjections(1, m_iDetectorColCount, m_iDetectorRowCount, - m_fDetectorSpacingX, m_fDetectorSpacingY, - &m_pfProjectionAngles[iAngleIndex]); - - SPar3DProjection &proj = projs[0]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fZ - pz) / proj.fRayZ; - - fX = px + a * proj.fRayX; - fY = py + a * proj.fRayY; - - delete[] projs; -} - - //---------------------------------------------------------------------------------------- } // end namespace astra diff --git a/src/ParallelVecProjectionGeometry3D.cpp b/src/ParallelVecProjectionGeometry3D.cpp index 33f2e28..78e6d9d 100644 --- a/src/ParallelVecProjectionGeometry3D.cpp +++ b/src/ParallelVecProjectionGeometry3D.cpp @@ -256,61 +256,6 @@ void CParallelVecProjectionGeometry3D::projectPoint(double fX, double fY, double } -void CParallelVecProjectionGeometry3D::backprojectPointX(int iAngleIndex, double fU, double fV, - double fX, double &fY, double &fZ) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SPar3DProjection &proj = m_pProjectionAngles[iAngleIndex]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fX - px) / proj.fRayX; - - fY = py + a * proj.fRayY; - fZ = pz + a * proj.fRayZ; -} - -void CParallelVecProjectionGeometry3D::backprojectPointY(int iAngleIndex, double fU, double fV, - double fY, double &fX, double &fZ) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SPar3DProjection &proj = m_pProjectionAngles[iAngleIndex]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fY - py) / proj.fRayY; - - fX = px + a * proj.fRayX; - fZ = pz + a * proj.fRayZ; -} - -void CParallelVecProjectionGeometry3D::backprojectPointZ(int iAngleIndex, double fU, double fV, - double fZ, double &fX, double &fY) const -{ - ASTRA_ASSERT(iAngleIndex >= 0); - ASTRA_ASSERT(iAngleIndex < m_iProjectionAngleCount); - - SPar3DProjection &proj = m_pProjectionAngles[iAngleIndex]; - - double px = proj.fDetSX + fU * proj.fDetUX + fV * proj.fDetVX; - double py = proj.fDetSY + fU * proj.fDetUY + fV * proj.fDetVY; - double pz = proj.fDetSZ + fU * proj.fDetUZ + fV * proj.fDetVZ; - - double a = (fZ - pz) / proj.fRayZ; - - fX = px + a * proj.fRayX; - fY = py + a * proj.fRayY; -} - - //---------------------------------------------------------------------------------------- bool CParallelVecProjectionGeometry3D::_check() |