Skip to main content

Simulation for Medical Physics

Project description

This experiment is a work in progress. Even the name (gam-gate) is temporary.

How to install (short version)

First create an environment (not mandatory but highly advised)

conda create --name gam_env python=3.8
conda activate gam_env

Then install the two packages.

pip install gam-g4
pip install gam-gate

If you already installed the packages and want to upgrade to last version:

pip install gam-g4 -U 
pip install gam-gate -U

Once installed, you can run all tests:

gam_gate_tests

All tests are in the folder here but some data (binary files) are stored, for technical reasons, in this git: https://gitlab.in2p3.fr/opengamgate/gam_tests_data


How to install (long version, for developers)

There are three repositories:

The gam-g4 lib is composed of two folders:

  • The folder gam_g4/g4_bindings contains C++ source code that maps some Geant4 classes into a Python module.
  • The folder gam_g4/gam_lib contains additional C++ classes that extends Geant4 functionalities (also mapped to Python).

At the end of the compilation process of gam-g4 a Python module is available, named gam_g4. It is ready to be used from the Python side via the gam-gate python module.

⚠️ This is still work in progress and will probably changes ...

⚠️ Folder and module names are with an underscore (gam_g4) while python package in pip are with a minus sign (gam-g4). Don't ask us why.

1) First, create a Python environment and activate it.

If you use conda:

conda create --name gam_env python=3.8
conda activate gam_env

See: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

If you dont use conda:

python3 -m venv gam_env 
source gam_env/bin/activate

See: https://docs.python.org/3/tutorial/venv.html

2) Install required softwares (Geant4 and ITK)

Install Geant4 , with Multithreading=ON, and QT visualization. QT should work when install in the python environment, for example with conda install qt.

Install ITK.

3) Clone the repository (with submodules!)

git clone --recurse-submodules https://github.com/OpenGATE/gam-g4.git

4) Compile the c++ part

Go in the folder and:

pip install -e .

It will create some files, ready to be compiled, but will fail, it is "normal" (well, it is not really normal, but the current way. Of course it will be improved).

Then, go in the created folder and cmake :

cd build/temp.linux-x86_64-3.6

cmake -DGeant4_DIR=~/src/geant4/build-geant4.10.07 -DPYTHON_EXECUTABLE=~/src/py/miniconda3/envs/gam_env/bin/python -DPYTHON_INCLUDE_DIR=~/src/py/miniconda3/envs/gam_env/include -DPYTHON_LIBRARY=~/src/py/miniconda3/envs/gam/lib/libpython3.so -DITK_DIR=~/src/itk/build-v5.2.0 -DROOT_DIR=~/src/geant4/build-root -DCMAKE_CXX_FLAGS="-Wno-pedantic"  . 

Of course, replace all folders by yours.

Then compile:

make -j 12

5) On linux

Sometimes on Linux machine, you will need to add the following path to find dynamic library :

export LD_PRELOAD=~/src/geant4/build-geant4.10.07/BuildProducts/lib64/libG4processes.so:${LD_PRELOAD}

We dont know yet why this is required and are currently working to improve this.

6) Test

Start python: python and type import gam_g4. The first time, Geant4 data will be downloaded. You can now access some G4 functions in Python.

For example:

import gam_g4
a = gam_g4.G4ThreeVector(0)
print(a)

7) Install the gam-gate python module

Clone the repository:

git clone --recurse-submodules https://github.com/OpenGATE/gam-gate.git

Then install the module:

cd gam-gate
pip install -e .

Several python's modules will be downloaded and installed (numpy, itk, matplotlib, etc)

8) Tests

The tests are available in gam-gate/gam_tests/ but you can run all available tests with:

gam_gate_tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

gam_gate-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (107.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

gam_gate-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl (102.4 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

gam_gate-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (107.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

gam_gate-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl (102.4 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

gam_gate-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (107.3 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

gam_gate-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl (102.3 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

gam_gate-0.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (107.3 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

gam_gate-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl (102.3 MB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

Details for the file gam_gate-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: gam_gate-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 107.3 MB
  • Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for gam_gate-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8288cdd8d7909c06e0a519e65a5a908d7247d26ea829ce9cc1316e3be5745587
MD5 badc7ea56eb3a9998fdc2ffdb904be90
BLAKE2b-256 d9d461d0972ae21b2c993a5c120c899494d17d612abad0896dab258ac608e3d2

See more details on using hashes here.

Provenance

File details

Details for the file gam_gate-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: gam_gate-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 102.4 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for gam_gate-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eb00bd783e07126416a31fc61eea5fb95fa6c79719965b7783d0ad707bb10c55
MD5 962caf87ca116d615802454fbc900c6b
BLAKE2b-256 c5fbdab2eb1db2b23d859d5c81250cdececc8795a31b39ec5b8c6e10da2df42e

See more details on using hashes here.

Provenance

File details

Details for the file gam_gate-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: gam_gate-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 107.3 MB
  • Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for gam_gate-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc6fb677df1b5607e7489791da098949a18ca3d086dd0051a4a51e02db11a37f
MD5 f3291adfd7d4d839d80582b587f91381
BLAKE2b-256 a72867acb1351d94fc6527b88827f12f49174e036d630adbc6eff2d6a853429f

See more details on using hashes here.

Provenance

File details

Details for the file gam_gate-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: gam_gate-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 102.4 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for gam_gate-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7b03541b52eec6fe43c3dfeb7f3336e1e9f4437820a98666265f1f4d33e9b6f7
MD5 5ea58f26ddd4af473cf3a51c688d62cc
BLAKE2b-256 25a0f450639096d2f7121e0b571d8b63a110547d9d98e18d75a1f08f122a3943

See more details on using hashes here.

Provenance

File details

Details for the file gam_gate-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: gam_gate-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 107.3 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for gam_gate-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f7e18fbd71be73247452bd111f10c4f55058edbd83fc5e29e7267a72c0ce6aa
MD5 3891c01b61af04d8412fe043d6d7e67f
BLAKE2b-256 f0a7bd32a357b894c8d2133b4dd38bc04155e5d18baf0424994f6807f76256fa

See more details on using hashes here.

Provenance

File details

Details for the file gam_gate-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: gam_gate-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 102.3 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for gam_gate-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f6e1b115a8fa2ae6ab86cf212bd1cb5aba9c0e58765c676ebbdde886e3ae3ed5
MD5 bc036e0f4bbdbd46328241b20377dfd9
BLAKE2b-256 0fe8025f9409ea18565088a8c522c13a7818ca17330e2bb12a60392ed9e1e55e

See more details on using hashes here.

Provenance

File details

Details for the file gam_gate-0.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: gam_gate-0.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 107.3 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for gam_gate-0.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ab71aba20962982710b4af5e07de31f3608a0c363745ffdd614c56c87206dae
MD5 82723120547d9e4da23433a787d49c0a
BLAKE2b-256 8a3350607c6570bcfbce980eb97f2a0bfd02a40c3cdaaa5cd8a7d05d35282bf9

See more details on using hashes here.

Provenance

File details

Details for the file gam_gate-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: gam_gate-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 102.3 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for gam_gate-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3c238c48602244f51ddd13058dfae10d9bbb583a4dcfa0731c5fa0b3c257cc2c
MD5 8d048b364a2dec4ff5e0da69343f3065
BLAKE2b-256 4fbd8b98226a8bf91efe383feb92eb5dbe29f091a5ee704c92e1c8974f756b6a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page