Problem 2475

Summary: Phantom data files are incorrectly read in from file
Product: Examples/Advanced Reporter: David Platten <david.platten>
Component: generalAssignee: Susanna Guatelli <susanna>
Status: RESOLVED FIXED    
Severity: normal CC: cirrone, susanna
Priority: P4    
Version: 11.0   
Hardware: All   
OS: All   
Attachments: Else statement commented out to ensure (ix == 0 && iy == 0) OrgID read in

Description David Platten 2022-03-15 12:41:41 CET
Created attachment 753 [details]
Else statement commented out to ensure (ix == 0 && iy == 0) OrgID read in

This report is for the ICRP110_HumanPhantoms advanced example.


This report affects Geant4 version 10.7 and 11.0.


The ICRP110PhantomConstruction::ReadPhantomDataFile method in the ICRP110PhantomConstruction.cc file contains an error which means that the phantom voxel data is read incorrectly.


In relation to the Geant4 version 10.7 code:


Lines 464 to 470 of the existing code check to see if (ix == 0 && iy == 0). If this is true then the first three lines of the data file are skipped as these first three values are not organ IDs. This is correct.


Lines 471 to 768 are surrounded by an "else" statement - they are only executed if (ix == 0 && iy == 0) is false. This is an error, because it means that the organ data is not read in when (ix == 0 && iy == 0).


As the code stands this bug causes the organ data to be read incorrectly such that the data is shifted one voxel to the right in the y-direction, and the data that should be at the max y index is erroneously positioned at y=0.


Lines 472 to 767 should be executed no matter what - the "else" statement must be removed, as has been done in the attached file.
Comment 1 David Platten 2022-03-16 09:48:49 CET
I raised this with the authors of the example directly (mjl970@uowmail.edu.au, susanna@uow.edu.au, malaroda@uow.edu.au, john.allison@g4ai.org) and have received confirmation that it is a bug that they will fix.
Comment 2 Susanna Guatelli 2022-06-02 09:13:27 CEST
Dear David, 

thank you for the feedback, I am fixing the problem.
Cheers
Susanna
Comment 3 Susanna Guatelli 2022-09-30 11:02:06 CEST
Comment on attachment 753 [details]
Else statement commented out to ensure (ix == 0 && iy == 0) OrgID read in

The solution proposed by David Platten has been implemented and the error has been solved in the reading of the tissue material of the first voxel of the phantom
Comment 4 Susanna Guatelli 2022-09-30 11:02:56 CEST
The problem has been solved in Geant4 11.01 release