diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-09-16 12:01:02 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-09-16 12:01:02 +0200 |
commit | 55cbaa5df6f91594b7cd69754e04c186c7c88c97 (patch) | |
tree | b1456253660a7762df6868d1452a6d9480e25b19 /src/CudaForwardProjectionAlgorithm3D.cpp | |
parent | 7584ffbd6748bcca8c3f7ed2dc961be01f2fcfdc (diff) | |
parent | 026aa46c5db24ddd687cec0fa6e056a2ee3790c5 (diff) | |
download | astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.tar.gz astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.tar.bz2 astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.tar.xz astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.zip |
Merge branch 'master' into volgeom3d
Conflicts:
src/CudaBackProjectionAlgorithm3D.cpp
Diffstat (limited to 'src/CudaForwardProjectionAlgorithm3D.cpp')
-rw-r--r-- | src/CudaForwardProjectionAlgorithm3D.cpp | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/CudaForwardProjectionAlgorithm3D.cpp b/src/CudaForwardProjectionAlgorithm3D.cpp index aa36715..3da61ff 100644 --- a/src/CudaForwardProjectionAlgorithm3D.cpp +++ b/src/CudaForwardProjectionAlgorithm3D.cpp @@ -78,40 +78,47 @@ bool CCudaForwardProjectionAlgorithm3D::initialize(const Config& _cfg) ASTRA_ASSERT(_cfg.self); ConfigStackCheck<CAlgorithm> CC("CudaForwardProjectionAlgorithm3D", this, _cfg); - XMLNode* node; + XMLNode node; int id; // sinogram data - node = _cfg.self->getSingleNode("ProjectionDataId"); + node = _cfg.self.getSingleNode("ProjectionDataId"); ASTRA_CONFIG_CHECK(node, "CudaForwardProjection3D", "No ProjectionDataId tag specified."); - id = boost::lexical_cast<int>(node->getContent()); + id = boost::lexical_cast<int>(node.getContent()); m_pProjections = dynamic_cast<CFloat32ProjectionData3DMemory*>(CData3DManager::getSingleton().get(id)); - ASTRA_DELETE(node); CC.markNodeParsed("ProjectionDataId"); // reconstruction data - node = _cfg.self->getSingleNode("VolumeDataId"); + node = _cfg.self.getSingleNode("VolumeDataId"); ASTRA_CONFIG_CHECK(node, "CudaForwardProjection3D", "No VolumeDataId tag specified."); - id = boost::lexical_cast<int>(node->getContent()); + id = boost::lexical_cast<int>(node.getContent()); m_pVolume = dynamic_cast<CFloat32VolumeData3DMemory*>(CData3DManager::getSingleton().get(id)); - ASTRA_DELETE(node); CC.markNodeParsed("VolumeDataId"); // optional: projector - node = _cfg.self->getSingleNode("ProjectorId"); + node = _cfg.self.getSingleNode("ProjectorId"); + CCudaProjector3D* pCudaProjector = 0; + m_pProjector = 0; if (node) { - id = boost::lexical_cast<int>(node->getContent()); + id = boost::lexical_cast<int>(node.getContent()); m_pProjector = CProjector3DManager::getSingleton().get(id); - ASTRA_DELETE(node); - } else { - m_pProjector = 0; // TODO: or manually construct default projector? + pCudaProjector = dynamic_cast<CCudaProjector3D*>(CProjector3DManager::getSingleton().get(id)); + m_pProjector = pCudaProjector; + if (!pCudaProjector) { + // TODO: Report + } } CC.markNodeParsed("ProjectorId"); // GPU number - m_iGPUIndex = (int)_cfg.self->getOptionNumerical("GPUindex", -1); + m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", -1); CC.markOptionParsed("GPUindex"); - m_iDetectorSuperSampling = (int)_cfg.self->getOptionNumerical("DetectorSuperSampling", 1); + + + m_iDetectorSuperSampling = 1; + if (pCudaProjector) + m_iDetectorSuperSampling = pCudaProjector->getDetectorSuperSampling(); + m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", m_iDetectorSuperSampling); CC.markOptionParsed("DetectorSuperSampling"); // success |