This project has moved and is read-only. For the latest updates, please go here.

Not able to run MC command lines

Aug 6, 2015 at 8:59 PM

I tried to run MC command lines on windows7, xp, and 10. However, every time I double clicked the "MC.exe", it opened and shut down automatically in less one second. What is the problem? Thank you.
Aug 6, 2015 at 9:14 PM

You need to run the executable in a command line window. On the folder that houses the code (say "MCCL"), hold down the shift key, right click the MCCL folder and select Open command window here. In the command line window type "mc infile=infile_one_layer_all_detectors". This uses the infile "infile_one_layer_all_detectors.txt" that comes with the download. To understand the different options within the infile look at this page:
under the section "Documentation for Monte Carlo Command Line (MCCL) Application". The link "Editing Monte Carlo Command Line infiles" refers to our prior .xml type infiles. The current .txt files are ascii files and can be edited with any text editor. Just make sure that the curly brackets open "{" and close "}" pair up.

Please let me know if you have any other questions.
Aug 6, 2015 at 9:24 PM
Hi Carole,

Thank you. By the way, is there some instruction about how to run MCCL on mac using mono? I am new here. Thank you for your patience.

A. Wang
Aug 6, 2015 at 9:42 PM

I have a macbook pro with mountain lion OS. I downloaded mono from Then brought up a Terminal window. At the prompt type "mono mc.exe infile=infile_one_layer_all_detectors.txt". You should see a line that identifies what infile you are running and then a header and then a listing of what percentage complete the run has completed.

When the simulation is complete (this infile specifies only N=100 photons to be launched), you should have a subfolder in this directory named "one_layer_all_detectors". To plot the results in this folder, bring up matlab, edit the file load_results_script.m line
"datanames = { 'one_layer_all_detectors' };"
to point to this subfolder. Then run load_results_script.m and you should see plots of the various detectors in this file. This is a sample infile that specifies most all detectors we have defined currently in the MC. Depending on what detectors you'd like results for, you can start with this infile and cut out those detectors that are not of interest to you.

Let me know if you have other problems or questions.
Aug 6, 2015 at 10:13 PM
Thank you so much Carole. It works, cool! Then I will spend some time editing the infile that I need. Thank you again.

A. Wang
Aug 7, 2015 at 4:02 PM
Hi Carole,

I met some problems when I tried to edit the infile. I can understand most of the parameters listed in the infile file. However, several terms remain unclear to me. For example, the "Count" in "ZRange": {
      "Start": 0.0,
      "Stop": 100.0,
      "Count": 2
the "Musp" in "RegionOP": {
      "Mua": 0.05,
      "Mus": 5.0,
      "G": 0.9,
      "N": 1.35,
      "Musp": 1.0
For DetectorInputs, my understanding for "count" is the number of datapoint between the "Start" and the "Stop", is that right?

One more thing is the unit of the calculation. Is it "mm", "mm-1" or "cm", "cm-1"?

So, I am thinking is there an instruction on editing the infile? I have read the documentation, which is helpful but only provides very general definition of the terms.

Thank you and best regards!
Aug 7, 2015 at 5:10 PM

Count-1 defines how many bins span Start to Stop. So in the example you give above, there is 1 bin (Count-1) spanning [0-100]mm. The units are mm and mm-1. This post ( describes the units of the other parameters of interest.

Thank you for your questions. I will work on updating the documentation to better describe these items.