gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
Sinogram.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2017, Dr Franck P. Vidal (franck.p.vidal@fpvidal.net),
4 http://www.fpvidal.net/
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14 this list of conditions and the following disclaimer in the documentation and/or
15 other materials provided with the distribution.
16 
17 3. Neither the name of the Bangor University nor the names of its contributors
18 may be used to endorse or promote products derived from this software without
19 specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 
32 */
33 
34 
35 #ifndef __Sinogram_h
36 #define __Sinogram_h
37 
38 
56 //******************************************************************************
57 // Include
58 //******************************************************************************
59 #include <string>
60 
61 #ifndef __Image_h
62 #include "gVirtualXRay/Image.h"
63 #endif
64 
65 
66 //******************************************************************************
67 // namespace
68 //******************************************************************************
69 namespace gVirtualXRay {
70 
71 
72 //==============================================================================
77 //==============================================================================
78 template<typename T> class Sinogram: public Image<T>
79 //------------------------------------------------------------------------------
80 {
81 //******************************************************************************
82 public:
83  Sinogram();
84 
85 
86  Sinogram(const Image<T> anImage);
87 
88 
89  Sinogram(unsigned int aWidth,
90  unsigned int aHeight,
91  unsigned int aNumberOfSlices = 1);
92 
93  Image<T> getProjectionSet() const;
94 
95 
96  Image<T> art(double aFirstAngle,
97  double anAngleStep,
98  unsigned int aNumberOfIterations = 0,
99  const char* aDirectory = 0,
100  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*) = 0) const;
101 
102 
103  Image<T> mart(double aFirstAngle,
104  double anAngleStep,
105  unsigned int aNumberOfIterations = 0,
106  const char* aDirectory = 0,
107  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*) = 0) const;
108 
109 
110  Image<T> sirt(double aFirstAngle,
111  double anAngleStep,
112  unsigned int aNumberOfIterations = 0,
113  const char* aDirectory = 0,
114  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*) = 0) const;
115 
116 
117  Image<T> simpleBackProjection(double aFirstAngle,
118  double anAngleStep,
119  const char* aDirectorye = 0,
120  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*) = 0) const;
121 
122 
123  Image<T> filteredBackProjection(double aFirstAngle,
124  double anAngleStep,
125  const char* aFilterType = "hamming",
126  float aScalingFactor = 1.0,
127  const char* aDirectory = 0,
128  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*) = 0) const;
129 
130 
131  Image<T> art(double aFirstAngle,
132  double anAngleStep,
133  unsigned int aNumberOfIterations,
134  const std::string& aDirectory,
135  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*)) const;
136 
137 
138  Image<T> mart(double aFirstAngle,
139  double anAngleStep,
140  unsigned int aNumberOfIterations,
141  const std::string& aDirectory,
142  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*)) const;
143 
144 
145  Image<T> sirt(double aFirstAngle,
146  double anAngleStep,
147  unsigned int aNumberOfIterations,
148  const std::string& aDirectory,
149  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*)) const;
150 
151 
152  Image<T> simpleBackProjection(double aFirstAngle,
153  double anAngleStep,
154  const std::string& aDirectory,
155  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*)) const;
156 
157 
158  Image<T> filteredBackProjection(double aFirstAngle,
159  double anAngleStep,
160  const std::string& aFilterType,
161  float aScalingFactor,
162  const std::string& aDirectory,
163  void (*aCallback)(const Image<T>*, const Image<T>*, const Image<T>*)) const;
164 };
165 
166 
167 } // namespace gVirtualXRay
168 
169 
170 //******************************************************************************
171 #include "Sinogram.inl"
172 
173 
174 #endif // __Sinogram_h
Image< T > simpleBackProjection(double aFirstAngle, double anAngleStep, const char *aDirectorye=0, void(*aCallback)(const Image< T > *, const Image< T > *, const Image< T > *)=0) const
Definition: Sinogram.inl:395
Image< T > sirt(double aFirstAngle, double anAngleStep, unsigned int aNumberOfIterations=0, const char *aDirectory=0, void(*aCallback)(const Image< T > *, const Image< T > *, const Image< T > *)=0) const
Definition: Sinogram.inl:309
Class to handle a greyscale image.
Image< T > art(double aFirstAngle, double anAngleStep, unsigned int aNumberOfIterations=0, const char *aDirectory=0, void(*aCallback)(const Image< T > *, const Image< T > *, const Image< T > *)=0) const
Definition: Sinogram.inl:123
Image< T > mart(double aFirstAngle, double anAngleStep, unsigned int aNumberOfIterations=0, const char *aDirectory=0, void(*aCallback)(const Image< T > *, const Image< T > *, const Image< T > *)=0) const
Definition: Sinogram.inl:216
Image< T > getProjectionSet() const
Definition: Sinogram.inl:97
Image< T > filteredBackProjection(double aFirstAngle, double anAngleStep, const char *aFilterType="hamming", float aScalingFactor=1.0, const char *aDirectory=0, void(*aCallback)(const Image< T > *, const Image< T > *, const Image< T > *)=0) const
Definition: Sinogram.inl:458