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

I/O class handling MHD file. More...

#include "GGEMSMHDImage.hh"

Collaboration diagram for GGEMSMHDImage:
Collaboration graph

Public Member Functions

 GGEMSMHDImage (void)
 GGEMSMHDImage constructor. More...
 
 ~GGEMSMHDImage (void)
 GGEMSMHDImage destructor. More...
 
 GGEMSMHDImage (GGEMSMHDImage const &mhd)=delete
 Avoid copy of the class by reference. More...
 
GGEMSMHDImageoperator= (GGEMSMHDImage const &mhd)=delete
 Avoid assignement of the class by reference. More...
 
 GGEMSMHDImage (GGEMSMHDImage const &&mhd)=delete
 Avoid copy of the class by rvalue reference. More...
 
GGEMSMHDImageoperator= (GGEMSMHDImage const &&mhd)=delete
 Avoid copy of the class by rvalue reference. More...
 
void SetOutputFileName (std::string const &basename)
 set the output filename (*.mhd) More...
 
void Read (std::string const &image_mhd_header_filename, cl::Buffer *solid_data, GGsize const &thread_index)
 read the mhd header More...
 
void Write (cl::Buffer *image, GGsize const &thread_index) const
 Write mhd header/raw file. More...
 
template<typename T >
void Write (T *image)
 write the raw data to file More...
 
void SetElementSizes (GGfloat3 const &element_sizes)
 set the size of the elements More...
 
void SetDimensions (GGsize3 const &dimensions)
 set the dimensions of the image More...
 
void SetDataType (std::string const &data_type)
 set the type of data More...
 
std::string GetDataMHDType (void) const
 get the mhd data type More...
 
std::string GetRawMDHfilename (void) const
 get the filename of raw data More...
 
std::string GetOutputDirectory (void) const
 get the output directory More...
 

Private Member Functions

void CheckParameters (void) const
 Check parameters before read/write MHD file. More...
 
template<typename T >
void WriteRaw (cl::Buffer *image, GGsize const &thread_index) const
 write the raw data to file More...
 

Private Attributes

std::string mhd_header_file_
 
std::string mhd_raw_file_
 
std::string output_dir_
 
std::string mhd_data_type_
 
GGfloat3 element_sizes_
 
GGsize3 dimensions_
 

Detailed Description

I/O class handling MHD file.

Definition at line 46 of file GGEMSMHDImage.hh.

Constructor & Destructor Documentation

◆ GGEMSMHDImage() [1/3]

GGEMSMHDImage::GGEMSMHDImage ( void  )

GGEMSMHDImage constructor.

Definition at line 42 of file GGEMSMHDImage.cc.

◆ ~GGEMSMHDImage()

GGEMSMHDImage::~GGEMSMHDImage ( void  )

GGEMSMHDImage destructor.

Definition at line 66 of file GGEMSMHDImage.cc.

◆ GGEMSMHDImage() [2/3]

GGEMSMHDImage::GGEMSMHDImage ( GGEMSMHDImage const &  mhd)
delete

Avoid copy of the class by reference.

Parameters
mhd- reference on the mhd file

◆ GGEMSMHDImage() [3/3]

GGEMSMHDImage::GGEMSMHDImage ( GGEMSMHDImage const &&  mhd)
delete

Avoid copy of the class by rvalue reference.

Parameters
mhd- rvalue reference on the mhd file

Member Function Documentation

◆ CheckParameters()

void GGEMSMHDImage::CheckParameters ( void  ) const
private

Check parameters before read/write MHD file.

Definition at line 165 of file GGEMSMHDImage.hh.

◆ GetDataMHDType()

std::string GGEMSMHDImage::GetDataMHDType ( void  ) const
inline

get the mhd data type

Returns
the type of data for mhd file

Definition at line 147 of file GGEMSMHDImage.hh.

◆ GetOutputDirectory()

std::string GGEMSMHDImage::GetOutputDirectory ( void  ) const
inline

get the output directory

Returns
the name of output directory

Definition at line 161 of file GGEMSMHDImage.hh.

◆ GetRawMDHfilename()

