Create .g4dcm from .dcm in G4Py

I’m trying to include a CT scan in my g4py simulation using the extended/medical/DICOM example as my guide. I’ve gotten the example to compile and run in C++ no problem, but when I try to replace the DICOM files in that example with my own, it creates a segmentation fault (not really a surprise). However I can’t figure out how the example code is converting from unreadable DICOM pixels to readable GEANT4 voxels.

I’ve devised an approach based on the extended/medical/DICOM example to create the GEANT voxels as follows:

  1. Create mesh of voxels as cubes of water with equal area and positions.
  2. Set each voxel as a new density based on the DICOM data HU to density conversion.
  3. Place voxels in correct positions and simulate the data.

My question is for Medical Physicists in general, is approximating the geometry as water with different densities correct? I understand that dose is calculated assuming “Water Equivalent Thicknesses”, but shouldn’t the atomic structure matter quite a bit?

EDIT: I was way off with the water estimation. I figured out how to create the voxels with the correct tissue.

The file format and the way it is created is explained in the file examples/extended/medical/DICOM/README

1 Like