summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-07-05 16:13:37 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-07-17 11:29:22 +0200
commitd58f6b51493c7931cbc02feb3ffeb0eca6ea3a4e (patch)
tree51a4b27c7825198ec119c4e420439f183584420a /include
parent0d06afc38d7a8443a079d25d72ec4b4b15353974 (diff)
downloadastra-d58f6b51493c7931cbc02feb3ffeb0eca6ea3a4e.tar.gz
astra-d58f6b51493c7931cbc02feb3ffeb0eca6ea3a4e.tar.bz2
astra-d58f6b51493c7931cbc02feb3ffeb0eca6ea3a4e.tar.xz
astra-d58f6b51493c7931cbc02feb3ffeb0eca6ea3a4e.zip
Refactor a few filter-related functions out of cuda code
Diffstat (limited to 'include')
-rw-r--r--include/astra/CudaFilteredBackProjectionAlgorithm.h3
-rw-r--r--include/astra/Filters.h (renamed from include/astra/cuda/2d/fbp_filters.h)16
-rw-r--r--include/astra/cuda/2d/astra.h1
-rw-r--r--include/astra/cuda/2d/fbp.h2
-rw-r--r--include/astra/cuda/2d/fft.h8
5 files changed, 19 insertions, 11 deletions
diff --git a/include/astra/CudaFilteredBackProjectionAlgorithm.h b/include/astra/CudaFilteredBackProjectionAlgorithm.h
index 1280e9a..974914a 100644
--- a/include/astra/CudaFilteredBackProjectionAlgorithm.h
+++ b/include/astra/CudaFilteredBackProjectionAlgorithm.h
@@ -33,6 +33,7 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
#include "Float32ProjectionData2D.h"
#include "Float32VolumeData2D.h"
#include "CudaReconstructionAlgorithm2D.h"
+#include "Filters.h"
#include "cuda/2d/astra.h"
@@ -52,8 +53,6 @@ private:
float m_fFilterD; // frequency cut-off
bool m_bShortScan; // short-scan mode for fan beam
- static E_FBPFILTER _convertStringToFilter(const char * _filterType);
-
public:
CCudaFilteredBackProjectionAlgorithm();
virtual ~CCudaFilteredBackProjectionAlgorithm();
diff --git a/include/astra/cuda/2d/fbp_filters.h b/include/astra/Filters.h
index 7c1121a..ff3f5c8 100644
--- a/include/astra/cuda/2d/fbp_filters.h
+++ b/include/astra/Filters.h
@@ -25,13 +25,14 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------
*/
-#ifndef FBP_FILTERS_H
-#define FBP_FILTERS_H
+#ifndef _INC_ASTRA_FILTERS_H
+#define _INC_ASTRA_FILTERS_H
namespace astra {
enum E_FBPFILTER
{
+ FILTER_ERROR, //< not a valid filter
FILTER_NONE, //< no filter (regular BP)
FILTER_RAMLAK, //< default FBP filter
FILTER_SHEPPLOGAN, //< Shepp-Logan
@@ -54,8 +55,17 @@ enum E_FBPFILTER
FILTER_SINOGRAM, //< every projection direction has its own filter
FILTER_RPROJECTION, //< projection filter in real space (as opposed to fourier space)
FILTER_RSINOGRAM, //< sinogram filter in real space
+
};
+// Generate filter of given size and parameters. Returns newly allocated array.
+float *genFilter(E_FBPFILTER _eFilter, float _fD, int _iProjectionCount,
+ int _iFFTRealDetectorCount,
+ int _iFFTFourierDetectorCount, float _fParameter = -1.0f);
+
+// Convert string to filter type. Returns FILTER_ERROR if unrecognized.
+E_FBPFILTER convertStringToFilter(const char * _filterType);
+
}
-#endif /* FBP_FILTERS_H */
+#endif
diff --git a/include/astra/cuda/2d/astra.h b/include/astra/cuda/2d/astra.h
index 6f0e2f0..a2f2219 100644
--- a/include/astra/cuda/2d/astra.h
+++ b/include/astra/cuda/2d/astra.h
@@ -28,7 +28,6 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
#ifndef _CUDA_ASTRA_H
#define _CUDA_ASTRA_H
-#include "fbp_filters.h"
#include "dims.h"
#include "algo.h"
diff --git a/include/astra/cuda/2d/fbp.h b/include/astra/cuda/2d/fbp.h
index 8666646..7febe69 100644
--- a/include/astra/cuda/2d/fbp.h
+++ b/include/astra/cuda/2d/fbp.h
@@ -26,7 +26,7 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
*/
#include "algo.h"
-#include "fbp_filters.h"
+#include "astra/Filters.h"
namespace astraCUDA {
diff --git a/include/astra/cuda/2d/fft.h b/include/astra/cuda/2d/fft.h
index d36cae2..f5f8477 100644
--- a/include/astra/cuda/2d/fft.h
+++ b/include/astra/cuda/2d/fft.h
@@ -31,7 +31,7 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
#include <cufft.h>
#include <cuda.h>
-#include "fbp_filters.h"
+#include "astra/Filters.h"
namespace astraCUDA {
@@ -60,9 +60,9 @@ void applyFilter(int _iProjectionCount, int _iFreqBinCount,
int calcFFTFourierSize(int _iFFTRealSize);
-void genFilter(astra::E_FBPFILTER _eFilter, float _fD, int _iProjectionCount,
- cufftComplex * _pFilter, int _iFFTRealDetectorCount,
- int _iFFTFourierDetectorCount, float _fParameter = -1.0f);
+void genCuFFTFilter(astra::E_FBPFILTER _eFilter, float _fD, int _iProjectionCount,
+ cufftComplex * _pFilter, int _iFFTRealDetectorCount,
+ int _iFFTFourierDetectorCount, float _fParameter = -1.0f);
void genIdenFilter(int _iProjectionCount, cufftComplex * _pFilter,
int _iFFTRealDetectorCount, int _iFFTFourierDetectorCount);