-
Notifications
You must be signed in to change notification settings - Fork 24
[forward] add pmcxcl and user-defined input #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
converting to draft for now. will do some test on CPU and GPU backend before removing the draft state. |
Hi @fangq, thank your for the patch. It is very much appreciated. Regarding the normalization: we followed here the implementation in AtlasViewer, which applied this normalizatoin although We use ruff for code formatting. It gets its configuration from the pyproject.toml. |
interesting, thanks for the link to the AtlasViewer code - looks like @dboas made the commit. when
this multiplicative scaling factor converts the raw energy-deposition in each voxel (unitless or J) to fluence as a result of a unitary source - so that the output unit is (1/mm^2) , which matches that of fluence. when you set @dboas, let's redo the conversion between mcx and tMCimg and figure out the right scalar - I was under the impression that it should not need any additional scaling factor if tMCimg solutions are normalized to produce the "Green's function" as mcx does. because the initial version of mcx also uses the tMCimg's way to deposit energy (in 2010ish, it has shifted to depositing energy-loss instead of current weight), if tMCimg's raw output were normalized according to the Eq 1 in the mcx paper, then, it should produce the Green's function of fluence-rate, and match that of the |
@avolu and @emiddell, I took a look at the pmcx integration and did some tweaking, summarized below
compute_fluence_mcx()
so that users can overwrite the default cfg settings at runtime, for examplecompute_fluence_mcx(nphoton=1e3, gpuid=2, tend=10e-9, tstep=10e-9, cuda=True)
nphoton
to the positional parameters**kwargs
I tried to test this on my laptop, but it only has an intel gpu, pmcxcl seems to run but I need more test back home.
I am wondering if you use any formatter for the code styles, such as black or blue? I am happy to reformat my patch.