Skip to content

Commit

Permalink
Backport to Qt5
Browse files Browse the repository at this point in the history
(cherry picked from commit 70ee515)
  • Loading branch information
marcelzwiers committed Oct 16, 2023
1 parent d03fd20 commit fe41284
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 101 deletions.
2 changes: 1 addition & 1 deletion bidscoin/bcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def test_bidscoin(bidsmapfile: Union[Path,dict], options: dict=None, testplugins
if testgui:
LOGGER.info('Testing the PyQt GUI setup:')
try:
from PyQt6.QtWidgets import QApplication, QPushButton
from PyQt5.QtWidgets import QApplication, QPushButton
app = QApplication(sys.argv)
window = QPushButton('Minimal GUI test: OK')
window.show()
Expand Down
181 changes: 89 additions & 92 deletions bidscoin/bidseditor.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions bidscoin/bidsmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def bidsmapper(rawfolder: str, bidsfolder: str, bidsmapfile: str, templatefile:

else:
LOGGER.info('Opening the bidseditor')
from PyQt6 import QtCore, QtGui
from PyQt6.QtWidgets import QApplication, QMessageBox
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QApplication, QMessageBox
try:
from bidscoin import bidseditor
except ImportError:
Expand All @@ -165,7 +165,7 @@ def bidsmapper(rawfolder: str, bidsfolder: str, bidsmapfile: str, templatefile:
f"{versionmessage}")
messagebox.setWindowTitle('About the BIDS-mapping workflow')
messagebox.setIconPixmap(QtGui.QPixmap(str(bidseditor.BIDSCOIN_LOGO)).scaled(150, 150, QtCore.Qt.AspectRatioMode.KeepAspectRatio, QtCore.Qt.TransformationMode.SmoothTransformation))
messagebox.setWindowFlags(messagebox.windowFlags() & ~QtCore.Qt.WindowType.WindowMinMaxButtonsHint)
messagebox.setWindowFlags(messagebox.windowFlags() & ~QtCore.Qt.WindowMinMaxButtonsHint)
messagebox.show()

app.exec()
Expand Down
2 changes: 1 addition & 1 deletion bidscoin/heuristics/bidsmap_dccn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Options:
# General options and plugins
# --------------------------------------------------------------------------------
bidscoin:
version: 4.2.0 # BIDScoin version (should correspond with the version in pyproject.toml)
version: 4.2.0+qt5 # BIDScoin version (should correspond with the version in pyproject.toml)
bidsignore: mrs/;extra_data/;sub-*_ct.* # Semicolon-separated list of entries that are added to the .bidsignore file (for more info, see BIDS specifications), e.g. extra_data/;pet/;myfile.txt;yourfile.csv
subprefix: sub- # The subject prefix of the source data
sesprefix: ses- # The session prefix of the source data
Expand Down
2 changes: 1 addition & 1 deletion bidscoin/heuristics/bidsmap_sst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Options:
# General options and plugins
# --------------------------------------------------------------------------------
bidscoin:
version: 4.2.0 # BIDScoin version (should correspond with the version in pyproject.toml)
version: 4.2.0+qt5 # BIDScoin version (should correspond with the version in pyproject.toml)
bidsignore: mrs/;extra_data/ # Semicolon-separated list of entries that are added to the .bidsignore file (for more info, see BIDS specifications), e.g. extra_data/;pet/;myfile.txt;yourfile.csv
subprefix: sub- # The subject prefix of the source data
sesprefix: ses- # The session prefix of the source data
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = 'setuptools.build_meta'
[project]
name = 'bidscoin'
description = 'Converts and organises raw MRI data-sets according to the Brain Imaging Data Structure (BIDS)'
version = '4.2.0'
version = '4.2.0+qt5'
readme = 'README.rst'
requires-python = '>= 3.8'
license = {file = 'LICENSE.txt'}
Expand All @@ -21,7 +21,7 @@ dependencies = ['pandas',
'matplotlib',
'numpy',
'pydicom >= 2',
'PyQt6',
'PyQt5 >= 5.12.1',
'ruamel-yaml >= 0.15.35',
'tomli >= 1.1.0 ; python_version < "3.11"',
'coloredlogs',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/bidsmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Options:
# General options and plugins
# --------------------------------------------------------------------------------
bidscoin:
version: 4.2.0 # BIDScoin version (should correspond with the version in pyproject.toml)
version: 4.2.0+qt5 # BIDScoin version (should correspond with the version in pyproject.toml)
bidsignore: mrs/;extra_data/ # Semicolon-separated list of entries that are added to the .bidsignore file (for more info, see BIDS specifications), e.g. extra_data/;pet/;myfile.txt;yourfile.csv
subprefix: sub- # The subject prefix of the source data
sesprefix: ses- # The session prefix of the source data
Expand Down

0 comments on commit fe41284

Please sign in to comment.