summaryrefslogtreecommitdiffstats
path: root/src/CudaForwardProjectionAlgorithm.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-09-16 15:52:30 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-09-16 15:52:40 +0200
commit8144bf0397ee1913b830d82058ccd40df741f1b3 (patch)
tree7f707615c104621226fd8bdd868f86aee8e5bd73 /src/CudaForwardProjectionAlgorithm.cpp
parent47b520d51fc4fc49db992b9117f6c0abfa8152b5 (diff)
parentc1713c00c4aeae594913667d868106e8591dd1d1 (diff)
downloadastra-8144bf0397ee1913b830d82058ccd40df741f1b3.tar.gz
astra-8144bf0397ee1913b830d82058ccd40df741f1b3.tar.bz2
astra-8144bf0397ee1913b830d82058ccd40df741f1b3.tar.xz
astra-8144bf0397ee1913b830d82058ccd40df741f1b3.zip
Merge branch 'master'
Diffstat (limited to 'src/CudaForwardProjectionAlgorithm.cpp')
-rw-r--r--src/CudaForwardProjectionAlgorithm.cpp38
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