Skip to content
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

XRMC: new device radionuclide #22

Merged
merged 4 commits into from
Jul 1, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ SUBDIRS = src doc examples nsis

EXTRA_DIST = test libxrmc.pc.in xrmc.spec.in
#DISTCHECK_CONFIGURE_FLAGS = --disable-openmp --disable-xmi-msim
DISTCHECK_CONFIGURE_FLAGS = CXX=g++-mp-4.8 CC=gcc-mp-4.8
DISTCHECK_CONFIGURE_FLAGS = CXX=g++-mp-4.7 CC=gcc-mp-4.7
8 changes: 5 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([xrmc],[6.4.5],[golosio@uniss.it])
AC_INIT([xrmc],[6.5.0],[golosio@uniss.it])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([src/main/xrmc_main.cpp])
AC_CONFIG_AUX_DIR([build-aux])
Expand Down Expand Up @@ -72,14 +72,14 @@ PKG_PROG_PKG_CONFIG


#search for xraylib and other modules
PKG_CHECK_MODULES([xraylib],libxrl >= 3.0.0)
PKG_CHECK_MODULES([xraylib],libxrl >= 3.1.0)


#determine if the xmi-msim should be built
AC_ARG_ENABLE([xmi-msim], AS_HELP_STRING([--disable-xmi-msim],[build without XMI-MSIM support]), [enable_xmi_msim=$enableval], [enable_xmi_msim=check])

if test x$enable_xmi_msim != "xno" ; then
PKG_CHECK_MODULES(xmi_msim, libxmimsim >= 3.1, [XMIMSIM_FOUND=yes], [XMIMSIM_FOUND=no])
PKG_CHECK_MODULES(xmi_msim, libxmimsim > 3.1, [XMIMSIM_FOUND=yes], [XMIMSIM_FOUND=no])
PKG_CHECK_MODULES(gmodule, gmodule-2.0, [GMODULE_FOUND=yes],[GMODULE_FOUND=no])

