RISA
|
This stage multiplies a precomputed mask with the reconstructed image. More...
#include <Masking.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... | |
Public Member Functions | |
Masking (const std::string &configFile) | |
Initializes everything, that needs to be done only once. More... | |
~Masking () | |
Destroys everything that is not destroyed automatically. More... | |
auto | process (input_type &&img) -> 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 (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 > > | imgs_ |
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... | |
int | numberOfDevices_ |
the number of available CUDA devices in the system More... | |
int | numberOfPixels_ |
the number of pixels in the reconstruction grid in one dimension More... | |
bool | performNormalization_ {true} |
specifies, if the normalization via thrust shall be performed (! performance drop, so far) More... | |
float | maskingValue_ {0.0} |
the value to which the masked area should be set More... | |
This stage multiplies a precomputed mask with the reconstructed image.
This class represents a masking stage. It multiplies the reconstructed image with a precomputed mask in a CUDA kernel, to hide irrelevant areas.
risa::cuda::Masking::Masking | ( | 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.
[in] | configFile | path to configuration file |
Definition at line 55 of file Masking.cu.
risa::cuda::Masking::~Masking | ( | ) |
Destroys everything that is not destroyed automatically.
Destroys the cudaStreams.
Definition at line 80 of file Masking.cu.
auto risa::cuda::Masking::process | ( | input_type && | img | ) | -> void |
Pushes the filtered parallel beam sinogram to the processor-threads.
[in] | inp | input data that arrived from previous stage |
Definition at line 88 of file Masking.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 reconstruced image from the queue. It calls the masking CUDA kernel in its own stream. After the multiplication of the mask with the image, the result is pushed into the output queue
[in] | deviceID | specifies on which CUDA device to execute the device functions |
Definition at line 113 of file Masking.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 146 of file Masking.cu.
auto risa::cuda::Masking::wait | ( | ) | -> output_type |
Takes one image from the output queue results_ and transfers it to the neighbored stage.
Definition at line 109 of file Masking.cu.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
stores the processor()-threads
|
private |
|
private |