[Gate-users] Could not find definition of material in material files

Thu Nov 11 12:33:10 CET 2021

Hi everyone.

Hopefully this is a really easy fix and I'm just being dumb, but I can't seem to solve me issue. I'm trying to import a DICOM image of a typical NEMA phantom to play with in Gate, and when I run my macro, I get the following error (at the bottom of the page for space reasons). I've based most of my macro off the examples in the readthedocs. My initial thoughts were maybe that some of the locations of the files was incorrect, but moving them around file structure hasn't helped.

I think the relevant part of my main.mac is:

#patient image from voxel CT phantom (import image and convert HU to materials)

/gate/world/daughters/name patientCT

/gate/world/daughters/insert ImageNestedParametrisedVolume

/gate/patientCT/geometry/setImage data/dcm/CTDataset/Series_3_CT_WB_3.0_B30f_Inst1.dcm

/gate/patientCT/geometry/setRangeToMaterialFile data/patient_HU2Mat.dat

/gate/patientCT/geometry/setHUToMaterialFile data/patient_HU2Mat.dat

Patient_HU2Mat.dat is only a couple of lines and is very similar to the example in the readthedocs, just adjusted for my CT of the NEMA phantom. I've tried different values for CT numbers, and it adjusts the error message accordingly (so I'm pretty confident that it is this file or part of the mac that is the issue). Air, Water and PMMA are definitely in GateMaterials.db file.
-1024 -51 Air
-50 50 Water
51 1338 PMMA

Error message:
[Core-0] *************************************************
[Core-0] You are using Geant4 version 10.6.1
[Core-0] Starting macro mac/main.mac
I/O warning : failed to load external entity "./Materials.xml"
I/O warning: Discard the previous warning if your simulation doesn't transport OPTICAL PHOTONS.
Otherwise, please copy the ./Materials.xml file from the gate-source directory in the directory where you run your main macro.
[Physic-0] The following Geant4's physic-list is enabled :emStandard_opt4
[Core-0] Initialization of geometry
[Image-1]  Matrix Size= (500,500,348)
[Image-1]  HalfSize= (250,250,174)
[Image-1]  Resol= (512,512,174)
[Image-1]  VoxelSize= (0.976563,0.976563,2)
[Image-1]  Origin= (-250,-464,-981.5)
[Image-1]  planeSize= 262144
[Image-1]  lineSize= 512
[Image-1]  nbOfValues= 45613056
[Image-1]  PixelSize= 4
[Image-1]  dataSize = 45613056
GateMaterialDatabase.cc (l.174): GateMaterialDatabase: could not find the definition for material '-51' in material files

Thank you very any light you can shed on this.

Mark Baker
Clinical Scientist
Imaging Physics (Ionising)
The Clatterbridge Cancer Centre NHS Foundation Trust

CCCW Tel:  0151 556 5030
CCCL Tel: 0151 318 8438
Email: mark.baker23 at nhs.net<mailto:mark.baker23 at nhs.net>
Microsoft Teams (click here)<https://teams.microsoft.com/l/chat/0/0?users=mark.baker23@nhs.net>

Honorary Lecturer, Dept. of Physics
University of Liverpool

[CCC email footer April 2021]

************************************************************************************** ******************************

This message may contain confidential information. If you are not the intended recipient please:
i) inform the sender that you have received the message in error before deleting it; and
ii) do not disclose, copy or distribute information in this e-mail or take any action in relation to its content (to do so is strictly prohibited and may be unlawful).
Thank you for your co-operation.

NHSmail is the secure email, collaboration and directory service available for all NHS staff in England. NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and other accredited email services.

For more information and to find out how you can switch visit Joining NHSmail - NHSmail Support<https://support.nhs.net/article-categories/joining-nhsmail/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20211111/105828ca/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 13494 bytes
Desc: image003.jpg
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20211111/105828ca/attachment-0001.jpg>

More information about the Gate-users mailing list