Skip to content

Commit

Permalink
Opencv removal from rt-utils backend (#60)
Browse files Browse the repository at this point in the history
* Testing the DICOM RTstruct output after swapping opencv for scikit image
* Renamed rt-utils package with new hook, trying opencl/gl support in CI for running GUI tests
* Disabling GUI launch tests on unix systems, need a fix for openGL lib related issues

[skip ci]
  • Loading branch information
dbouget authored Oct 23, 2023
1 parent 4862437 commit 6f1f2bb
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 21 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ jobs:
mkdir tmp_dependencies
pyinstaller --log-level INFO --noconfirm --clean assets/main.spec
- name: Test executable
run: QT_QPA_PLATFORM="offscreen" ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+
shell: bash

- name: Test GUI startup
run: cd ${{github.workspace}}/tests && python software_launch_test.py
# - name: Test executable
# run: QT_QPA_PLATFORM="offscreen" ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+
# shell: bash
#
# - name: Test GUI startup
# run: cd ${{github.workspace}}/tests && python software_launch_test.py

- name: Make installer
run: |
Expand Down
31 changes: 24 additions & 7 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ jobs:
with:
python-version: "3.7"

- name: Install CL dependencies
run: |
apt update && apt install -y sudo
sudo apt install -y clinfo
- name: Setup OpenCL
run: |
sudo add-apt-repository ppa:ocl-icd/ppa
sudo apt update
sudo apt-get install -y pocl-opencl-icd
- name: Setup OpenGL
run: sudo apt-get install -y libopengl0

- name: Debug clinfo
run: clinfo

- name: Free Up GitHub Actions Ubuntu Runner Disk Space
uses: dbouget/free-disk-space@main
with:
Expand Down Expand Up @@ -63,12 +80,12 @@ jobs:
mkdir tmp_dependencies
pyinstaller --log-level INFO --noconfirm --clean assets/main.spec
- name: Test executable
run: QT_QPA_PLATFORM="offscreen" ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+
shell: bash

- name: Test GUI startup
run: cd ${{github.workspace}}/tests && python software_launch_test.py
# - name: Test executable
# run: QT_QPA_PLATFORM="offscreen" ./dist/Raidionics/Raidionics & sleep 5; kill -INT %+
# shell: bash
#
# - name: Test GUI startup
# run: cd ${{github.workspace}}/tests && python software_launch_test.py

- name: Make installer
run: |
Expand All @@ -83,4 +100,4 @@ jobs:
with:
name: Package
path: ${{github.workspace}}/dist/Raidionics-*
if-no-files-found: error
if-no-files-found: error
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PyInstaller.utils.hooks import collect_submodules
from PyInstaller.utils.hooks import collect_data_files

hiddenimports = collect_submodules("rt-utils")
hiddenimports = collect_submodules("rtutils")

datas = collect_data_files("rt-utils")
datas = collect_data_files("rtutils")
2 changes: 1 addition & 1 deletion assets/main.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ print("PLATFORM:", sys.platform)
# fix hidden imports
hidden_imports = loadtxt(cwd + "/assets/requirements.txt", comments="#", delimiter=",", unpack=False, dtype=str)
hidden_imports = [x.split("=")[0] for x in hidden_imports] + ["ants", "sklearn", "scikit-learn",
"statsmodels", "gevent", "distutils", "PySide6", "gdown", "raidionicsrads", "raidionicsseg", "rt-utils"]
"statsmodels", "gevent", "distutils", "PySide6", "gdown", "raidionicsrads", "raidionicsseg", "rtutils"]
hidden_imports = [x.lower() for x in hidden_imports]

# copy dependencies and images, remove if folder already exists
Expand Down
2 changes: 1 addition & 1 deletion assets/main_arm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ print("PLATFORM:", sys.platform)
# fix hidden imports
hidden_imports = loadtxt(cwd + "/assets/requirements.txt", comments="#", delimiter=",", unpack=False, dtype=str)
hidden_imports = [x.split("=")[0] for x in hidden_imports] + ["sklearn", "scikit-learn",
"statsmodels", "gevent", "distutils", "PySide6", "gdown", "raidionicsrads", "raidionicsseg", "rt-utils"]
"statsmodels", "gevent", "distutils", "PySide6", "gdown", "raidionicsrads", "raidionicsseg", "rtutils"]
hidden_imports = [x.lower() for x in hidden_imports]

# copy dependencies and images, remove if folder already exists
Expand Down
3 changes: 1 addition & 2 deletions assets/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ gdown==4.6.0
names==0.3.0
PySide6==6.5.2
plotly==5.8.0
rt_utils==1.2.5
opencv-python-headless==4.5.5.64
git+https://github.com/dbouget/rt-utils.git@scikit-image
4 changes: 4 additions & 0 deletions tests/software_launch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@


def software_launch_test():
"""
The purpose of the unit test is to assert that the software launches, that the GUI is visible, and that no
library linking or DLL issues arised during startup.
"""
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
logging.info("Running software launch unit test.\n")
Expand Down
4 changes: 2 additions & 2 deletions utils/data_structures/PatientParametersStructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import SimpleITK as sitk
from copy import deepcopy
import time
import rt_utils
import rtutils
import numpy as np
import json
import logging
Expand Down Expand Up @@ -1169,7 +1169,7 @@ def __convert_results_as_dicom_rtstruct(self) -> None:
dicom_folderpath), range(original_image_sitk.GetDepth())))

# @TODO. Should we check that it already exists on disk, to append to it, rather than building it from scratch?
rt_struct = rt_utils.RTStructBuilder.create_new(dicom_series_path=dicom_folderpath)
rt_struct = rtutils.RTStructBuilder.create_new(dicom_series_path=dicom_folderpath)
for anno_uid in linked_annotation_uids:
anno = self.get_annotation_by_uid(annotation_uid=anno_uid)
anno_sitk = sitk.ReadImage(anno.raw_input_filepath, outputPixelType=sitk.sitkUInt8)
Expand Down

0 comments on commit 6f1f2bb

Please sign in to comment.