GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSVolumeCreatorManager Class Reference

Singleton class handling convertion from analytical volume to voxelized volume. More...

#include "GGEMSVolumeCreatorManager.hh"

Collaboration diagram for GGEMSVolumeCreatorManager:
Collaboration graph

Public Member Functions

 GGEMSVolumeCreatorManager (GGEMSVolumeCreatorManager const &volume_creator_manager)=delete
 Avoid copy of the singleton by reference. More...
 
GGEMSVolumeCreatorManageroperator= (GGEMSVolumeCreatorManager const &volume_creator_manager)=delete
 Avoid assignement of the singleton by reference. More...
 
 GGEMSVolumeCreatorManager (GGEMSVolumeCreatorManager const &&volume_creator_manager)=delete
 Avoid copy of the singleton by rvalue reference. More...
 
GGEMSVolumeCreatorManageroperator= (GGEMSVolumeCreatorManager const &&volume_creator_manager)=delete
 Avoid copy of the singleton by rvalue reference. More...
 
void SetElementSizes (GGfloat const &voxel_width, GGfloat const &voxel_height, GGfloat const &voxel_depth, std::string const &unit="mm")
 Set the size of the elements for the voxelized volume. More...
 
GGfloat3 GetElementsSizes () const
 size of voxels in the voxelized volume More...
 
void SetVolumeDimensions (GGsize const &volume_width, GGsize const &volume_height, GGsize const &volume_depth)
 Set the dimension of the volume for the voxelized volume. More...
 
GGsize3 GetVolumeDimensions () const
 dimensions of volume More...
 
void SetMaterial (std::string const &material="Air")
 set the material, Air by default More...
 
GGsize GetNumberElements (void) const
 Return the total number of voxels. More...
 
std::string GetDataType (void) const
 get the type of data More...
 
cl::Buffer * GetVoxelizedVolume (void) const
 Return the voxelized volume on OpenCL device. More...
 
void SetOutputImageFilename (std::string const &output_image_filename)
 Set the filename of MHD output. More...
 
void SetRangeToMaterialDataFilename (std::string const &output_range_to_material_filename)
 Set the filename of range to material data. More...
 
void AddLabelAndMaterial (GGfloat const &label, std::string const &material)
 add the label and the material More...
 
void SetDataType (std::string const &data_type="MET_FLOAT")
 set the type of data More...
 
void Initialize (void)
 Initialize the volume Creator manager. More...
 
void Write (void)
 Save the voxelized volume to raw data in mhd file. More...
 
void Clean (void)
 clean OpenCL data More...
 

Static Public Member Functions

static GGEMSVolumeCreatorManagerGetInstance (void)
 Create at first time the Singleton. More...
 

Private Member Functions

 GGEMSVolumeCreatorManager (void)
 Unable the constructor for the user. More...
 
 ~GGEMSVolumeCreatorManager (void)
 Unable the destructor for the user. More...
 
void CheckParameters (void) const
 Check the mandatory parameters. More...
 
void WriteMHDImage (void) const
 Write output MHD file. More...
 
void WriteRangeToMaterialFile (void)
 Write the file with range to material data. More...
 
template<typename T >
void AllocateImage (void)
 allocating buffer storing volume More...
 

Private Attributes

GGfloat3 element_sizes_
 
GGsize3 volume_dimensions_
 
GGsize number_elements_
 
std::string data_type_
 
std::string output_image_filename_
 
std::string output_range_to_material_filename_
 
cl::Buffer * voxelized_volume_
 
LabelToMaterialMap label_to_material_
 

Detailed Description

Singleton class handling convertion from analytical volume to voxelized volume.

Definition at line 48 of file GGEMSVolumeCreatorManager.hh.

Constructor & Destructor Documentation

◆ GGEMSVolumeCreatorManager() [1/3]

GGEMSVolumeCreatorManager::GGEMSVolumeCreatorManager ( void  )
private

Unable the constructor for the user.

Definition at line 39 of file GGEMSVolumeCreatorManager.cc.

◆ ~GGEMSVolumeCreatorManager()

GGEMSVolumeCreatorManager::~GGEMSVolumeCreatorManager ( void  )
private

Unable the destructor for the user.

Definition at line 63 of file GGEMSVolumeCreatorManager.cc.

◆ GGEMSVolumeCreatorManager() [2/3]

