Skip to content
Open
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
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,26 @@ jobs:
uses: actions/checkout@v6
- uses: ./.github/workflows/actions_tests

test_wheel_castor:
runs-on: ubuntu-24.04
needs: [build_opengate_wheel, build_opengate_core_wheel_pr]
strategy:
fail-fast: false
steps:
- name: Checkout github repo
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: dist/
- name: Run tests
shell: bash {0}
run: |
mv dist/opengate_core-*-cp312-cp312-manylinux*_x86_64.whl $GITHUB_WORKSPACE/.github/workflows/
mv dist/opengate-*.whl $GITHUB_WORKSPACE/.github/workflows/
docker run --rm -v $GITHUB_WORKSPACE:/home tbaudier/opengate_castor_ci /home/opengate/tests/src/external/castor/run_test_opengate_castor.sh

publish_test:
runs-on: ubuntu-24.04
if: ${{ (always()) && (github.ref == 'refs/heads/master') }}
Expand Down
2 changes: 2 additions & 0 deletions opengate/bin/opengate_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def get_files_to_run():
"test094a_spect_simu_prim", # to compute the reference data
"test094b_spect_simu_scatter", # to compute the reference data
"test094c_build_sinogram", # to compute the reference data
"test096_pet_castor_ref.py", # test for castor compatibility
"test096_pet_castor_coinc.py", # test for castor compatibility
]
path_tests_src = Path(path_tests_src)
all_file_paths = []
Expand Down
Empty file.
44 changes: 44 additions & 0 deletions opengate/tests/src/external/castor/Dockerfile_opengate_castor
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#Docker for opengate_core
#systemctl start docker
#login: docker login
#build: docker build -t tbaudier/opengate_castor_ci -f Dockerfile_opengate_castor.
#push: docker push tbaudier/opengate_castor_ci
#run: docker run --rm -v $(Pipeline.Workspace):/home tbaudier/opengate_castor_ci /home/.github/workflows/run_test_opengate_castor.sh
#interactive: docker run -ti --rm -v $PWD:/home quay.io/pypa/manylinux_2_34_x86_64 /bin/bash

FROM quay.io/pypa/manylinux_2_34_x86_64
MAINTAINER Thomas Baudier <thomas.baudier@creatis.insa-lyon.fr>
#Install packages
RUN yum install -y gcc wget git expat-devel fftw-devel qt6-qtbase-devel freeglut-devel libXmu-devel xerces-c-devel libXpm-devel libXft-devel xrootd-devel openssl-devel libuuid-devel \

#Create folder
&& mkdir -p /software/cmake /software/root/src /software/root/bin /software/castor/src /software/castor/bin /software/wheelhouse \

#Install cmake
&& cd /software/cmake \
&& wget https://github.com/Kitware/CMake/releases/download/v3.31.8/cmake-3.31.8-linux-x86_64.tar.gz \
&& tar xzvf cmake-3.31.8-linux-x86_64.tar.gz \
&& rm -rf cmake-3.31.8-linux-x86_64.tar.gz \
&& mv cmake-3.31.8-linux-x86_64 cmake \
&& export PATH=/software/cmake/cmake/bin/:${PATH} \

#Compile root
&& cd /software/root \
&& git clone --branch v6-36-06 https://github.com/root-project/root.git --depth 1 src \
&& cd bin \
&& . /opt/rh/gcc-toolset-14/enable \
&& cmake -Dxrootd=OFF ../src \
&& make -j10 \
&& source /software/root/bin/bin/thisroot.sh \

#Compile castor
&& cd /software/castor \
&& git clone -b feature/gatev10_converter https://gitlab.com/castor-collaboration/castor.git --depth 1 src \
&& cd bin \
&& cmake -DCMAKE_CXX_FLAGS=-std=c++17 -DCASToR_BUILD_GATE_UTILITIES=ON ../src \
&& make -j10 \
&& export PATH=/software/castor/bin/:$PATH

# docker commit <container_name>
# docker tag <image_id> tbaudier/opengate_castor_ci:1.0.0

Empty file.
19 changes: 19 additions & 0 deletions opengate/tests/src/external/castor/run_test_opengate_castor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/bash

#Instal opengate wheels
cd /home/.github/workflows
/opt/python/cp312-cp312/bin/pip install opengate_core-*.whl
/opt/python/cp312-cp312/bin/pip install opengate-*.whl
cd /opt/_internal/cpython-3.12.12/lib/python3.12/site-packages/opengate/tests/src/external/castor
/opt/python/cp312-cp312/bin/python test096_pet_castor.py
/opt/python/cp312-cp312/bin/python test096_pet_castor_ref.py
/opt/python/cp312-cp312/bin/python test096_pet_castor_coinc.py
cd /opt/_internal/cpython-3.12.12/lib/python3.12/site-packages/opengate/tests/output/test096_pet_castor_interface

#Convert Gate root output to Castor
export PATH=/software/castor/bin/:$PATH
castor-GATERootToCastor -vb 2 -i coincidences.root -o test_gatev10 -js castor_config.json -s "PET_GATEv10_TEST" -t -geo

#Reonstruction with castor
castor-recon -vb 2 -df test_gatev10_df.Cdh -fout reco_test_gatev10 -oit -1 -it 10:1 -dim 128,128,40 -vox 3,3,3 -th 0 -fov-out 98. -slice-out 2

Empty file.
Loading