diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-06-04 17:23:54 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-06-23 12:10:00 +0200 |
commit | e622f453c6ab9de6277611e01cac415e297553f7 (patch) | |
tree | a4aabee574d07f8b3142607d0a038781f5af0794 /src/CudaForwardProjectionAlgorithm.cpp | |
parent | 0985154228a63db25e9a0a0165994221d9b97a91 (diff) | |
download | astra-e622f453c6ab9de6277611e01cac415e297553f7.tar.gz astra-e622f453c6ab9de6277611e01cac415e297553f7.tar.bz2 astra-e622f453c6ab9de6277611e01cac415e297553f7.tar.xz astra-e622f453c6ab9de6277611e01cac415e297553f7.zip |
Use supersampling options from CudaProjector2D
Diffstat (limited to 'src/CudaForwardProjectionAlgorithm.cpp')
-rw-r--r-- | src/CudaForwardProjectionAlgorithm.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/CudaForwardProjectionAlgorithm.cpp b/src/CudaForwardProjectionAlgorithm.cpp index 0f97d59..b382f2e 100644 --- a/src/CudaForwardProjectionAlgorithm.cpp +++ b/src/CudaForwardProjectionAlgorithm.cpp @@ -71,9 +71,24 @@ bool CCudaForwardProjectionAlgorithm::initialize(const Config& _cfg) { ASTRA_ASSERT(_cfg.self); ConfigStackCheck<CAlgorithm> CC("CudaForwardProjectionAlgorithm", this, _cfg); + + // Projector + XMLNode node = _cfg.self.getSingleNode("ProjectorId"); + CCudaProjector2D* pCudaProjector = 0; + if (node) { + int id = boost::lexical_cast<int>(node.getContent()); + CProjector2D *projector = CProjector2DManager::getSingleton().get(id); + pCudaProjector = dynamic_cast<CCudaProjector2D*>(projector); + if (!pCudaProjector) { + ASTRA_WARN("non-CUDA Projector2D passed to FP_CUDA"); + } + } + CC.markNodeParsed("ProjectorId"); + + // sinogram data - XMLNode node = _cfg.self.getSingleNode("ProjectionDataId"); + node = _cfg.self.getSingleNode("ProjectionDataId"); ASTRA_CONFIG_CHECK(node, "FP_CUDA", "No ProjectionDataId tag specified."); int id = boost::lexical_cast<int>(node.getContent()); m_pSinogram = dynamic_cast<CFloat32ProjectionData2D*>(CData2DManager::getSingleton().get(id)); @@ -94,21 +109,14 @@ bool CCudaForwardProjectionAlgorithm::initialize(const Config& _cfg) CC.markOptionParsed("GPUIndex"); // Detector supersampling factor - m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", 1); - CC.markOptionParsed("DetectorSuperSampling"); - - - // This isn't used yet, but passing it is not something to warn about - node = _cfg.self.getSingleNode("ProjectorId"); - if (node) { - id = boost::lexical_cast<int>(node.getContent()); - CProjector2D *projector = CProjector2DManager::getSingleton().get(id); - if (!dynamic_cast<CCudaProjector2D*>(projector)) { - ASTRA_WARN("non-CUDA Projector2D passed to FP_CUDA"); - } + m_iDetectorSuperSampling = 1; + if (pCudaProjector) { + // New interface + m_iDetectorSuperSampling = pCudaProjector->getDetectorSuperSampling(); } - CC.markNodeParsed("ProjectorId"); - + // Deprecated option + m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", m_iDetectorSuperSampling); + CC.markOptionParsed("DetectorSuperSampling"); // return success |