How to convert ct images to .g4dcm format

hi geanters:
I have recently been working on an experiment that intends to use ct images to build a brain model. For this purpose I started to learn DICOM examples. I found that the model built by this example uses .g4dcm format images, so I would like to ask how to convert the common .dicom format images to .g4dcm format
Thank you for your answers, as a newbie I really need your help!

Hi @Jodie_Comer I really need your help as a newbie in GEANT4!
I want to use my own CT images in the DICOM example, and since this model uses .g4dcm format, can you tell me how to convert images from .dcm format to .g4dcm format, and the steps I need to do follow to import my phantom, I really appreciate your help.
Sincerely.

This is described in the README of the example examples/extended/medical/DICOM

I’ll tell you about the process. Can I get a contact? If you are Chinese please give a wechat, or e-mail.

1 Like

@Jodie_Comer Yes of course thank you very much for your help
Here is my email: saalwa7373@gmail.com

@arce Thank you for your reply. I’ve already read the README but didn’t quite understand it, which is why I asked the question.

@Ihssane98
As said by Dr. @arce !!
In the readme, it is written clearly to use the Data.dat file where you define Ihssane98.g4dcm file in the last line. [Look data.dat.new last line]
After a run without beam you have your desired g4dcm file.

VRS

1 Like

Thank you @drvijayraj I tried it, it works, but my question if I want to import several CT images for example the thoracic part can I do it in the DICOM example? Because I tried to introduce 3 image.dcm it works, but when I increase the number of CT images I see nothing in the graphical interface.

@Ihssane98
To view in graphical interface means in QT window considering OGL viewer has a primitive limit,
/vis/ogl/set/displayListLimit (your choice) may help to set the primitives.

However, it is bit challenge to visualize so many pixels say several as 10 slides do have 2621440 pixels and requires quite a cost of memory.

To view with lower compression is possible and this can be done by changing compression to 32 or larger.

Also, color.dat is what RGB color coding need to fill if graphical interface is interested. Therefore you need to define materials as defined in the data set.

VRS

1 Like

@drvijayraj
If for example I want to build the thoracic part as shown in the image in the DICOM example, is this feasible?
Capture d’écran du 2024-03-21 14-20-26

If yes I have to change the compression as you have already mentioned.
I think the compression you are talking about is in the first line Data.dat.new

:COMPRESSION 2

Should I replace 2 with 32 and more and thank you very much for your dedicated tone in answering me.
Sincerely.

@Ihssane98

Compression depends on the O indexing algorithm. Changing value means changing the volume of the pixel indeed the material properties of the voxel.
Therefore for simulations use 1, for visualization use greater number divisible by 512 without beam ON.

VRS

1 Like

@drvijayraj
Thank you sir for his clarifications.
Can I import several images for example the thoracic part of the woman so that I can know the dose deposited in the entire organ (Breast) and also the dose deposited in the OARs, is this feasible?

Ofcourse you can import as many images.

:slight_smile:

VRS

Here are the steps I followed to introduce these images: I put them in DICOM source, and then I declared them in Data.dat.new and in CMakeLists.txt, is this the correct method?
Can you give me your e-mail ?