if test "x$XMIMSIM_FOUND" = xyes && test "x$GMODULE_FOUND" = xyes ; then
Expand Down Expand Up @@ -116,6 +116,7 @@ AC_CONFIG_FILES([ Makefile
src/randmt/Makefile
src/fft/Makefile
src/xmi-msim/Makefile
src/radionuclide/Makefile
doc/Makefile
examples/Makefile
examples/cylind_shell/Makefile
Expand All @@ -130,6 +131,7 @@ AC_CONFIG_FILES([ Makefile
examples/anisotropicsource/Makefile
examples/beamsource/Makefile
examples/phasecontrast/Makefile
examples/radionuclide/Makefile
libxrmc.pc
xrmc.spec
nsis/Makefile
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
xrmc_docdir = $(datadir)/doc/xrmc

dist_xrmc_doc_DATA = xrmc_6.4.4_man.pdf
dist_xrmc_doc_DATA = xrmc_6.4.5_man.pdf
Binary file added doc/xrmc_6.4.5_man.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ SUBDIRS = cylind_shell \
xmi-msim2 \
anisotropicsource \
beamsource \
phasecontrast
phasecontrast \
radionuclide
24 changes: 24 additions & 0 deletions examples/radionuclide/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
xrmc_exampledir = $(datadir)/examples/xrmc/radionuclide

dist_xrmc_example_DATA = composition.dat detector.dat geom3d.dat input.dat quadric.dat sample.dat source.dat radionuclide.dat

if ENABLE_XMIMSIM
check_SCRIPTS = xrmc.sh
TESTS_ENVIRONMENT = XRMC_XMIMSIM_MODULE="${top_builddir}/src/xmi-msim/.libs"
TESTS = $(check_SCRIPTS)
endif

xrmc.sh:
if !ABS_SRC_BUILD_EQUAL
cp ${srcdir}/*dat .
endif
echo "${top_builddir}/src/main/xrmc input.dat" > xrmc.sh
chmod a+x xrmc.sh

clean-local:
rm -f xrmc.sh
rm -f output.dat
rm -f unconvoluted.dat
if !ABS_SRC_BUILD_EQUAL
rm -f $(dist_xrmc_example_DATA)
endif
30 changes: 30 additions & 0 deletions examples/radionuclide/composition.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
; Composition file
;
Newdevice composition ; Device type
Composition ; Device name

Phase Air ; Air
NElem 3 ; Number of atomic species for this phase
7 76.000000 ; Atomic number, weight percent of 1st element
8 23.000000 ; ....
18 1.000000
Rho 0.0012048 ; mass density of the phase (g/cm3)

Phase Sample ; Multilayer
NElem 3 ; Number of atomic species for this phase
26 70.0 ; Atomic number, weight percent of 1st element
24 18.0 ; ....
28 12.0
Rho 6.0 ; mass density of the phase (g/cm3)

Phase Crystal ;
NElem 1
14 100.0
Rho 2.33

Phase Window
NElem 1
4 100.0
Rho 1.85

End
38 changes: 38 additions & 0 deletions examples/radionuclide/detector.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
; Detector array parameter file
;
Newdevice detectorconvolute ; Device type
Detector ; Device name
SourceName Sample ; Source input device name
NPixels 1 1 ; Pixel number (NX x NY)
PixelSize 0.79788452 0.79788452 ; Pixel Size (cm) 0.5 cm2 active detector area
Shape 1 ; Pixel shape (0 rectangular, 1 elliptical)
;dOmegaLim 1e-2 ; Cut on dOmega (default = 2*PI)
X -2 0 0 ; detector center coordinates x, y, z
; Detector orientation :
uk 1 0 0 ; z direction (normal to the screen)
ui 0 -1 0 ; x direction
ExpTime 1 ; Exposure time (sec)
PhotonNum 2000 ; Multiplicity of simulated events per pixel
RandomPixelFlag 1 ; Enable random point on pixels (0/1)
PoissonFlag 0 ; Enable poisson statistic on pix. counts (0/1)
RoundFlag 0 ; Round pixel counts to integer (0/1)
HeaderFlag 1 ; Use header in output file (0/1)
PixelType 2 ; Pixel content type:
; 0: fluence, 1: energy fluence,
; 2: fluence(E), 3: energy fluence(E)
Emin 0 ; Emin
Emax 40 ; Emax
NBins 2000 ; Nbins
SaturateEmin 0 ; Saturate energies lower than Emin (0/1)
SaturateEmax 0 ; Saturate energies greater than Emax (0/1)
;Rotate 0 0 0 1 0 0 -20 ; rotation around axis x, u, angle theta
;Rotate 0 0 0 0 0 1 -30 ; rotation around axis x, u, angle theta

;XMI-MSIM extras
CompositionName Composition
CrystalPhase Crystal
WindowPhase Window
CrystalThickness 0.035
;PulseWidth 2E-09

End
22 changes: 22 additions & 0 deletions examples/radionuclide/geom3d.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
; 3D object geometric description file
;
Newdevice geom3d ; Device type
Geom3D ; Device name
QArrName QuadricArray ; Quadric array input device name
CompName Composition ; Composition input device name


; 1st parallelepiped
Object Par1
Polymethyl\ Methacralate\ (Lucite,\ Perspex) Air ; Phase in, phase out
6 ; Number of quadrics
P1 P2 P3 P4 P5 P6 ; Quadric names

; 2nd parallelepiped
Object Par2
Air Vacuum ; Phase in, phase out
6 ; Number of quadrics
P7 P8 P9 P10 P11 P12 ; Quadric names


End
25 changes: 25 additions & 0 deletions examples/radionuclide/input.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
; X-ray Monte Carlo (xrmc) input file
; Files used by the simulation
;

Load source.dat ; Source position, orientation

Load radionuclide.dat ; Energy Spectrum file

Load sample.dat ; Sample file

Load quadric.dat ; quadric file

Load geom3d.dat ; qvolume file

Load composition.dat ; composition file

Load detector.dat ; Detector position, orientation, size

Run Detector ; Run device

Save Detector Image unconvoluted.dat ; save unconvoluted image

Save Detector ConvolutedImage output.dat ; save convoluted image

End
43 changes: 43 additions & 0 deletions examples/radionuclide/quadric.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
; Quadric array file
;
Newdevice quadricarray ; Device type
QuadricArray ; Device name

Plane P1
0 0 0 -1 -1 0

Plane P2
2 2 0 1 1 0

Plane P3
2 -2 0 1 -1 0

Plane P4
-2 2 0 -1 1 0

Plane P5
0 0 2 0 0 1

Plane P6
0 0 -2 0 0 -1

Plane P7
-5 -5 0 -1 -1 0

Plane P8
5 5 0 1 1 0

Plane P9
5 -5 0 1 -1 0

Plane P10
-5 5 0 -1 1 0

Plane P11
0 0 5 0 0 1

Plane P12
0 0 -5 0 0 -1


End
13 changes: 13 additions & 0 deletions examples/radionuclide/radionuclide.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; Radionuclide file
;
Newdevice radionuclide
Radionuclide
LoopFlag 0 ; 0: extract random energies on the whole spectrum
; 1: loop on all lines and sampling points
LinePhotonNum 1 ; Multiplicity of events for each line in the spectrum
Unit mCi
Activity 100
RadioNuclideSource 55Fe


End
9 changes: 9 additions & 0 deletions examples/radionuclide/run.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
a=xrmc_read_angio_image2('output.dat')
help,a
;b=read_spe('stainlesssteel_4.spe')
my_plot = plot(dindgen(2000)/50.0, total(a.data[1:4, * , 0 , 0],1) > 1,'r',/ylog)
;my_plot = plot(dindgen(2000)/40.0, b.data > 1,'b',/ylog,/overplot)



END
3 changes: 3 additions & 0 deletions examples/radionuclide/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
xrmc input.dat
#xmimsim --enable-pile-up -v --spe-file=stainlesssteel stainlesssteel.xmsi
xmimsim -v --spe-file=stainlesssteel stainlesssteel.xmsi
18 changes: 18 additions & 0 deletions examples/radionuclide/sample.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; Sample parameters file
;
;
Newdevice sample ; Device type
Sample ; Device name
SourceName Source ; Source input device name
Geom3DName Geom3D ; Geom3d input device name
CompName Composition ; Composition input device name
WeightedStepLength 0 ; Weighted step length (0/1)
FluorFlag 1 ; Activate Fluorescence (0/1)
ScattOrderNum 4 ; Maximum scattering order
0 ; Multiplicity of simulated events for order 0
500 ; Multiplicity of simulated events for order 1
500 ; Multiplicity of simulated events for order 2
500 ; Multiplicity of simulated events for order 3
500

End
13 changes: 13 additions & 0 deletions examples/radionuclide/source.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; Source position/orientation file
;
Newdevice source ; Device type
Source ; Device name
SpectrumName Radionuclide ; Spectrum input device name
X 0 -100 0 ; source x, y, z
; Source orientation :
uk 0 1 0 ; z direction (main source direction)
ui -1 0 0 ; x direction
Divergence 2.5e-6 2.5e-6 ; beam divergency (sigma x, y)
Size 0 0 0

End
4 changes: 2 additions & 2 deletions nsis/xrmc-win32.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
!define XRAYLIB_VERSION "3.0.0"
!define XRAYLIB_VERSION_MIN "3.0.0"

!define XMI_MSIM_VERSION "3.1"
!define XMI_MSIM_VERSION_MIN "3.1"
!define XMI_MSIM_VERSION "4.0"
!define XMI_MSIM_VERSION_MIN "4.0"



Expand Down
4 changes: 2 additions & 2 deletions nsis/xrmc-win64.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
!define XRAYLIB_VERSION "3.0.0"
!define XRAYLIB_VERSION_MIN "3.0.0"

!define XMI_MSIM_VERSION "3.1"
!define XMI_MSIM_VERSION_MIN "3.1"
!define XMI_MSIM_VERSION "4.0"
!define XMI_MSIM_VERSION_MIN "4.0"



Expand Down
6 changes: 4 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ SUBDIRS = \
xrmc_math \
beamsource \
phasecontrast \
fft
fft \
radionuclide

SUBLIBS = \
arrayNd/libarrayNd.la \
Expand All @@ -33,7 +34,8 @@ SUBLIBS = \
xrmc_math/libxrmcmath.la \
beamsource/libbeamsource.la \
phasecontrast/libphcdetector.la \
fft/libfft.la
fft/libfft.la \
radionuclide/libradionuclide.la
lib_LTLIBRARIES = libxrmc.la
libxrmc_la_SOURCES =
libxrmc_la_LIBADD = $(SUBLIBS) @xraylib_LIBS@ -lm
Expand Down
2 changes: 1 addition & 1 deletion src/device/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ xrmcinclude_HEADERS = xrmc_device.h
noinst_LTLIBRARIES = libdevice.la

libdevice_la_SOURCES = device.cpp loadnewdevice.cpp xrmc_device.h
libdevice_la_CPPFLAGS = -I${srcdir}/../main -I${srcdir}/../xrmc_math -I${srcdir}/../exception -I${srcdir}/../gettoken -I${srcdir}/../sample -I${srcdir}/../composition -I${srcdir}/../geom3d -I${srcdir}/../detector -I${srcdir}/../spectrum -I${srcdir}/../source -I${srcdir}/../randmt -I${srcdir}/../photon -I${srcdir}/../arrayNd -I${srcdir}/../beamsource -I${srcdir}/../phasecontrast
libdevice_la_CPPFLAGS = -I${srcdir}/../main -I${srcdir}/../xrmc_math -I${srcdir}/../exception -I${srcdir}/../gettoken -I${srcdir}/../sample -I${srcdir}/../composition -I${srcdir}/../geom3d -I${srcdir}/../detector -I${srcdir}/../spectrum -I${srcdir}/../source -I${srcdir}/../randmt -I${srcdir}/../photon -I${srcdir}/../arrayNd -I${srcdir}/../beamsource -I${srcdir}/../phasecontrast -I${srcdir}/../radionuclide
if ENABLE_XMIMSIM
libdevice_la_CPPFLAGS += -I${srcdir}/../xmi-msim @xmi_msim_CFLAGS@ @gmodule_CFLAGS@ -DXRMC_XMIMSIM_LIB=\"$(libdir)/xrmc\"
endif
Expand Down
4 changes: 4 additions & 0 deletions src/device/loadnewdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "xrmc_geom3d.h"
#include "xrmc_sample.h"
#include "xrmc_detector.h"
#include "xrmc_radionuclide.h"
#include "beamsource.h"
#include "beamscreen.h"
#include "anisotropicsource.h"
Expand Down Expand Up @@ -110,6 +111,9 @@ int xrmc_device::LoadNewDevice(istream &dev_fs, xrmc_device*& dev_pt)
throw xrmc_exception(string("Device type ") + dev_type + " not supported.\nRecompile XRMC with the XMI-MSIM plug-in\n");
#endif
}
else if (dev_type=="radionuclide") {
dev_pt = new radionuclide(dev_name);
}
else // unknown device type
throw xrmc_exception(string("Device type ") + dev_type + " not known.\n");

Expand Down
8 changes: 8 additions & 0 deletions src/radionuclide/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
xrmcincludedir = ${includedir}/xrmc
xrmcinclude_HEADERS = xrmc_radionuclide.h

noinst_LTLIBRARIES = libradionuclide.la

libradionuclide_la_SOURCES = loadradionuclide.cpp radionuclide.cpp xrmc_radionuclide.h
libradionuclide_la_CPPFLAGS = -I${srcdir}/../xrmc_math -I${srcdir}/../xrmc_algo -I${srcdir}/../arrayNd -I${srcdir}/../device -I${srcdir}/../source -I${srcdir}/../photon -I${srcdir}/../spectrum -I${srcdir}/../exception -I${srcdir}/../main -I${srcdir}/../gettoken @xraylib_CFLAGS@ -I${srcdir}/../sample -I${srcdir}/../composition -I${srcdir}/../geom3d -I${srcdir}/../randmt -I${srcdir}/../phasecontrast

Loading