OpenGATE / GateContrib

User-oriented public repository of Gate (macros, examples and user contributions)
77 stars 135 forks source link

/dosimetry/Radioteraphy/example2 issue with GateVImageVolume.cc #29

Closed sw-dev-code closed 5 years ago

sw-dev-code commented 5 years ago

I've got the following error when running example 2:

[Core-0] Initialization of geometry
MetaImage: M_ReadElementsData: data not read completely
   ideal = 3524472 : actual = 132
GateVImageVolume.cc (l.386): The image contains HU indices out of range of the HU range found in /home/user/Gate/examples/example2/data/patient-HU2mat.txt
HU    min, max: -1, 3001
Image min, max: 0, 31337
Abort.

Sistem configuration: Ubuntu 18.04 gcc 7.4 root version 6.08 (also tried with 6.16 and 6.18) Geant 4.10.03

Thank you in advance.

djboersma commented 5 years ago

Hi Milan! From ideal = 3524472 : actual = 132 I can see that you cloned GateContrib without LFS. If you check with ls -l in the data folder you'll see that the patient-2mm.raw file has a size of only 132 bytes, while 3524472 is expected.

Most of the (typically bulky) input data in this project require the LFS ("large file support") extension to git. So please make sure that you have this extension installed (see the readme.md of GateContrib, on ubuntu & friends it's very simple with sudo apt install git-lfs) and run

git lfs clone https://github.com/OpenGATE/GateContrib.git

Then try to run the example again.

sw-dev-code commented 5 years ago

Thank you @djboersma. After LFS install everything works fine. I think that your explanation here is more detailed and easier than instructions from readme.md. Maybe you should add command for installing lfs and whole git clone command.

Now I got following error:

PreInit> /control/execute /home/user/Gate/examples/GateContrib/dosimetry/Radiotherapy/example2/mac/main-NPV1.mac
===== XML PATH ====: ./Materials.xml
I/O warning : failed to load external entity "./Materials.xml"
===== XML PATH ====: 0
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_opt3
*** stack smashing detected ***: <unknown> terminated
Aborted (core dumped)

I've found on Gate Git issue where you've mentioned that long path name can be the problem. I've tried with shorter path like: /home/user/example2 but that didn't help.

I don't know how to debug this. Thank you in advance.

djboersma commented 5 years ago

Sorry for the long wait. I am not able to reproduce the error you report. From the GateContrib top directory, I can do

cd dosimetry/Radiotherapy/example2
Gate mac/main-NPV1.mac 
Gate mac/main-NPV2.mac 
Gate mac/main-RV1.mac 
Gate mac/main-RV2.mac

Those commands run and terminate normally, using the GateRTion-1.0 release (equivalent to 8.1). I do not see any errors/warnings about GateMaterials.xml. I think it should run without problems with 8.2 as well.

Which release of Gate are you using? I found that the stack smashing error usually happens with a too long filename for the physics list print command, and fixed that on March 10 (that is unfortunately after the latest release, next release will be in December/January). But if you use the GateContrib example without modification then I think this problem should not occur at all, the file name is short enough: output/physics.txt. Did you change anything to the mac files?

sw-dev-code commented 5 years ago

@djboersma Only thing I've change is the path to the mac files, because I had to configure it according to my file system. As you can see in my post above paths was not that long (/home/user/example2). I don't know how to run this example without modification of paths.

I'm using Gate 8.0.

djboersma commented 5 years ago

I tried to improve the readme.md, hope it is clearer now. :)

I am surprised that you cannot run the examples without changing the paths. Which problems do you run into if you do like I sketched above? It's important to cd into the example directory, because the paths in the mac files are specified relative to that directory.

sw-dev-code commented 5 years ago

@djboersma Thank you for your help. Yes, the readme.md is better now, and example is running ok now.