GGEMSVolumeCreatorManager::GGEMSVolumeCreatorManager ( GGEMSVolumeCreatorManager const &  volume_creator_manager)
delete

Avoid copy of the singleton by reference.

Parameters
volume_creator_manager- reference on the singleton

◆ GGEMSVolumeCreatorManager() [3/3]

GGEMSVolumeCreatorManager::GGEMSVolumeCreatorManager ( GGEMSVolumeCreatorManager const &&  volume_creator_manager)
delete

Avoid copy of the singleton by rvalue reference.

Parameters
volume_creator_manager- rvalue reference on the singleton

Member Function Documentation

◆ AddLabelAndMaterial()

void GGEMSVolumeCreatorManager::AddLabelAndMaterial ( GGfloat const &  label,
std::string const &  material 
)

add the label and the material

Parameters
label- label of material
material- material of the volume

Definition at line 148 of file GGEMSVolumeCreatorManager.cc.

◆ AllocateImage()

template<typename T >
void GGEMSVolumeCreatorManager::AllocateImage ( void  )
private

allocating buffer storing volume

Template Parameters
T- type of data

Definition at line 253 of file GGEMSVolumeCreatorManager.hh.

◆ CheckParameters()

void GGEMSVolumeCreatorManager::CheckParameters ( void  ) const
private

Check the mandatory parameters.

Definition at line 183 of file GGEMSVolumeCreatorManager.cc.

◆ Clean()

void GGEMSVolumeCreatorManager::Clean ( void  )

clean OpenCL data

Definition at line 74 of file GGEMSVolumeCreatorManager.cc.

◆ GetDataType()

std::string GGEMSVolumeCreatorManager::GetDataType ( void  ) const
inline

get the type of data

Returns
the type of the data

Definition at line 154 of file GGEMSVolumeCreatorManager.hh.

◆ GetElementsSizes()

GGfloat3 GGEMSVolumeCreatorManager::GetElementsSizes ( ) const
inline

size of voxels in the voxelized volume

Returns
a 3d float with the size of voxel in voxelized volume

Definition at line 116 of file GGEMSVolumeCreatorManager.hh.

◆ GetInstance()

static GGEMSVolumeCreatorManager & GGEMSVolumeCreatorManager::GetInstance ( void  )
inlinestatic

Create at first time the Singleton.

Returns
Object of type GGEMSVolumeCreatorManager

Definition at line 67 of file GGEMSVolumeCreatorManager.hh.

◆ GetNumberElements()

GGsize GGEMSVolumeCreatorManager::GetNumberElements ( void  ) const
inline

Return the total number of voxels.

Returns
number of voxel in the voxelized volume

Definition at line 147 of file GGEMSVolumeCreatorManager.hh.

◆ GetVolumeDimensions()

GGsize3 GGEMSVolumeCreatorManager::GetVolumeDimensions ( ) const
inline

dimensions of volume

Parameters
index- index of dimension x, y or z
Returns
a 3d int with the dimenstion of the voxelized volume

Definition at line 133 of file GGEMSVolumeCreatorManager.hh.

◆ GetVoxelizedVolume()

cl::Buffer * GGEMSVolumeCreatorManager::GetVoxelizedVolume ( void  ) const
inline

Return the voxelized volume on OpenCL device.

Returns
pointer on OpenCL device storing voxelized volume

Definition at line 161 of file GGEMSVolumeCreatorManager.hh.

◆ Initialize()

void GGEMSVolumeCreatorManager::Initialize ( void  )

Initialize the volume Creator manager.

Definition at line 212 of file GGEMSVolumeCreatorManager.cc.

◆ operator=() [1/2]

GGEMSVolumeCreatorManager & GGEMSVolumeCreatorManager::operator= ( GGEMSVolumeCreatorManager const &&  volume_creator_manager)
delete

Avoid copy of the singleton by rvalue reference.

Parameters
volume_creator_manager- rvalue reference on the singleton

◆ operator=() [2/2]

GGEMSVolumeCreatorManager & GGEMSVolumeCreatorManager::operator= ( GGEMSVolumeCreatorManager const &  volume_creator_manager)
delete

Avoid assignement of the singleton by reference.

Parameters
volume_creator_manager- reference on the singleton

◆ SetDataType()

void GGEMSVolumeCreatorManager::SetDataType ( std::string const &  data_type = "MET_FLOAT")

