diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-07-13 16:20:07 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-07-17 11:30:05 +0200 |
commit | bc65a0395e6c3930bac0440cc894990dd04cb704 (patch) | |
tree | 645a9c1fac6417066df19172fa8d4920a68cdeb5 /cuda/2d/fbp.cu | |
parent | da434892133fe0979c5e8ef8be277673452e7728 (diff) | |
download | astra-bc65a0395e6c3930bac0440cc894990dd04cb704.tar.gz astra-bc65a0395e6c3930bac0440cc894990dd04cb704.tar.bz2 astra-bc65a0395e6c3930bac0440cc894990dd04cb704.tar.xz astra-bc65a0395e6c3930bac0440cc894990dd04cb704.zip |
Reorganize more filter size functions
Diffstat (limited to 'cuda/2d/fbp.cu')
-rw-r--r-- | cuda/2d/fbp.cu | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/cuda/2d/fbp.cu b/cuda/2d/fbp.cu index e8a224e..a5b8a7a 100644 --- a/cuda/2d/fbp.cu +++ b/cuda/2d/fbp.cu @@ -42,20 +42,10 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. namespace astraCUDA { - -static int calcNextPowerOfTwo(int n) -{ - int x = 1; - while (x < n) - x *= 2; - - return x; -} - // static int FBP::calcFourierFilterSize(int _iDetectorCount) { - int iFFTRealDetCount = calcNextPowerOfTwo(2 * _iDetectorCount); + int iFFTRealDetCount = astra::calcNextPowerOfTwo(2 * _iDetectorCount); int iFreqBinCount = astra::calcFFTFourierSize(iFFTRealDetCount); // CHECKME: Matlab makes this at least 64. Do we also need to? @@ -101,7 +91,7 @@ bool FBP::setFilter(const astra::SFilterConfig &_cfg) return true; // leave D_filter set to 0 - int iFFTRealDetCount = calcNextPowerOfTwo(2 * dims.iProjDets); + int iFFTRealDetCount = astra::calcNextPowerOfTwo(2 * dims.iProjDets); int iFreqBinCount = astra::calcFFTFourierSize(iFFTRealDetCount); cufftComplex * pHostFilter = new cufftComplex[dims.iProjAngles * iFreqBinCount]; @@ -311,7 +301,7 @@ bool FBP::iterate(unsigned int iterations) if (D_filter) { - int iFFTRealDetCount = calcNextPowerOfTwo(2 * dims.iProjDets); + int iFFTRealDetCount = astra::calcNextPowerOfTwo(2 * dims.iProjDets); int iFFTFourDetCount = astra::calcFFTFourierSize(iFFTRealDetCount); cufftComplex * pDevComplexSinogram = NULL; |