diff options
author | Willem Jan Palenstijn <wjp@usecode.org> | 2016-04-14 13:12:51 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <wjp@usecode.org> | 2016-04-14 13:12:51 +0200 |
commit | 7633a0f48ce030413642627f16e50d27da4cf709 (patch) | |
tree | 53150eade1dd920644c690a1d9da741cedcefdf6 /src/SartAlgorithm.cpp | |
parent | a7c4275ee8cd90b4ecf7fbca5d9571aae62a2931 (diff) | |
parent | 16430239d04ff738a21146c410918c285552543f (diff) | |
download | astra-7633a0f48ce030413642627f16e50d27da4cf709.tar.gz astra-7633a0f48ce030413642627f16e50d27da4cf709.tar.bz2 astra-7633a0f48ce030413642627f16e50d27da4cf709.tar.xz astra-7633a0f48ce030413642627f16e50d27da4cf709.zip |
Merge pull request #35 from wjp/relaxation
Add relaxation factor option to SIRT, SART
Diffstat (limited to 'src/SartAlgorithm.cpp')
-rw-r--r-- | src/SartAlgorithm.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/SartAlgorithm.cpp b/src/SartAlgorithm.cpp index f80df61..8df3342 100644 --- a/src/SartAlgorithm.cpp +++ b/src/SartAlgorithm.cpp @@ -151,6 +151,9 @@ bool CSartAlgorithm::initialize(const Config& _cfg) CC.markOptionParsed("ProjectionOrderList"); } + m_fLambda = _cfg.self.getOptionNumerical("Relaxation", 1.0f); + CC.markOptionParsed("Relaxation"); + // create data objects m_pTotalRayLength = new CFloat32ProjectionData2D(m_pProjector->getProjectionGeometry()); m_pTotalPixelWeight = new CFloat32VolumeData2D(m_pProjector->getVolumeGeometry()); @@ -246,6 +249,7 @@ map<string,boost::any> CSartAlgorithm::getInformation() { map<string, boost::any> res; res["ProjectionOrder"] = getInformation("ProjectionOrder"); + res["Relaxation"] = getInformation("Relaxation"); return mergeMap<string,boost::any>(CReconstructionAlgorithm2D::getInformation(), res); }; @@ -253,6 +257,8 @@ map<string,boost::any> CSartAlgorithm::getInformation() // Information - Specific boost::any CSartAlgorithm::getInformation(std::string _sIdentifier) { + if (_sIdentifier == "Relaxation") + return m_fLambda; if (_sIdentifier == "ProjectionOrder") { vector<float32> res; for (int i = 0; i < m_iProjectionCount; i++) { @@ -285,7 +291,7 @@ void CSartAlgorithm::run(int _iNrIterations) m_pProjector, SinogramMaskPolicy(m_pSinogramMask), // sinogram mask ReconstructionMaskPolicy(m_pReconstructionMask), // reconstruction mask - SIRTBPPolicy(m_pReconstruction, m_pDiffSinogram, m_pTotalPixelWeight, m_pTotalRayLength), // SIRT backprojection + SIRTBPPolicy(m_pReconstruction, m_pDiffSinogram, m_pTotalPixelWeight, m_pTotalRayLength, m_fLambda), // SIRT backprojection m_bUseSinogramMask, m_bUseReconstructionMask, true // options on/off ); |