A script used to convert CT(nii) files to MCNP input files. Your must supply a tmol file which must contain mode
card and material
card. examole.toml
is a template file.
numpy, SimpleITK, toml
python main.py -c path/to/your/toml/file -d directory/to/save/inp
- ct
path to your CT(nii) file(s). - Mode
It is used for MCNPmode
card. It is a string array. - Material
It is used to convert CT images to voxels. You should type[material.id]
for each material.id
is the group and is used to generateMn
in MCNP. In each group,hu_interval
indicates the CT value interval.density
is the tissue density in this interval.nucleon
andfraction
is components and regarded fractions of this material.nucleon
is a series of integers: Z * 1000 + A.fraction
is a series of floating-point numbers. Their meanings is same as MCNP. - Source(Optinal)
It is used to generateSDEF
card. Usekeyword = [a series of values]
. If you want to useSI
andSP
, please use a dict shows inexample.toml
. - Tally(Optinal)
It is used to generatefmesh4
card. Only this tally card is supported by this script.particle
indicates the type of particle recorded. AndFM
,DE
,DF
can also be added. - Output Control(Optinal)
It is used to generatenps
,prdmp
and other card.