Open purepani opened 1 week ago
Hi purepani,
The combination of multiple materials with different fractions can be defined as one material. Then, you need to hack Phantom_NCAT.py --> set_material, and add that user-defined material. Last, in the XCAT phantom definition, you set the material index.
Maybe we can add a cfg parameter to allow the user to add new materials.
Would it be possible to have the projector take into account the material fractions so that new materials wouldn't need to be added and the phantom definition wouldn't need to be edited?
Would it be possible to have the projector take into account the material fractions so that new materials wouldn't need to be added and the phantom definition wouldn't need to be edited?
It requires updating the projector C source code, which is a bit larger effort than changing the python phantom code.
I wouldn't mind doing that, especially if this is something you want upstream as well
That would be great! The C code is nCAT_main.c. You'll need to change how it reads the XCAT data file, and how it initializes the Mu table for the objects.
I found an "output old ct format" in the xcat parameter files which creates a file format that the program is expecting. How would you want to manage these 2 formats? Automatically detect which format it is? or just have 2 separate functions for each version? or something else?
It looks like there is a new xcat nrb format that the current version of gecatsim is unable to parse. From what I can tell, now xcat can simulate one surface being multiple different materials with different fractions whereas the current parsing only lets you parse 1 material per surface(assuming im reading the code correctly). Relevant parsing code: https://github.com/xcist/main/blob/74309d1b216eff0073d9602c9ce6c1ac7ebd1a2c/gecatsim/clib_build/src/nCAT_main.c#L3332-L3338
Relevant data from nrb files generated from xcat.
I didn't want to try to incorporate this into the model since I'm not fully familiar with how to do so, and it would probably require a new projector as well(which I'm not certain the best way to implement it), so i figured an issue is best here.