MCCL Getting Started on Mac - VirtualPhotonics/Vts.MonteCarlo GitHub Wiki

Getting the MCCL application

Download the application from GitHub:

  • Download the latest version from Releases by right clicking on MC_vxxx_Mac_x64.zip file and selecting "Download Linked File" or "Download Linked File As" (replace xxx with the version number). (Do not "double click" to download)
  • Once the zip file has been downloaded, extract or unzip contents. If the unzip files do not contain a folder named "jsonlab", use the command line option to unzip: open a terminal window, "cd" to the directory the zip is in. Unzip contents to a new folder ("MCCL") by using command "unzip MC_vxxx_Mac_x64.zip -d ./MC_vxxx_Mac_x64" (replace xxx with the version number).
  • The downloaded files include:
    • mc - the MCCL executable
    • *.m - MATLAB scripts to enable viewing the results using MATLAB
    • Vts.dll - the VTS library and other libraries necessary to executing MCCL
    • "jasonlab" folder

Running a sample input file on OSX:

  • Download and install dotnet runtime 8.0 - instructions here.
  • Change directory to unzipped folder ("cd MC_vxxx_Mac_x64")
  • The file permissions get reset when zip is made, so to set them for all files type "chmod 644 *"
  • Make the MCCL an executable file "chmod 755 mc"
  • To generate sample infiles type "./mc geninfiles". The sample input files are named infile_*, where * indicates the source, tissue and detector definitions designated within the file. Note that the default source definition is a point source perpendicular to the tissue surface and when the infile has this source definition, it is not part of the name. For example, the infile "infile_one_layer_all_detectors.txt" designates a point source, one layer tissue and all detectors currently available.
  • If you get "mc cannot be opened because the developer cannot be verified" error, open "Security and Privacy" setting of your Mac and allow the application.
  • To run sample infile "./mc infile=infile_one_layer_all_detectors.txt"
  • Output to the screen will be similar to that shown in figure below will be displayed
  • Output will be in folder named by infile "OutputName"
  • To view plots of results using Matlab, see next section

MCCL Execution

Viewing the results using MATLAB or GNU Octave

For linux, Mac and Windows:

  • Requirements: MATLAB R2011b and higher
  • After running a sample infile, a folder will be created in the current directory. For the infile described above, "infile_one_layer_all_detectors.txt", the folder will be named "one_layer_all_detectors"
  • Bring up MATLAB or Octave and edit the script file load_results_script.m. Set "datanames = { ' one_layer_all_detectors' };" (see figure below) and save changes
  • For Octave users, if the infile in the datanames folder is not found make sure that "outdir" is set to the absolute location of that folder (not relative)
  • Execute this script by typing "load_results_script" at the MATLAB or Octave prompt
  • Plots of the all detector results specified in the infile will come to the screen

Load Results Script