summaryrefslogtreecommitdiffstats
path: root/cuda/2d
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-04-22 15:59:20 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-04-22 16:05:23 +0200
commitc2cdbc312196481edd202baa3bd668396e78534c (patch)
treeaa5f1a8536c207645490d3aefb0039a9943ffb9d /cuda/2d
parent048755bab6b77c1da0050ed091e5007a60564adf (diff)
parent87aca2419026b6408a194376f34f41f19a546d9e (diff)
downloadastra-c2cdbc312196481edd202baa3bd668396e78534c.tar.gz
astra-c2cdbc312196481edd202baa3bd668396e78534c.tar.bz2
astra-c2cdbc312196481edd202baa3bd668396e78534c.tar.xz
astra-c2cdbc312196481edd202baa3bd668396e78534c.zip
Merge branch 'master' into FDK
Diffstat (limited to 'cuda/2d')
-rw-r--r--cuda/2d/fft.cu31
1 files changed, 13 insertions, 18 deletions
diff --git a/cuda/2d/fft.cu b/cuda/2d/fft.cu
index a84b2cc..aab755a 100644
--- a/cuda/2d/fft.cu
+++ b/cuda/2d/fft.cu
@@ -319,45 +319,40 @@ void genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount,
}
#else
- float *pfRealIn = new float[_iFFTRealDetectorCount];
- float *pfImagIn = new float[_iFFTRealDetectorCount];
- float *pfRealOut = new float[_iFFTRealDetectorCount];
- float *pfImagOut = new float[_iFFTRealDetectorCount];
+ float *pfData = new float[2*_iFFTRealDetectorCount];
+ int *ip = new int[int(2+sqrt(_iFFTRealDetectorCount)+1)];
+ ip[0]=0;
+ float32 *w = new float32[_iFFTRealDetectorCount/2];
for (int i = 0; i < _iFFTRealDetectorCount; ++i) {
- pfImagIn[i] = 0.0f;
- pfRealOut[i] = 0.0f;
- pfImagOut[i] = 0.0f;
+ pfData[2*i+1] = 0.0f;
if (i & 1) {
int j = i;
if (2*j > _iFFTRealDetectorCount)
j = _iFFTRealDetectorCount - j;
float f = M_PI * j;
- pfRealIn[i] = -1 / (f*f);
+ pfData[2*i] = -1 / (f*f);
} else {
- pfRealIn[i] = 0.0f;
+ pfData[2*i] = 0.0f;
}
}
- pfRealIn[0] = 0.25f;
+ pfData[0] = 0.25f;
- fastTwoPowerFourierTransform1D(_iFFTRealDetectorCount, pfRealIn, pfImagIn,
- pfRealOut, pfImagOut, 1, 1, false);
+ cdft(2*_iFFTRealDetectorCount, -1, pfData, ip, w);
for(int iDetectorIndex = 0; iDetectorIndex < _iFFTFourierDetectorCount; iDetectorIndex++)
{
float fRelIndex = (float)iDetectorIndex / (float)_iFFTRealDetectorCount;
- pfFilt[iDetectorIndex] = 2.0f * pfRealOut[iDetectorIndex];
+ pfFilt[iDetectorIndex] = 2.0f * pfData[2*iDetectorIndex];
pfW[iDetectorIndex] = M_PI * 2.0f * fRelIndex;
}
- delete[] pfRealIn;
- delete[] pfImagIn;
- delete[] pfRealOut;
- delete[] pfImagOut;
-
+ delete[] pfData;
+ delete[] ip;
+ delete[] w;
#endif
switch(_eFilter)