|
GGEMS
1.1
GPU GEant4-based Monte Carlo Simulations
|
Go to the documentation of this file. 1 #ifndef GUARD_GGEMS_IO_GGEMSMHDIMAGE_HH
2 #define GUARD_GGEMS_IO_GGEMSMHDIMAGE_HH
35 #pragma warning(disable: 4251) // Deleting warning exporting STL members!!!
93 void SetOutputFileName(std::string
const& basename);
102 void Read(std::string
const& image_mhd_header_filename, cl::Buffer* solid_data,
GGsize const& thread_index);
110 void Write(cl::Buffer* image,
GGsize const& thread_index)
const;
119 void Write(
T* image);
126 void SetElementSizes(
GGfloat3 const& element_sizes);
133 void SetDimensions(
GGsize3 const& dimensions);
140 void SetDataType(std::string
const& data_type);
168 void CheckParameters(
void)
const;
177 template <
typename T>
178 void WriteRaw(cl::Buffer* image,
GGsize const& thread_index)
const;
193 template <
typename T>
203 out_header_stream <<
"ObjectType = Image" << std::endl;
204 out_header_stream <<
"BinaryDataByteOrderMSB = False" << std::endl;
205 out_header_stream <<
"NDims = 3" << std::endl;
208 out_header_stream <<
"ElementType = " <<
mhd_data_type_ << std::endl;
209 out_header_stream <<
"ElementDataFile = " <<
mhd_raw_file_ << std::endl;
210 out_header_stream.close();
218 out_raw_stream.close();
225 template <
typename T>
242 out_raw_stream.close();
245 #endif // End of GUARD_GGEMS_IO_GGEMSMHDIMAGE_HH
I/O class handling MHD file.
Structure storing 3 GGsize values.
void CheckParameters(void) const
Check parameters before read/write MHD file.
std::string mhd_data_type_
std::string GetRawMDHfilename(void) const
get the filename of raw data
void ReleaseDeviceBuffer(cl::Buffer *const device_ptr, T *host_ptr, GGsize const &thread_index)
Get the device pointer on host to write on it. Mandatory after a GetDeviceBufferWrite ou GetDeviceBuf...
GGEMSMHDImage & operator=(GGEMSMHDImage const &&mhd)=delete
Avoid copy of the class by rvalue reference.
GGEMSMHDImage & operator=(GGEMSMHDImage const &mhd)=delete
Avoid assignement of the class by reference.
void WriteRaw(cl::Buffer *image, GGsize const &thread_index) const
write the raw data to file
std::string GetOutputDirectory(void) const
get the output directory
void Write(cl::Buffer *image, GGsize const &thread_index) const
Write mhd header/raw file.
std::string mhd_raw_file_
GGEMSMHDImage(GGEMSMHDImage const &&mhd)=delete
Avoid copy of the class by rvalue reference.
GGEMSMHDImage(GGEMSMHDImage const &mhd)=delete
Avoid copy of the class by reference.
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
T * GetDeviceBuffer(cl::Buffer *device_ptr, GGsize const &size, GGsize const &thread_index)
Get the device pointer on host to write on it. ReleaseDeviceBuffer must be used after this method!...
#define GGendl
overload C++ std::endl
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
std::string mhd_header_file_
static GGEMSOpenCLManager & GetInstance(void)
Create at first time the Singleton.
std::string GetDataMHDType(void) const
get the mhd data type