summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <WillemJan.Palenstijn@uantwerpen.be>2014-04-16 11:13:26 +0000
committerwpalenst <WillemJan.Palenstijn@uantwerpen.be>2014-04-16 11:13:26 +0000
commit959f476f456b147999649ec3a8cca10017b2ad6c (patch)
tree94964827cf31c9c16d1659d5a6c4940aee1a0796
parent0c77eee16e2f4161c1ebc110b15ce6563d4a96c2 (diff)
downloadastra-959f476f456b147999649ec3a8cca10017b2ad6c.tar.gz
astra-959f476f456b147999649ec3a8cca10017b2ad6c.tar.bz2
astra-959f476f456b147999649ec3a8cca10017b2ad6c.tar.xz
astra-959f476f456b147999649ec3a8cca10017b2ad6c.zip
Add support for short-scan fan-beam FBP
Note that currently angles have to be negative for this to work. (This should be changed.)
-rw-r--r--cuda/3d/fdk.cu6
-rw-r--r--include/astra/CudaFilteredBackProjectionAlgorithm.h1
-rw-r--r--src/CudaFilteredBackProjectionAlgorithm.cpp11
3 files changed, 16 insertions, 2 deletions
diff --git a/cuda/3d/fdk.cu b/cuda/3d/fdk.cu
index fd5a8a2..45b6a28 100644
--- a/cuda/3d/fdk.cu
+++ b/cuda/3d/fdk.cu
@@ -267,7 +267,11 @@ __global__ void devFDK_ParkerWeight(void* D_projData, unsigned int projPitch, un
//const float fGamma = atanf(fU / fCentralRayLength);
//const float fBeta = gC_angle[angle];
const float fGamma = atanf(fU / fCentralRayLength);
- const float fBeta = -gC_angle[angle];
+ float fBeta = -gC_angle[angle];
+ if (fBeta < 0.0f)
+ fBeta += 2*M_PI;
+ if (fBeta >= 2*M_PI)
+ fBeta -= 2*M_PI;
// compute the weight depending on the location in the central fan's radon
// space
diff --git a/include/astra/CudaFilteredBackProjectionAlgorithm.h b/include/astra/CudaFilteredBackProjectionAlgorithm.h
index c496c8f..1b481b3 100644
--- a/include/astra/CudaFilteredBackProjectionAlgorithm.h
+++ b/include/astra/CudaFilteredBackProjectionAlgorithm.h
@@ -53,6 +53,7 @@ private:
int m_iFilterWidth; // number of elements per projection direction in filter
float m_fFilterParameter; // some filters allow for parameterization (value < 0.0f -> no parameter)
float m_fFilterD; // frequency cut-off
+ bool m_bShortScan; // short-scan mode for fan beam
static E_FBPFILTER _convertStringToFilter(const char * _filterType);
diff --git a/src/CudaFilteredBackProjectionAlgorithm.cpp b/src/CudaFilteredBackProjectionAlgorithm.cpp
index c53ac2d..39740c8 100644
--- a/src/CudaFilteredBackProjectionAlgorithm.cpp
+++ b/src/CudaFilteredBackProjectionAlgorithm.cpp
@@ -161,6 +161,14 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(const Config& _cfg)
m_iPixelSuperSampling = (int)_cfg.self->getOptionNumerical("PixelSuperSampling", 1);
CC.markOptionParsed("PixelSuperSampling");
+ // Fan beam short scan mode
+ if (m_pSinogram && dynamic_cast<CFanFlatProjectionGeometry2D*>(m_pSinogram->getGeometry())) {
+ m_bShortScan = (int)_cfg.self->getOptionBool("ShortScan", false);
+ CC.markOptionParsed("ShortScan");
+ }
+
+
+
m_pFBP = new AstraFBP;
m_bAstraFBPInit = false;
@@ -185,6 +193,7 @@ bool CCudaFilteredBackProjectionAlgorithm::initialize(CFloat32ProjectionData2D *
m_eFilter = _eFilter;
m_iFilterWidth = _iFilterWidth;
+ m_bShortScan = false;
// success
m_bIsInitialized = true;
@@ -251,7 +260,7 @@ void CCudaFilteredBackProjectionAlgorithm::run(int _iNrIterations /* = 0 */)
fanprojgeom->getOriginSourceDistance(),
fanprojgeom->getOriginDetectorDistance(),
fanprojgeom->getDetectorWidth(),
- false); // TODO: Support short-scan
+ m_bShortScan);
iDetectorCount = fanprojgeom->getDetectorCount();
} else {