DIDSR / VICTRE_MCGPU

Version of MC-GPU used in the VICTRE project
32 stars 18 forks source link

Can I use more than 16 material files? #13

Open AngieNicole-Hernandez opened 2 years ago

AngieNicole-Hernandez commented 2 years ago

Hi, I am trying to generate some images, but I want to use a range of densities for some of the materials, I modified my phantoms a little so that I have more labels so that I can assign, for example, for the adipose tissue I have a label 1, with density=0.917, but I also changed some of the 1 voxel labels for a 3, so that to this adipose tissue I can give density=0.939. So that the [SECTION MATERIAL FILE LIST] in my .in file is something like:

#[SECTION MATERIAL FILE LIST v.2020-03-03]   
material/air__5-120keV.mcgpu.gz                  density=0.0012   voxelId=0         #  1st MATERIAL FILE (.gz accepted)
material/adipose__5-120keV.mcgpu.gz              density=0.917    voxelId=1         #  2nd MATERIAL FILE
material/adipose__5-120keV.mcgpu.gz              density=0.939    voxelId=3         #  3nd MATERIAL FILE
material/skin__5-120keV.mcgpu.gz                 density=1.090    voxelId=2         #  4rd MATERIAL FILE
material/glandular__5-120keV.mcgpu.gz            density=1.013    voxelId=29        #  5rd MATERIAL FILE 
material/skin__5-120keV.mcgpu.gz                 density=1.090    voxelId=33        #  6th MATERIAL FILE
material/connective_Woodard__5-120keV.mcgpu.gz   density=1.120    voxelId=88        #  7th MATERIAL FILE
material/connective_Woodard__5-120keV.mcgpu.gz   density=1.207    voxelId=83        #  8th MATERIAL FILE
material/muscle__5-120keV.mcgpu.gz               density=1.05     voxelId=40        #  9th MATERIAL FILE
material/muscle__5-120keV.mcgpu.gz               density=1.05     voxelId=125       #  10th MATERIAL FILE
material/muscle__5-120keV.mcgpu.gz               density=1.131     voxelId=123       #  11th MATERIAL FILE
material/blood__5-120keV.mcgpu.gz                density=1.00     voxelId=150,225   #  12th MATERIAL FILE
material/muscle__5-120keV.mcgpu.gz               density=1.050    voxelId=95        # 13th MATERIAL FILE
material/muscle__5-120keV.mcgpu.gz               density=1.132    voxelId=93        # 14th MATERIAL FILE
material/polystyrene__5-120keV.mcgpu.gz          density=1.060    voxelId=50        # 15th MATERIAL FILE
material/glandular__5-120keV.mcgpu.gz            density=1.06     voxelId=200       # 16th MATERIAL FILE 
material/CalciumOxalate__5-120keV.mcgpu.gz       density=1.781    voxelId=250       # 17th MATERIAL FILE  
material/W__5-120keV.mcgpu.gz                                     voxelId=65        # 18th MATERIAL FILE
material/Se__5-120keV.mcgpu.gz                                    voxelId=66        # 19th MATERIAL FILE

When I run the MC-GPU program, on the INITIALIZATION phase, only 16 values are read:

Voxel value to Monte Carlo material number conversion table (material number corresponds to order in input file):
        voxelId = 0  -->  Material = 1
        voxelId = 1  -->  Material = 2
        voxelId = 2  -->  Material = 4
        voxelId = 3  -->  Material = 3
        voxelId = 29  -->  Material = 5
        voxelId = 33  -->  Material = 6
        voxelId = 40  -->  Material = 9
        voxelId = 50  -->  Material = 15
        voxelId = 83  -->  Material = 8
        voxelId = 88  -->  Material = 7
        voxelId = 93  -->  Material = 14
        voxelId = 95  -->  Material = 13
        voxelId = 123  -->  Material = 11
        voxelId = 125  -->  Material = 10
        voxelId = 150  -->  Material = 12
        voxelId = 225  -->  Material = 12

So the simulation detects voxel values that do not exist in the previous list and it does not continue. Is it possible to do what I'm trying to do and use more voxel values to assign different densities to the same type of material?

andreubs commented 2 years ago

Hi AngieNicole-Hernandez,

Sorry for the delay answering this issue. The solution is actually quite easy, I think: MCGPU allows only the use of 15 materials, by default. But this number can be easily increased by modifying the parameter MAX_MATERIALS in the header file (MC-GPU_v1.5b.h):

https://github.com/DIDSR/VICTRE_MCGPU/blob/5ffd1db0e21c01137bba0dacd877986b58fa2a13/MC-GPU_v1.5b.h#L57

You can increase MAX_MATERIALS as much as you want, until you run out of GPU memory to store all these material cross-sections.

Let me know if this fixes the problem.

Best regards,

   Andreu Badal
jinglu00 commented 1 year ago

Hi AngieNicole-Hernandez, hi Andreu May I ask how do you generate new material files other than it provided? Have you used _MC-GPU_create_materialdata.f ? Do you know any dependency files like "tables.f" or "penelope.f"? Thanks a lot!