RISA
|
This stage back projects a parallel beam sinogram and returns the reconstructed image. More...
#include <Backprojection.h>
Public Types | |
using | input_type = glados::Image< glados::cuda::DeviceMemoryManager< float, glados::cuda::async_copy_policy >> |
The input data type that needs to fit the output type of the previous stage. More... | |
using | output_type = glados::Image< glados::cuda::DeviceMemoryManager< float, glados::cuda::async_copy_policy >> |
The output data type that needs to fit the input type of the following stage. More... | |
using | deviceManagerType = glados::cuda::DeviceMemoryManager< float, glados::cuda::async_copy_policy > |
Public Member Functions | |
Backprojection (const std::string &configFile) | |
Initializes everything, that needs to be done only once. More... | |
~Backprojection () | |
Destroys everything that is not destroyed automatically. More... | |
auto | process (input_type &&inp) -> void |
Pushes the filtered parallel beam sinogram to the processor-threads. More... | |
auto | wait () -> output_type |
Takes one image from the output queue results_ and transfers it to the neighbored stage. More... | |
Private Member Functions | |
auto | processor (const int deviceID) -> void |
main data processing routine executed in its own thread for each CUDA device, that performs the data processing of this stage More... | |
auto | readConfig (const std::string &configFile) -> bool |
Read configuration values from configuration file. More... | |
Private Attributes | |
std::map< int, glados::Queue< input_type > > | sinograms_ |
one separate input queue for each available CUDA device More... | |
glados::Queue< output_type > | results_ |
the output queue in which the processed sinograms are stored More... | |
std::map< int, std::thread > | processorThreads_ |
stores the processor()-threads More... | |
std::map< int, cudaStream_t > | streams_ |
stores the cudaStreams that are created once More... | |
std::vector< unsigned int > | memoryPoolIdxs_ |
stores the indeces received when regisitering in MemoryPool More... | |
int | numberOfProjections_ |
the number of projections in the parallel beam sinogramm over 180 degrees More... | |
int | numberOfDetectors_ |
the number of detectors in the parallel beam sinogramm More... | |
int | numberOfPixels_ |
the number of pixels in the reconstruction grid in one dimension More... | |
float | rotationOffset_ |
the rotation of the reconstructed image More... | |
float | backProjectionAngleTotal_ |
180° or 360° degrees More... | |
int | numberOfDevices_ |
the number of available CUDA devices in the system More... | |
detail::InterpolationType | interpolationType_ |
the interpolation type that shall be used More... | |
int | blockSize2D_ |
2D block size of the back projection kernel More... | |
int | memPoolSize_ |
specifies, how many elements are allocated by memory pool More... | |
bool | useTextureMemory_ |
stores, whether texture memory should be used (only nearest neighbour interpolation possible) More... | |
This stage back projects a parallel beam sinogram and returns the reconstructed image.
This class represents the back projection stage. It computes the back projection on the GPU using the CUDA language. Multi GPU usage is supported.
Definition at line 109 of file Backprojection.h.
using risa::cuda::Backprojection::deviceManagerType = glados::cuda::DeviceMemoryManager<float, glados::cuda::async_copy_policy> |
Definition at line 115 of file Backprojection.h.
using risa::cuda::Backprojection::input_type = glados::Image<glados::cuda::DeviceMemoryManager<float, glados::cuda::async_copy_policy>> |
The input data type that needs to fit the output type of the previous stage.
Definition at line 112 of file Backprojection.h.
using risa::cuda::Backprojection::output_type = glados::Image<glados::cuda::DeviceMemoryManager<float, glados::cuda::async_copy_policy>> |
The output data type that needs to fit the input type of the following stage.
Definition at line 114 of file Backprojection.h.
risa::cuda::Backprojection::Backprojection | ( | const std::string & | configFile | ) |
Initializes everything, that needs to be done only once.
Runs as many processor-thread as CUDA devices are available in the system. Allocates memory using the MemoryPool for all CUDA devices.
[in] | configFile | path to configuration file |
Definition at line 46 of file Backprojection.cu.
risa::cuda::Backprojection::~Backprojection | ( | ) |
Destroys everything that is not destroyed automatically.
Tells MemoryPool to free the allocated memory. Destroys the cudaStreams.
Definition at line 80 of file Backprojection.cu.
auto risa::cuda::Backprojection::process | ( | input_type && | inp | ) | -> void |
Pushes the filtered parallel beam sinogram to the processor-threads.
[in] | inp | input data that arrived from previous stage |
Definition at line 91 of file Backprojection.cu.
|
private |
main data processing routine executed in its own thread for each CUDA device, that performs the data processing of this stage
This method takes one sinogram from the queue. It calls the desired back projection CUDA kernel in its own stream. After the computation of the back projection, the reconstructed image is pushed into the output queue
[in] | deviceID | specifies on which CUDA device to execute the device functions |
[in] | streamID | specifies on which CUDA stream to execute the device functions |
Definition at line 115 of file Backprojection.cu.
|
private |
Read configuration values from configuration file.
All values needed for setting up the class are read from the config file in this function.
[in] | configFile | path to config file |
true | configuration options were read successfully |
false | configuration options could not be read successfully |
Definition at line 210 of file Backprojection.cu.
auto risa::cuda::Backprojection::wait | ( | ) | -> output_type |
Takes one image from the output queue results_ and transfers it to the neighbored stage.
Definition at line 111 of file Backprojection.cu.
|
private |
180° or 360° degrees
Definition at line 162 of file Backprojection.h.
|
private |
2D block size of the back projection kernel
Definition at line 169 of file Backprojection.h.
|
private |
the interpolation type that shall be used
Definition at line 166 of file Backprojection.h.
|
private |
stores the indeces received when regisitering in MemoryPool
Definition at line 156 of file Backprojection.h.
|
private |
specifies, how many elements are allocated by memory pool
Definition at line 170 of file Backprojection.h.
|
private |
the number of detectors in the parallel beam sinogramm
Definition at line 159 of file Backprojection.h.
|
private |
the number of available CUDA devices in the system
Definition at line 164 of file Backprojection.h.
|
private |
the number of pixels in the reconstruction grid in one dimension
Definition at line 160 of file Backprojection.h.
|
private |
the number of projections in the parallel beam sinogramm over 180 degrees
Definition at line 158 of file Backprojection.h.
|
private |
stores the processor()-threads
Definition at line 154 of file Backprojection.h.
|
private |
the output queue in which the processed sinograms are stored
Definition at line 152 of file Backprojection.h.
|
private |
the rotation of the reconstructed image
Definition at line 161 of file Backprojection.h.
|
private |
one separate input queue for each available CUDA device
Definition at line 151 of file Backprojection.h.
|
private |
stores the cudaStreams that are created once
Definition at line 155 of file Backprojection.h.
|
private |
stores, whether texture memory should be used (only nearest neighbour interpolation possible)
Definition at line 172 of file Backprojection.h.