summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cuda/2d/astra.cu11
-rw-r--r--cuda/3d/fdk.cu3
2 files changed, 10 insertions, 4 deletions
diff --git a/cuda/2d/astra.cu b/cuda/2d/astra.cu
index 0069bc3..41ce0c8 100644
--- a/cuda/2d/astra.cu
+++ b/cuda/2d/astra.cu
@@ -343,7 +343,7 @@ bool AstraFBP::run()
astraCUDA3d::FDK_PreWeight(tmp, pData->fOriginSourceDistance,
pData->fOriginDetectorDistance, 0.0f,
- pData->dims.fDetScale, 1.0f, 1.0f, // TODO: Are these correct?
+ pData->dims.fDetScale, 1.0f, pData->fPixelSize, // TODO: Are these correct?
pData->bShortScan, dims3d, pData->angles);
}
@@ -366,12 +366,17 @@ bool AstraFBP::run()
}
- float fOutputScale = (M_PI / 2.0f) / (float)pData->dims.iProjAngles;
if (pData->bFanBeam) {
- ok = FanBP_FBPWeighted(pData->D_volumeData, pData->volumePitch, pData->D_sinoData, pData->sinoPitch, pData->dims, pData->fanProjections, fOutputScale);
+ float fOutputScale = 1.0 / (pData->fPixelSize * pData->fPixelSize * pData->fPixelSize * pData->dims.fDetScale * pData->dims.fDetScale);
+ ok = FanBP_FBPWeighted(pData->D_volumeData, pData->volumePitch, pData->D_sinoData, pData->sinoPitch, pData->dims, pData->fanProjections, fOutputScale);
} else {
+ // scale by number of angles. For the fan-beam case, this is already
+ // handled by FDK_PreWeight
+ float fOutputScale = (M_PI / 2.0f) / (float)pData->dims.iProjAngles;
+ fOutputScale /= pData->dims.fDetScale * pData->dims.fDetScale;
+
ok = BP(pData->D_volumeData, pData->volumePitch, pData->D_sinoData, pData->sinoPitch, pData->dims, pData->angles, pData->TOffsets, fOutputScale);
}
if(!ok)
diff --git a/cuda/3d/fdk.cu b/cuda/3d/fdk.cu
index 0630afe..11c68e1 100644
--- a/cuda/3d/fdk.cu
+++ b/cuda/3d/fdk.cu
@@ -83,12 +83,13 @@ __global__ void devFDK_preweight(void* D_projData, unsigned int projPitch, unsig
float fV = (startDetectorV - 0.5f*dims.iProjV + 0.5f) * fDetVSize + fZShift;
- // Four contributions to the weighting factors:
+ // Contributions to the weighting factors:
// fCentralRayLength / fRayLength : the main FDK preweighting factor
// fSrcOrigin / (fDetUSize * fCentralRayLength)
// : to adjust the filter to the det width
// || u v s || ^ 2 : see cone_bp.cu, FDKWEIGHT
// pi / (2 * iProjAngles) : scaling of the integral over angles
+ // fVoxSize ^ 2 : ...
const float fW1 = fSrcOrigin * fDetUSize * fDetVSize;
const float fW2 = fCentralRayLength / (fDetUSize * fSrcOrigin);