Skip to content
2 changes: 1 addition & 1 deletion .github/workflows/conda_build_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
channels: conda-forge, ccpi
conda-remove-defaults: "true"

- run: conda install conda-build conda-verify
- run: conda install conda-build

- name: conda build
run: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_build_test_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
- name: Run docker container with tests
shell: bash -l {0}
run: |
docker run --rm --entrypoint /bin/bash -v /home/runner/work/CILViewer/CILViewer:/root/source_code cil-viewer -c "source ./mambaforge/etc/profile.d/conda.sh && conda activate cilviewer_webapp && conda install cil-data pytest pyside2 eqt>=1.0.0 -c ccpi && python -m pytest /root/source_code/Wrappers/Python/test -k 'not test_version and not test_cli_resample and not test_CILViewerBase and not test_CILViewer3D and not test_viewer_main_windows and not test_ui_dialogs and not test_3dtoolbar'"
docker run --rm --entrypoint /bin/bash -v /home/runner/work/CILViewer/CILViewer:/root/source_code cil-viewer -c "source ./mambaforge/etc/profile.d/conda.sh && conda activate cilviewer_webapp && conda install cil-data pytest pyside6 eqt>=2.0.0 -c ccpi && python -m pytest /root/source_code/Wrappers/Python/test -k 'not test_version and not test_cli_resample and not test_CILViewerBase and not test_CILViewer3D and not test_viewer_main_windows and not test_ui_dialogs and not test_3dtoolbar'"
# TODO: publish to come later
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Changelog

## v25.1.0
## v26.0.0
New Functionality:
- Added toolbar to control the slice and volume render in QCILViewerWidget (#458)
- added methods to access the state of the viewer3D (#479)

- added buttons to close preview dialog on macos
Enhancements:
- Update recipe to require eqt Version 2.0.0 #458
- Add a toolbar and settings menus to the 3D viewer #458
Expand All @@ -13,6 +13,12 @@ Enhancements:
Dependencies:
- removed python pinning (#482)
- removed importlib_metadata, required for python <3.8 (#482)
- optional dependency on matplotlib >= 3.9
Bugfixes:
- removes hang on macos with Qt6 (PySide6)
- bugfix for matplotlib >= 3.9
- bugfix unittests for numpy > 2.2
- removed conda-verify package in GHA
CI:
- Created new action for conda build and publish - no longer uses conda-package-publish-action (#486)

Expand Down
5 changes: 5 additions & 0 deletions Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import vtk
from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
from qtpy.QtCore import Qt, QEvent
import platform


class QCILRenderWindowInteractor(QVTKRenderWindowInteractor):
Expand All @@ -22,6 +23,10 @@ def __init__(self, parent=None, **kw):
self.__wheelDelta = self._QVTKRenderWindowInteractor__wheelDelta
#print ("__saveModifiers should be defined", self.__saveModifiers)

# WA_PaintOnScreen makes the first paintEvent hang with Qt6 on macOS
if platform.system() == 'Darwin' and hasattr(Qt.WidgetAttribute, 'WA_PaintOnScreen'):
self.setAttribute(Qt.WidgetAttribute.WA_PaintOnScreen, False)

def _GetAlt(self, ev):
'''Get ALT key modifier'''
ctrl = shift = alt = False
Expand Down
6 changes: 6 additions & 0 deletions Wrappers/Python/ccpi/viewer/ui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def preview(self):

diag = QtWidgets.QDialog(parent=self)
diag.setModal(True)

if dimensionality == 3:
if pars['is_fortran'] is True:
slicing = 'image'
Expand All @@ -273,6 +274,10 @@ def preview(self):
diag.setWindowTitle(f'Preview Image')
diag.setWindowFlag(QtCore.Qt.WindowContextHelpButtonHint, False)
diag.setWindowFlag(QtCore.Qt.WindowMaximizeButtonHint)
diag.setWindowFlag(QtCore.Qt.WindowCloseButtonHint, True)

buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok)
buttonBox.button(QtWidgets.QDialogButtonBox.Ok).clicked.connect(diag.close)
# add a layout
verticalLayout = QtWidgets.QVBoxLayout(diag)
verticalLayout.setContentsMargins(10, 10, 10, 10)
Expand All @@ -283,6 +288,7 @@ def preview(self):

# add it to the layout of the dialog
verticalLayout.addWidget(sc)
verticalLayout.addWidget(buttonBox)
# add the layout to the dialog
diag.setLayout(verticalLayout)

Expand Down
4 changes: 2 additions & 2 deletions Wrappers/Python/ccpi/viewer/utils/colormaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,11 @@ def get_color_map(cmap):
if not cmap in _color_map_dict.keys():

try:
from matplotlib import cm
import matplotlib

colors = []
for x in range(0, 255):
color = cm.get_cmap(cmap)(x)
color = matplotlib.colormaps[cmap](x)
colors.append([color[0], color[1], color[2]])
except ImportError:
print("To use colormaps other than: ",
Expand Down
2 changes: 1 addition & 1 deletion Wrappers/Python/conda-recipe/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- python
- numpy
- vtk
- pyside2
- pyside6
- eqt>=2.0.0
- importlib_metadata # [py<38]
- h5py
Expand Down
2 changes: 1 addition & 1 deletion Wrappers/Python/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test:
- ccpi::cil-data=22.0.0
- pillow
- pytest
- pyside2
- pyside6
- eqt>=2.0.0
source_files:
- ./Wrappers/Python/test
Expand Down
2 changes: 1 addition & 1 deletion Wrappers/Python/test/test_cropped_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def setUp(self):
bits = 8
self.input_3D_array = np.random.randint(10, size=shape, dtype=eval(f"np.uint{bits}"))
self.input_3D_array = np.reshape(np.arange(self.input_3D_array.size),
newshape=shape).astype(dtype=eval(f"np.uint{bits}"))
shape).astype(dtype=eval(f"np.uint{bits}"))
self.raw_type_code = str(self.input_3D_array.dtype)
bytes_3D_array = bytes(self.input_3D_array)
self.raw_filename_3D = 'test_3D_data.raw'
Expand Down
2 changes: 1 addition & 1 deletion Wrappers/Python/test/test_resample_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setUp(self):
self.size_greater_than_input_size = 10000
self.input_3D_array = np.random.randint(10, size=shape, dtype=eval(f"np.uint{bits}"))
self.input_3D_array = np.reshape(np.arange(self.input_3D_array.size),
newshape=shape).astype(dtype=eval(f"np.uint{bits}"))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is because of change of parameter name in numpy >2.2

shape).astype(dtype=eval(f"np.uint{bits}"))
bytes_3D_array = bytes(self.input_3D_array)
self.raw_filename_3D = 'test_3D_data.raw'
with open(self.raw_filename_3D, 'wb') as f:
Expand Down
6 changes: 4 additions & 2 deletions docker/web-app/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ name: cilviewer_webapp
channels:
- conda-forge
dependencies:
- python==3.9
- python==3.13
- matplotlib # Optional for more colormaps
- h5py
- pip
- schema
- pyyaml
- vtk
- pip:
# Have to install Trame via pip due to unavailability on conda
- trame <3, >=2.1.1 # Unpinned worked with version 2.1.1, should work with higher versions.
- vtk==9.1
- --extra-index-url https://wheels.vtk.org
- vtk
Loading