summaryrefslogtreecommitdiffstats
path: root/cuda/3d
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-11-28 13:41:08 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-11-28 13:41:08 +0100
commit9101748879d81e8aafe7c77ecc4c8b2175390335 (patch)
treee5c05f226b45d4fb910dda5fab74ff760d9e27a0 /cuda/3d
parenteeffd2d9748b8912b384a5764b808f5bfc850ade (diff)
parent4a12901ad7b08021b2adad1241bf750aec4a3d2d (diff)
downloadastra-9101748879d81e8aafe7c77ecc4c8b2175390335.tar.gz
astra-9101748879d81e8aafe7c77ecc4c8b2175390335.tar.bz2
astra-9101748879d81e8aafe7c77ecc4c8b2175390335.tar.xz
astra-9101748879d81e8aafe7c77ecc4c8b2175390335.zip
Merge branch 'fdk_custom_filter'
Diffstat (limited to 'cuda/3d')
-rw-r--r--cuda/3d/astra3d.cu2
-rw-r--r--cuda/3d/fdk.cu12
-rw-r--r--cuda/3d/fdk.h3
-rw-r--r--cuda/3d/mem3d.cu4
-rw-r--r--cuda/3d/mem3d.h2
5 files changed, 15 insertions, 8 deletions
diff --git a/cuda/3d/astra3d.cu b/cuda/3d/astra3d.cu
index 91f4530..3bd56ea 100644
--- a/cuda/3d/astra3d.cu
+++ b/cuda/3d/astra3d.cu
@@ -1289,6 +1289,4 @@ bool astraCudaBP_SIRTWeighted(float* pfVolume,
}
-
-
}
diff --git a/cuda/3d/fdk.cu b/cuda/3d/fdk.cu
index 19ef338..bbac0be 100644
--- a/cuda/3d/fdk.cu
+++ b/cuda/3d/fdk.cu
@@ -281,7 +281,8 @@ bool FDK_Filter(cudaPitchedPtr D_projData,
bool FDK(cudaPitchedPtr D_volumeData,
cudaPitchedPtr D_projData,
const SConeProjection* angles,
- const SDimensions3D& dims, SProjectorParams3D params, bool bShortScan)
+ const SDimensions3D& dims, SProjectorParams3D params, bool bShortScan,
+ const float* pfFilter)
{
bool ok;
// Generate filter
@@ -332,7 +333,14 @@ bool FDK(cudaPitchedPtr D_volumeData,
cufftComplex *pHostFilter = new cufftComplex[dims.iProjAngles * iHalfFFTSize];
memset(pHostFilter, 0, sizeof(cufftComplex) * dims.iProjAngles * iHalfFFTSize);
- genFilter(FILTER_RAMLAK, 1.0f, dims.iProjAngles, pHostFilter, iPaddedDetCount, iHalfFFTSize);
+ if (pfFilter == 0){
+ genFilter(FILTER_RAMLAK, 1.0f, dims.iProjAngles, pHostFilter, iPaddedDetCount, iHalfFFTSize);
+ } else {
+ for (int i = 0; i < dims.iProjAngles * iHalfFFTSize; i++) {
+ pHostFilter[i].x = pfFilter[i];
+ pHostFilter[i].y = 0;
+ }
+ }
allocateComplexOnDevice(dims.iProjAngles, iHalfFFTSize, &D_filter);
diff --git a/cuda/3d/fdk.h b/cuda/3d/fdk.h
index 8d2a128..fc0df20 100644
--- a/cuda/3d/fdk.h
+++ b/cuda/3d/fdk.h
@@ -42,7 +42,8 @@ bool FDK_PreWeight(cudaPitchedPtr D_projData,
bool FDK(cudaPitchedPtr D_volumeData,
cudaPitchedPtr D_projData,
const SConeProjection* angles,
- const SDimensions3D& dims, SProjectorParams3D params, bool bShortScan);
+ const SDimensions3D& dims, SProjectorParams3D params, bool bShortScan,
+ const float* filter);
}
diff --git a/cuda/3d/mem3d.cu b/cuda/3d/mem3d.cu
index 4fb30a2..cb15ab9 100644
--- a/cuda/3d/mem3d.cu
+++ b/cuda/3d/mem3d.cu
@@ -279,7 +279,7 @@ bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con
}
-bool FDK(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, bool bShortScan)
+bool FDK(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, bool bShortScan, const float *pfFilter)
{
SDimensions3D dims;
SProjectorParams3D params;
@@ -298,7 +298,7 @@ bool FDK(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, co
if (!ok || !pConeProjs)
return false;
- ok &= FDK(volData.d->ptr, projData.d->ptr, pConeProjs, dims, params, bShortScan);
+ ok &= FDK(volData.d->ptr, projData.d->ptr, pConeProjs, dims, params, bShortScan, pfFilter);
return ok;
diff --git a/cuda/3d/mem3d.h b/cuda/3d/mem3d.h
index 2d0fb27..bb8b091 100644
--- a/cuda/3d/mem3d.h
+++ b/cuda/3d/mem3d.h
@@ -95,7 +95,7 @@ bool FP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, con
bool BP(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, int iVoxelSuperSampling);
-bool FDK(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, bool bShortScan);
+bool FDK(const astra::CProjectionGeometry3D* pProjGeom, MemHandle3D projData, const astra::CVolumeGeometry3D* pVolGeom, MemHandle3D volData, bool bShortScan, const float *pfFilter = 0);
}