diff options
-rw-r--r-- | cuda/2d/astra.cu | 11 | ||||
-rw-r--r-- | include/astra/ProjectionGeometry2D.h | 13 | ||||
-rw-r--r-- | src/ParallelProjectionGeometry2D.cpp | 3 | ||||
-rw-r--r-- | src/ProjectionGeometry2D.cpp | 18 |
4 files changed, 4 insertions, 41 deletions
diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu index 0b5be06..dc16a56 100644 --- a/cuda/2d/astra.cu +++ b/cuda/2d/astra.cu @@ -827,17 +827,12 @@ bool convertAstraGeometry(const CVolumeGeometry2D* pVolGeom, // If there are existing detector offsets, or if we need to translate, // we need to return offsets - if (pProjGeom->getExtraDetectorOffset() || offCenter) + if (offCenter) { float* offset = new float[nth]; - if (pProjGeom->getExtraDetectorOffset()) { - for (int i = 0; i < nth; ++i) - offset[i] = pProjGeom->getExtraDetectorOffset()[i]; - } else { - for (int i = 0; i < nth; ++i) - offset[i] = 0.0f; - } + for (int i = 0; i < nth; ++i) + offset[i] = 0.0f; if (offCenter) { float dx = (pVolGeom->getWindowMinX() + pVolGeom->getWindowMaxX()) / 2; diff --git a/include/astra/ProjectionGeometry2D.h b/include/astra/ProjectionGeometry2D.h index b8324e2..d26e6a7 100644 --- a/include/astra/ProjectionGeometry2D.h +++ b/include/astra/ProjectionGeometry2D.h @@ -65,10 +65,6 @@ protected: */ float32 m_fDetectorWidth; - /** An array of m_iProjectionAngleCount elements containing an extra detector offset for each projection. - */ - float32* m_pfExtraDetectorOffset; - /** Dynamically allocated array of projection angles. All angles are represented in radians and lie in * the [0,2pi[ interval. */ @@ -202,9 +198,6 @@ public: */ float32 getProjectionAngleDegrees(int _iProjectionIndex) const; - float32 getExtraDetectorOffset(int iAngle) const; - const float32* getExtraDetectorOffset() const { return m_pfExtraDetectorOffset; } - /** Get the index coordinate of a point on a detector array. * * @param _fOffset distance between the center of the detector array and a certain point @@ -273,12 +266,6 @@ public: //---------------------------------------------------------------------------------------- -inline float32 CProjectionGeometry2D::getExtraDetectorOffset(int _iAngle) const -{ - return m_pfExtraDetectorOffset ? m_pfExtraDetectorOffset[_iAngle] : 0.0f; -} - - // Get the initialization state. inline bool CProjectionGeometry2D::isInitialized() const { diff --git a/src/ParallelProjectionGeometry2D.cpp b/src/ParallelProjectionGeometry2D.cpp index 64fc0b9..42ed0a0 100644 --- a/src/ParallelProjectionGeometry2D.cpp +++ b/src/ParallelProjectionGeometry2D.cpp @@ -67,8 +67,7 @@ CParallelProjectionGeometry2D::CParallelProjectionGeometry2D(const CParallelProj initialize(_projGeom.m_iProjectionAngleCount, _projGeom.m_iDetectorCount, _projGeom.m_fDetectorWidth, - _projGeom.m_pfProjectionAngles, - _projGeom.m_pfExtraDetectorOffset); + _projGeom.m_pfProjectionAngles); } //---------------------------------------------------------------------------------------- diff --git a/src/ProjectionGeometry2D.cpp b/src/ProjectionGeometry2D.cpp index 89b5fe0..a51d86b 100644 --- a/src/ProjectionGeometry2D.cpp +++ b/src/ProjectionGeometry2D.cpp @@ -72,7 +72,6 @@ void CProjectionGeometry2D::_clear() m_iDetectorCount = 0; m_fDetectorWidth = 0.0f; m_pfProjectionAngles = NULL; - m_pfExtraDetectorOffset = NULL; m_bInitialized = false; } @@ -85,10 +84,8 @@ void CProjectionGeometry2D::clear() m_fDetectorWidth = 0.0f; if (m_bInitialized){ delete[] m_pfProjectionAngles; - delete[] m_pfExtraDetectorOffset; } m_pfProjectionAngles = NULL; - m_pfExtraDetectorOffset = NULL; m_bInitialized = false; } @@ -150,19 +147,6 @@ bool CProjectionGeometry2D::initialize(const Config& _cfg) } CC.markNodeParsed("ProjectionAngles"); - vector<float32> offset = _cfg.self->getOptionNumericalArray("ExtraDetectorOffset"); - m_pfExtraDetectorOffset = new float32[m_iProjectionAngleCount]; - if (offset.size() == (size_t)m_iProjectionAngleCount) { - for (int i = 0; i < m_iProjectionAngleCount; i++) { - m_pfExtraDetectorOffset[i] = offset[i]; - } - } else { - for (int i = 0; i < m_iProjectionAngleCount; i++) { - m_pfExtraDetectorOffset[i] = 0.0f; - } - } - CC.markOptionParsed("ExtraDetectorOffset"); - // some checks ASTRA_CONFIG_CHECK(m_iDetectorCount > 0, "ProjectionGeometry2D", "DetectorCount should be positive."); ASTRA_CONFIG_CHECK(m_fDetectorWidth > 0.0f, "ProjectionGeometry2D", "DetectorWidth should be positive."); @@ -189,10 +173,8 @@ bool CProjectionGeometry2D::_initialize(int _iProjectionAngleCount, m_iDetectorCount = _iDetectorCount; m_fDetectorWidth = _fDetectorWidth; m_pfProjectionAngles = new float32[m_iProjectionAngleCount]; - m_pfExtraDetectorOffset = new float32[m_iProjectionAngleCount]; for (int i = 0; i < m_iProjectionAngleCount; i++) { m_pfProjectionAngles[i] = _pfProjectionAngles[i]; - m_pfExtraDetectorOffset[i] = _pfExtraDetectorOffsets ? _pfExtraDetectorOffsets[i]:0; } // Interface class, so don't set m_bInitialized to true |