jerichooconnell / fastcat

GNU General Public License v3.0
30 stars 13 forks source link

Question on use of different geometries #16

Closed justingm closed 2 years ago

justingm commented 2 years ago

Hello!

I am wondering whether I can use FastCAT to generate CTs for a much smaller volume: let's say on a scale of a mouse. I saw in the paper that you use the Catphan phantom and the scatter data was only generated for that. Obviously, that can't be used but I assume that scatter-free CBCTs can still be generated.

jerichooconnell commented 2 years ago

Yes in the return_projections method specify scat_on=False to give no scatter. And the geometry can be changed in the phantom.geomet object. If you print phantom.geomet it will tell you what your current geometry looks like.

You would have to make your own mouse phantom with integer values corresponding to materials.

justingm commented 2 years ago

Hi. Sorry for the late response. I was away at a conference. I'll give it a try. Thanks!

justingm commented 2 years ago

Hi. If the material that I want to assign is not in the database, I am assuming that I have to add it. I saw that you used the physdata package to get the attenuation coefficients but if the material does not exist in the NIST database, can this still be used?

justingm commented 2 years ago

Sorry. Another question. I read the paper and for the CsI detector, it was written that you simulated a 450 um thick scintillator. However, when I look at the code, you have different versions and I am assuming that the numbers correspond to the thickness of the scintillator. Is that correct?

justingm commented 2 years ago

Nevermind my previous questions. I figured it out. Just a follow up on the scatter kernels. I don't exactly understand how you generated them. Can you explain a bit more on what do the scatter curves contain? Thanks!

justingm commented 2 years ago

Hi. This is the one I wanted some clarification about. I already did some MC simulations to calculate the scatter similar to the paper but I am not quite sure what the scatter kernels should contain. Should I provide a percentage or scatter-to-primary ratio? I looked at the scatter files that you had but they looked like counts to me but that would mean that I would also need the primary so that the scaling would be correct.

jerichooconnell commented 2 years ago

Oh lord is my code not user friendly! I usually don't modify the primary signal. There is slightly different r squared distortion across the flat panel but I don't think it effects much. I usually just calculate a scatter file, I did one recently for a different set of energies which is in the time features so watch out

jerichooconnell commented 2 years ago

Looks like 2e8 initial photons Catphan_scatter_in_phasespace.txt

jerichooconnell commented 2 years ago

And now that I think about it I should probably be modifying the primary due to the different geometry

justingm commented 2 years ago

That's exactly what I was gonna say and I was trying to find where I could change the primary file but I am not sure where and if I can do that.

justingm commented 2 years ago

Another question about the scatter. In the paper, it is written that you averaged the scattered particles in the z-direction. How exactly did you do that? Because for me, what would be intuitive to do is just integrate them in that direction. Or am I misunderstanding something here?

jerichooconnell commented 2 years ago

Oh lord it looks like I hardcoded the primary as 660 counts with an analytical approximation of the curvature in simulate.py so this bug probably means that I should modify the code to take both a scatter and a primary file, which I did do at one point.

jerichooconnell commented 2 years ago

These things like hardcoding counts and averaging over the z direction were ways of reducing the noise in the signal as I wanted fastcat to have the capability of generating completely noise free simulations that included scatter. Since this is sometimes fun to look at

jerichooconnell commented 2 years ago

You could load a npy file that has your primary counts for the same beam as your scatter into the variable flood_photon_counts in simulate.py

jerichooconnell commented 2 years ago

Since it is only counts it should be the same for all energies

justingm commented 2 years ago

I see. So the flood_photon_counts is then just the primary distribution after the water phantom. Now, I am a little bit confused because in the following lines

https://github.com/jerichooconnell/fastcat/blob/03d32e6aa9fcdff30bb405eae1c18f84bbcaebd3/fastcat/simulate.py#L677-L706

you calculate the intensity after an attenuating material but then shouldn't you use the un-attenuated beam instead of flood_photon_counts? The modification of the primary due to the attenuating material in its path would already come from the np.exp(-0.97*attenuation/10) part.

justingm commented 2 years ago

Nevermind my previous post. I figured it out.