std::string GGEMSMHDImage::GetRawMDHfilename ( void  ) const
inline

get the filename of raw data

Returns
the name of raw file

Definition at line 154 of file GGEMSMHDImage.hh.

◆ operator=() [1/2]

GGEMSMHDImage & GGEMSMHDImage::operator= ( GGEMSMHDImage const &&  mhd)
delete

Avoid copy of the class by rvalue reference.

Parameters
mhd- rvalue reference on the mhd file

◆ operator=() [2/2]

GGEMSMHDImage & GGEMSMHDImage::operator= ( GGEMSMHDImage const &  mhd)
delete

Avoid assignement of the class by reference.

Parameters
mhd- reference on the mhd file

◆ Read()

void GGEMSMHDImage::Read ( std::string const &  image_mhd_header_filename,
cl::Buffer *  solid_data,
GGsize const &  thread_index 
)

read the mhd header

Parameters
image_mhd_header_filename- input mhd filename
solid_data- pointer on solid data
thread_index- index of the thread (= activated device index)

Definition at line 129 of file GGEMSMHDImage.cc.

◆ SetDataType()

void GGEMSMHDImage::SetDataType ( std::string const &  data_type)

set the type of data

Parameters
data_type- type of data

Definition at line 111 of file GGEMSMHDImage.cc.

◆ SetDimensions()

void GGEMSMHDImage::SetDimensions ( GGsize3 const &  dimensions)

set the dimensions of the image

Parameters
dimensions- dimensions of image in X, Y, Z

Definition at line 120 of file GGEMSMHDImage.cc.

◆ SetElementSizes()

void GGEMSMHDImage::SetElementSizes ( GGfloat3 const &  element_sizes)

set the size of the elements

Parameters
element_sizes- size of elements in X, Y, Z

Definition at line 102 of file GGEMSMHDImage.cc.

◆ SetOutputFileName()

void GGEMSMHDImage::SetOutputFileName ( std::string const &  basename)

set the output filename (*.mhd)

Parameters
basename- mhd file name

Definition at line 77 of file GGEMSMHDImage.cc.

◆ Write() [1/2]

void GGEMSMHDImage::Write ( cl::Buffer *  image,
GGsize const &  thread_index 
) const

Write mhd header/raw file.

Parameters
image- image to write on output file
thread_index- index of the thread (= activated device index)

Definition at line 223 of file GGEMSMHDImage.cc.

◆ Write() [2/2]

template<typename T >
void GGEMSMHDImage::Write ( T image)

write the raw data to file

Template Parameters
T- type of the data
Parameters
image- image to write on output file

Definition at line 194 of file GGEMSMHDImage.hh.

◆ WriteRaw()

template<typename T >
void GGEMSMHDImage::WriteRaw ( cl::Buffer *  image,
GGsize const &  thread_index 
) const
private

write the raw data to file

Template Parameters
T- type of the data
Parameters
image- image to write on output file
thread_index- index of the thread (= activated device index)

Definition at line 226 of file GGEMSMHDImage.hh.

Member Data Documentation

◆ dimensions_

GGsize3 GGEMSMHDImage::dimensions_
private

Dimension volume X, Y, Z

Definition at line 186 of file GGEMSMHDImage.hh.

◆ element_sizes_

GGfloat3 GGEMSMHDImage::element_sizes_
private

Size of elements

Definition at line 185 of file GGEMSMHDImage.hh.

◆ mhd_data_type_

std::string GGEMSMHDImage::mhd_data_type_
private

Type of data

Definition at line 184 of file GGEMSMHDImage.hh.

◆ mhd_header_file_

std::string GGEMSMHDImage::mhd_header_file_
private

Name of the MHD header file

Definition at line 181 of file GGEMSMHDImage.hh.

◆ mhd_raw_file_

std::string GGEMSMHDImage::mhd_raw_file_
private

Name of the MHD raw file

Definition at line 182 of file GGEMSMHDImage.hh.

◆ output_dir_

std::string GGEMSMHDImage::output_dir_
private

Output directory

Definition at line 183 of file GGEMSMHDImage.hh.


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