set the type of data

Parameters
data_type- type of data

Definition at line 125 of file GGEMSVolumeCreatorManager.cc.

◆ SetElementSizes()

void GGEMSVolumeCreatorManager::SetElementSizes ( GGfloat const &  voxel_width,
GGfloat const &  voxel_height,
GGfloat const &  voxel_depth,
std::string const &  unit = "mm" 
)

Set the size of the elements for the voxelized volume.

Parameters
voxel_width- voxel width
voxel_height- voxel height
voxel_depth- voxel depth
unit- unit of the distance

Definition at line 92 of file GGEMSVolumeCreatorManager.cc.

◆ SetMaterial()

void GGEMSVolumeCreatorManager::SetMaterial ( std::string const &  material = "Air")

set the material, Air by default

Parameters
material- name of the material

Definition at line 136 of file GGEMSVolumeCreatorManager.hh.

◆ SetOutputImageFilename()

void GGEMSVolumeCreatorManager::SetOutputImageFilename ( std::string const &  output_image_filename)

Set the filename of MHD output.

Parameters
output_image_filename- output image filename

Definition at line 165 of file GGEMSVolumeCreatorManager.cc.

◆ SetRangeToMaterialDataFilename()

void GGEMSVolumeCreatorManager::SetRangeToMaterialDataFilename ( std::string const &  output_range_to_material_filename)

Set the filename of range to material data.

Parameters
output_range_to_material_filename- output range to material filename

Definition at line 174 of file GGEMSVolumeCreatorManager.cc.

◆ SetVolumeDimensions()

void GGEMSVolumeCreatorManager::SetVolumeDimensions ( GGsize const &  volume_width,
GGsize const &  volume_height,
GGsize const &  volume_depth 
)

Set the dimension of the volume for the voxelized volume.

Parameters
volume_width- volume width
volume_height- volume height
volume_depth- volume depth

Definition at line 103 of file GGEMSVolumeCreatorManager.cc.

◆ Write()

void GGEMSVolumeCreatorManager::Write ( void  )

Save the voxelized volume to raw data in mhd file.

Definition at line 232 of file GGEMSVolumeCreatorManager.cc.

◆ WriteMHDImage()

void GGEMSVolumeCreatorManager::WriteMHDImage ( void  ) const
private

Write output MHD file.

Definition at line 266 of file GGEMSVolumeCreatorManager.cc.

◆ WriteRangeToMaterialFile()

void GGEMSVolumeCreatorManager::WriteRangeToMaterialFile ( void  )
private

Write the file with range to material data.

Definition at line 245 of file GGEMSVolumeCreatorManager.cc.

Member Data Documentation

◆ data_type_

std::string GGEMSVolumeCreatorManager::data_type_
private

Type of data

Definition at line 241 of file GGEMSVolumeCreatorManager.hh.

◆ element_sizes_

GGfloat3 GGEMSVolumeCreatorManager::element_sizes_
private

Size of voxels of voxelized volume

Definition at line 238 of file GGEMSVolumeCreatorManager.hh.

◆ label_to_material_

LabelToMaterialMap GGEMSVolumeCreatorManager::label_to_material_
private

Map of label to material

Definition at line 245 of file GGEMSVolumeCreatorManager.hh.

◆ number_elements_

GGsize GGEMSVolumeCreatorManager::number_elements_
private

Total number of elements

Definition at line 240 of file GGEMSVolumeCreatorManager.hh.

◆ output_image_filename_

std::string GGEMSVolumeCreatorManager::output_image_filename_
private

Output MHD where is stored the voxelized volume

Definition at line 242 of file GGEMSVolumeCreatorManager.hh.

◆ output_range_to_material_filename_

std::string GGEMSVolumeCreatorManager::output_range_to_material_filename_
private

Output text file with range to material data

Definition at line 243 of file GGEMSVolumeCreatorManager.hh.

◆ volume_dimensions_

GGsize3 GGEMSVolumeCreatorManager::volume_dimensions_
private

Dimension of volume X, Y, Z

Definition at line 239 of file GGEMSVolumeCreatorManager.hh.

◆ voxelized_volume_

cl::Buffer* GGEMSVolumeCreatorManager::voxelized_volume_
private

Voxelized volume on OpenCL device

Definition at line 244 of file GGEMSVolumeCreatorManager.hh.


The documentation for this class was generated from the following files: