Home - marselan/simrx2 GitHub Wiki
simrx2 is an HPC (High Performance Computing) X-ray projection simulator based on PENELOPE, a particle simulator developed at the University of Barcelona. It was originally implemented in Fortran, and I extended it with a detector to capture X-ray images, and a C++ module using MPI in order to execute it in a cluster of multicore CPUs.
simrx2 and PENELOPE are both open source and can be used only for research in universities, educational institutions and teaching. They cannot be used for commercial purposes or for generating profits.
Original PENELOPE was created by Francesc Salvat [1], José M. Fernández-Varea [2], E. Acosta [3], Josep Sempau [4] and Xavier LLovet [5].
Developed based on the original version, by Mariano Arselan [3]
[1, 2] Facultat de Fisica (ECM), Universitat de Barcelona, Barcelona, Spain.
[3] Facultad de Matemática, Astronomía y Física. Universidad Nacional de Córdoba. Córdoba, Argentina.
[4] Institut de Tecniques Energetiques, Universitat Politecnica de Catalunya. Barcelona, Spain.
[5] Serveis Científico-Tècnics, Universitat de Barcelona. Barcelona, Spain.
- simrx2 is implemented in Fortran and C++. You'll need to install in you Linux distro the gcc tools, g++, gfortran and MPI compilers.
- clone the repo
- It comes with a Makefile, so fire a 'make' command.
- It will generate a binary called 'simrx2'.
Before you execute the program, you have to build an experiment. You'll need to refer to the PENELOPE manual to learn how to configure the geometry of the sample to be scanned, and setup the materials of the bodies present in this geometry.
Here in this repo, I included a sample geometry file called 'wcsc.geo', which is a simple water cube of size 6 cm, and a small silicon cylinder inside the cube. You'll find the materials definitions in files Water.pmf and Si.pmf.
If you are executing this program in you own laptop or desktop, simply run:
mpiexec -np N simrx2
where N is the number of MPI processes, typically matches the number of cores you've got in your machine.
In case you are planning to execute simrx2 in a cluster of multicore processors, contact the cluster sysadmin to learn how to setup the environment and run the simulator using MPI. For example, I run the simulator in a cluster from the CCAD, the HPC data center at the University of Córdoba, Argentina, which uses slurm as a job scheduler.
Output: You'll get RAW image files, named image1, image2, ... , imageK, where K is the number of projections, as specified in the file parameters.xml. Each pixel in the image is an uint16 (unsigned integer, 16 bits), capable to represent 65536 levels of gray, although you can specify a different level resolution in the parameters file. The images are stored in column order, so if you open them using Fortran, Octave or Matlab, you'll have to transpose the images.
Conversion to PNG: Run the raw2png.sh script in order to convert the RAW images to PNG files to see the results quickly. You'll need to have Octave installed in your system. The png images are saved in the results/png folder.
-
To Nicolás Wolovick and Carlos Bederián, from the CCAD, the HPC Data Center of University of Córdoba, Argentina.
-
To Francisco Malano and Mauro Valente, from the LIIFAMIRX Lab, the Medical Physics Laboratory, University of Córdoba, Argentina.