|
GGEMS
1.1
GPU GEant4-based Monte Carlo Simulations
|
Go to the documentation of this file.
42 GGcout(
"GGEMSTube",
"GGEMSTube", 3) <<
"GGEMSTube creating..." <<
GGendl;
48 GGcout(
"GGEMSTube",
"GGEMSTube", 3) <<
"GGEMSTube created!!!" <<
GGendl;
57 GGcout(
"GGEMSTube",
"~GGEMSTube", 3) <<
"GGEMSTube erasing..." <<
GGendl;
59 GGcout(
"GGEMSTube",
"~GGEMSTube", 3) <<
"GGEMSTube erased!!!" <<
GGendl;
68 GGcout(
"GGEMSTube",
"Initialize", 3) <<
"Initializing GGEMSTube solid volume..." <<
GGendl;
71 std::string
const kOpenCLKernelPath = OPENCL_KERNEL_PATH;
72 std::string
const kFilename = kOpenCLKernelPath +
"/DrawGGEMSTube.cl";
81 std::string
const kDataType =
"-D" + volume_creator_manager.
GetDataType();
91 GGcout(
"GGEMSTube",
"Draw", 3) <<
"Drawing Tube..." <<
GGendl;
101 cl::Event*
event = opencl_manager.
GetEvent(0);
105 std::string device_name = opencl_manager.
GetDeviceName(device_index);
106 std::ostringstream oss(std::ostringstream::out);
107 oss <<
"GGEMSTube::Draw on " << device_name <<
", index " << device_index;
112 GGint3 phantom_dimensions;
125 cl::NDRange global_wi(number_of_work_items);
126 cl::NDRange local_wi(work_group_size);
156 return new(std::nothrow)
GGEMSTube(radius_x, radius_y, height, unit);
GGfloat3 GetElementsSizes() const
size of voxels in the voxelized volume
cl::Kernel ** kernel_draw_volume_
GGsize GetNumberElements(void) const
Return the total number of voxels.
Mother class handle volume.
std::string GetDataType(void) const
get the type of data
static GGEMSVolumeCreatorManager & GetInstance(void)
Create at first time the Singleton.
static GGEMSProfilerManager & GetInstance(void)
Create at first time the Singleton.
void CheckOpenCLError(GGint const &error, std::string const &class_name, std::string const &method_name) const
check the OpenCL error
void Initialize(void) override
Initialize the solid and store it in Phantom creator manager.
cl::Buffer * GetVoxelizedVolume(void) const
Return the voxelized volume on OpenCL device.
GGsize GetBestWorkItem(GGsize const &number_of_elements) const
get the best number of work item
cl::Event * GetEvent(GGsize const &thread_index) const
return an event to activated context
void set_position_tube(GGEMSTube *tube, GGfloat const pos_x, GGfloat const pos_y, GGfloat const pos_z, char const *unit)
Set the position of the tube.
void set_label_value_tube(GGEMSTube *tube, GGfloat const label_value)
Set the label value in tube.
void draw_tube(GGEMSTube *tube)
Draw analytical volume in voxelized phantom.
GGEMS class managing profiler data.
GGsize GetWorkGroupSize(void) const
Get the work group size defined in GGEMS on activated OpenCL context.
Singleton class handling convertion from analytical volume to voxelized volume.
~GGEMSTube(void)
GGEMSTube destructor.
void set_material_tube(GGEMSTube *tube, char const *material)
Set the material of the tube.
Class GGEMSTube inheriting from GGEMSVolume handling Tube solid.
Class GGEMSTube inheriting from GGEMSVolume handling Tube solid.
void SetLabelValue(GGfloat const &label_value)
Set the label value.
void CompileKernel(std::string const &kernel_filename, std::string const &kernel_name, cl::Kernel **kernel_list, char *const custom_options=nullptr, char *const additional_options=nullptr)
Compile the OpenCL kernel on the activated device.
GGsize3 GetVolumeDimensions() const
dimensions of volume
void Draw(void) override
Draw analytical volume in voxelized phantom.
Namespace storing all the usefull physical units.
GGEMSTube * create_tube(GGfloat const radius_x, GGfloat const radius_y, GGfloat const height, char const *unit)
Create instance of GGEMSTube.
#define GGendl
overload C++ std::endl
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
void delete_tube(GGEMSTube *tube)
Delete instance of GGEMSTube.
std::string GetDeviceName(GGsize const &device_index) const
Get the name of the activated device.
GGEMS class managing profiler data.
void SetPosition(GGfloat const &pos_x, GGfloat const &pos_y, GGfloat const &pos_z, std::string const &unit="mm")
Set the solid phantom position.
void HandleEvent(cl::Event event, std::string const &profile_name)
handle an OpenCL event in profile_name type
GGsize GetIndexOfActivatedDevice(GGsize const &thread_index) const
get the index of activated device
GGEMSTube(GGfloat const &radius_x, GGfloat const &radius_y, GGfloat const &height, std::string const &unit="mm")
GGEMSTube constructor.
cl::CommandQueue * GetCommandQueue(GGsize const &thread_index) const
Return the command queue to activated context.
T DistanceUnit(T const &value, std::string const &unit)
Choose best distance unit.
static GGEMSOpenCLManager & GetInstance(void)
Create at first time the Singleton.
void initialize_tube(GGEMSTube *tube)
Initialize the solid and store it in Phantom creator manager.
void SetMaterial(std::string const &material)
set the material, Air by default