Skip to content

Commit

Permalink
Merge pull request #79 from OpenHeartDevelopers/feature/mitk-upgrade
Browse files Browse the repository at this point in the history
MITK upgrade to v2022.10
  • Loading branch information
JostMigenda authored Jun 10, 2024
2 parents 9947f26 + b0ac04d commit 75afd96
Show file tree
Hide file tree
Showing 44 changed files with 426 additions and 390 deletions.
224 changes: 100 additions & 124 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
Create-Release:
runs-on: ubuntu-latest
# needs: [Variables, Build-Linux, Build-Windows, Build-macOS]
needs: [Variables, Build-Linux, Build-macOS]
needs: [Variables, Build-Linux, Build-Windows, Build-macOS]
steps:
- name: Download packages
uses: actions/download-artifact@v4
Expand All @@ -39,15 +38,15 @@ jobs:
asset_name: CemrgApp-Linux-${{ needs.Variables.outputs.tag }}.zip
asset_content_type: application/zip

# - name: Upload Windows package
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: CemrgApp-Windows.zip
# asset_name: CemrgApp-Windows-${{ needs.Variables.outputs.tag }}.zip
# asset_content_type: application/zip
- name: Upload Windows package
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: CemrgApp-Windows.zip
asset_name: CemrgApp-Windows-${{ needs.Variables.outputs.tag }}.zip
asset_content_type: application/zip

- name: Upload macOS package
uses: actions/[email protected]
Expand All @@ -66,7 +65,7 @@ jobs:
steps:
- name: Download precompiled Build folder
run: |
wget -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EU8n4C0PlPxDgLk6PFrprY8B4KwiDaYotmur5m0q3px81w?download=1
wget -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/ETN8L5OcVupGiMInP8o9MtUBNflJb57nK1Dg-jnikW0iwg?download=1
7z x Build.zip
rm Build.zip
sudo mv Build /
Expand All @@ -81,7 +80,7 @@ jobs:
- name: Install missing packages
run: |
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt install libxt-dev libtiff5-dev libfontconfig1 mesa-common-dev libglu1-mesa-dev libxcomposite1 libxcursor1 libxrender1 libxi6 libxtst6 libasound2 libnspr4 libnss3 libxkbcommon-dev libxkbcommon-x11-dev doxygen git cmake python3-pip gcc g++ -y
sudo DEBIAN_FRONTEND=noninteractive apt install doxygen graphviz libfreetype6-dev libglu1-mesa-dev libssl-dev libtiff5-dev libwrap0-dev libxcomposite1 libxcursor1 libxi-dev libxkbcommon-x11-0 libxt-dev mesa-common-dev -y
sudo apt remove --auto-remove icu-devtools libicu-dev -y
- name: Install Qt
Expand All @@ -91,9 +90,9 @@ jobs:
sudo aqt install --outputdir /Qt 5.12.10 linux desktop -m qtcharts qtnetworkauth qtpurchasing qtdatavis3d qtscript qtvirtualkeyboard qtwebengine qtwebglplugin
- name: Clone MITK
run: sudo git clone --branch v2018.04.2 https://phabricator.mitk.org/source/mitk.git /MITK
run: sudo git clone --branch v2022.10 https://phabricator.mitk.org/source/mitk.git /MITK

- name: Change timestamps of MITK directory
- name: Change timestamps of the MITK directory
run: sudo find /MITK/ -exec touch -a -m -d 20210401 {} \;

- name: Clone CemrgApp
Expand All @@ -120,7 +119,7 @@ jobs:
run: |
make package -j4
cd _CPack_Packages/Linux/TGZ
mv MITK-v2018.04.2-linux-x86_64 CemrgApp-Linux
mv MITK-v2022.10-linux-x86_64 CemrgApp-Linux
rm CemrgApp-Linux/Mitk*
rm CemrgApp-Linux/bin/MitkWorkbench*
mv /Externals/* CemrgApp-Linux/bin/
Expand All @@ -135,85 +134,86 @@ jobs:
path: CemrgApp-Linux.zip


# Build-Windows:
# runs-on: windows-2016
# needs: [Variables]
# steps:
# - name: Uninstall NSIS
# run: |
# & 'C:/Program Files (x86)/NSIS/uninst-nsis.exe' /S
#
# - name: Download precompiled Build folder
# working-directory: c:\
# run: |
# c:\msys64\usr\bin\wget.exe -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EUFa_AWPBI1OnnQwXA_ilu8Bq38U6OjiR4XKDcxDKo5wnw?download=1
# 7z x Build.zip
# del Build.zip
#
# - name: Download external libraries
# working-directory: c:\
# run: |
# c:\msys64\usr\bin\wget.exe -q -O Externals.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/Ea8urj-xMS5CoEnt3lS-A9QBLoAi1EXfP3lM26MRn11OrA?download=1
# 7z x Externals.zip
# del Externals.zip
#
# - name: Install Qt
# working-directory: c:\
# run: |
# pip install aqtinstall
# mkdir Qt
# python -m aqt install --outputdir Qt 5.12.10 windows desktop win64_msvc2017_64 -m qtcharts qtnetworkauth qtpurchasing qtdatavis3d qtscript qtvirtualkeyboard qtwebengine qtwebglplugin
#
# - name: Clone MITK
# run: git clone --branch v2018.04.2 https://phabricator.mitk.org/source/mitk.git c:\MITK
#
# - name: Change timestamps of MITK directory
# run: dir -R c:\MITK | foreach { $_.LastWriteTime = [DateTime]::ParseExact('01-04-21', 'dd-MM-yy', $null) }
#
# - name: Clone CemrgApp
# uses: actions/checkout@v4
# with:
# path: CemrgApp
#
# - name: Copy CemrgApp to root
# shell: cmd
# run: |
# mkdir c:\CemrgApp
# xcopy /e .\CemrgApp\* c:\CemrgApp\
# rd /s /q CemrgApp
#
# - name: Update the CemrgApp version
# working-directory: c:\CemrgApp
# shell: powershell
# run: |
# rm CemrgApp/Applications/MainApp/version.txt
# echo ${{ needs.Variables.outputs.tag }} >> CemrgApp/Applications/MainApp/version.txt
# echo ${{ needs.Variables.outputs.sha }} >> CemrgApp/Applications/MainApp/version.txt
#
# - name: Add MSBuild to PATH
# uses: microsoft/[email protected]
#
# - name: Build
# working-directory: c:\Build
# run: MSBuild MITK-superbuild.sln /p:Configuration=Release /p:Platform=x64 -m:4
#
# - name: Package
# working-directory: c:\Build\MITK-build
# run: |
# MSBuild PACKAGE.vcxproj /p:Configuration=Release /p:Platform=x64 -m:4
# cd _CPack_Packages\win64\ZIP
# ren MITK-v2018.04.2-windows-x86_64 CemrgApp-Windows
# xcopy /e c:\Externals\* .\CemrgApp-Windows\bin\
# copy c:\CemrgApp\README.md .\CemrgApp-Windows\
# del CemrgApp-Windows\bin\MitkWorkbench.*
# 7z a CemrgApp-Windows.zip CemrgApp-Windows
# move CemrgApp-Windows.zip ${{ github.workspace }}\
#
# - name: Upload package
# uses: actions/upload-artifact@v4
# with:
# name: Packages-Windows
# path: CemrgApp-Windows.zip
Build-Windows:
runs-on: windows-2016
needs: [Variables]
steps:
- name: Uninstall NSIS
run: |
& 'C:/Program Files (x86)/NSIS/uninst-nsis.exe' /S
- name: Download precompiled Build folder
working-directory: c:\
run: |
c:\msys64\usr\bin\wget.exe -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EXJ2fam5aCNLvRW8kk1o6jwBzsI50I0iuZ1vfq4oOPRbJQ?download=1
7z x Build.zip
del Build.zip
- name: Download external libraries
working-directory: c:\
run: |
c:\msys64\usr\bin\wget.exe -q -O Externals.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/Ea8urj-xMS5CoEnt3lS-A9QBLoAi1EXfP3lM26MRn11OrA?download=1
7z x Externals.zip
del Externals.zip
- name: Install Qt
working-directory: c:\
run: |
pip install aqtinstall
mkdir Qt
python -m aqt install --outputdir Qt 5.12.10 windows desktop win64_msvc2017_64 -m qtcharts qtnetworkauth qtpurchasing qtdatavis3d qtscript qtvirtualkeyboard qtwebengine qtwebglplugin
- name: Clone MITK
run: git clone --branch v2022.10 https://phabricator.mitk.org/source/mitk.git c:\MITK

- name: Change timestamps of the MITK directory
run: dir -R c:\MITK | foreach { $_.LastWriteTime = [DateTime]::ParseExact('01-04-21', 'dd-MM-yy', $null) }

- name: Clone CemrgApp
uses: actions/checkout@v4
with:
path: CemrgApp

- name: Copy CemrgApp to root
shell: cmd
run: |
mkdir c:\CemrgApp
xcopy /e .\CemrgApp\* c:\CemrgApp\
rd /s /q CemrgApp
- name: Update the CemrgApp version
working-directory: c:\CemrgApp
shell: powershell
run: |
rm CemrgApp/Applications/MainApp/version.txt
echo ${{ needs.Variables.outputs.tag }} >> CemrgApp/Applications/MainApp/version.txt
echo ${{ needs.Variables.outputs.sha }} >> CemrgApp/Applications/MainApp/version.txt
- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Build
working-directory: c:\Build
run: MSBuild MITK-superbuild.sln /p:Configuration=Release /p:Platform=x64 -m:4

- name: Package
working-directory: c:\Build\MITK-build
run: |
MSBuild PACKAGE.vcxproj /p:Configuration=Release /p:Platform=x64 -m:4
cd _CPack_Packages\win64\ZIP
ren MITK-v2022.10-windows-x86_64 CemrgApp-Windows
xcopy /e c:\Externals\* .\CemrgApp-Windows\bin\
copy c:\CemrgApp\README.md .\CemrgApp-Windows\
del CemrgApp-Windows\Mitk*
del CemrgApp-Windows\bin\MitkWorkbench.*
7z a CemrgApp-Windows.zip CemrgApp-Windows
move CemrgApp-Windows.zip ${{ github.workspace }}\
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: Packages-Windows
path: CemrgApp-Windows.zip


Build-macOS:
Expand All @@ -223,7 +223,7 @@ jobs:
- name: Download precompiled Build folder
working-directory: /Users/Shared
run: |
wget -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EVzkObB3qiZLpEQsCLB3pdcBjaGDuzLapXFvujnDP_xr1A?download=1
wget -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EX4dERE2ilFNmuv2Od0GaOoBuUSgzBS_TzwEqf9KVtmsXQ?download=1
7z x Build.zip
rm Build.zip
Expand All @@ -234,15 +234,8 @@ jobs:
7z x Externals.zip
rm Externals.zip
- name: Download patch for MITK
working-directory: /Users/Shared
run: |
wget -q -O Patch.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/EQ5LKrqH_fZNt9eGA7RBcC4B9YyyF0SwFeo9hIm9zkqLTQ?download=1
7z x Patch.zip
rm Patch.zip
- name: Install missing packages
run: brew install gmp doxygen llvm@9
run: brew install doxygen libomp

- name: Install Qt
working-directory: /Users/Shared
Expand All @@ -252,15 +245,9 @@ jobs:
python3 -m aqt install --outputdir Qt 5.12.10 mac desktop -m qtcharts qtnetworkauth qtpurchasing qtdatavis3d qtscript qtvirtualkeyboard qtwebengine qtwebglplugin
- name: Clone MITK
run: git clone --branch v2018.04.2 https://phabricator.mitk.org/source/mitk.git /Users/Shared/MITK

- name: Patch MITK
working-directory: /Users/Shared
run: |
cp Patch/usServiceListeners.cpp MITK/Modules/CppMicroServices/core/src/service/usServiceListeners.cpp
cp Patch/usListenerFunctors_p.h MITK/Modules/CppMicroServices/core/src/util/usListenerFunctors_p.h
run: git clone --branch v2022.10 https://phabricator.mitk.org/source/mitk.git /Users/Shared/MITK

- name: Change timestamps of MITK directory
- name: Change timestamps of the MITK directory
run: find /Users/Shared/MITK/ -exec touch -a -m -t 202104010000 {} \;

- name: Clone CemrgApp
Expand All @@ -278,17 +265,6 @@ jobs:
sudo echo ${{ needs.Variables.outputs.tag }} >> CemrgApp/Applications/MainApp/version.txt
sudo echo ${{ needs.Variables.outputs.sha }} >> CemrgApp/Applications/MainApp/version.txt
- name: Set environment variables
run: |
echo "/usr/local/opt/llvm@9/bin:$PATH" >> $GITHUB_PATH
echo "LDFLAGS=-L/usr/local/opt/llvm@9/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I/usr/local/opt/llvm@9/include" >> $GITHUB_ENV
echo "LLVM_VERSION=9.0" >> $GITHUB_ENV
echo "LLVM_DIRECTORY=/usr/local/opt/llvm@9" >> $GITHUB_ENV
echo "CC=/usr/local/opt/llvm@9/bin/clang" >> $GITHUB_ENV
echo "CXX=/usr/local/opt/llvm@9/bin/clang++" >> $GITHUB_ENV
echo "CPLUS_INCLUDE_PATH=/usr/local/opt/llvm@9/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include" >> $GITHUB_ENV
- name: Build
working-directory: /Users/Shared/Build
run: |
Expand All @@ -301,7 +277,7 @@ jobs:
run: make package -j6

- name: Create DMG
working-directory: /Users/Shared/Build/MITK-build/_CPack_Packages/Darwin/DragNDrop/MITK-v2018.04.2-local_changes-macos-x86_64
working-directory: /Users/Shared/Build/MITK-build/_CPack_Packages/Darwin/DragNDrop/MITK-v2022.10-macos-x86_64
run: |
rsync -au MitkWorkbench.app/Contents/Frameworks/ CemrgApp.app/Contents/Frameworks
rsync -au MitkWorkbench.app/Contents/MacOS/ CemrgApp.app/Contents/MacOS
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:
- name: Download precompiled Build folder
run: |
wget -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/Ef5Vu6za325GoIIStbIcmg4BgWlVBGtUx6jp1GrxNLYrFw?download=1
wget -q -O Build.zip https://emckclac-my.sharepoint.com/:u:/g/personal/k2143219_kcl_ac_uk/ES5xxspvCyRGoHISDFTLifkBrcTmxNWCX4bzyUT_AkEnAg?download=1
7z x Build.zip
rm Build.zip
sudo mv Build /
Expand All @@ -19,11 +19,11 @@ jobs:
7z x Externals.zip
rm Externals.zip
sudo mv Externals /
- name: Install missing packages
run: |
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt install libxt-dev libtiff5-dev libfontconfig1 mesa-common-dev libglu1-mesa-dev libxcomposite1 libxcursor1 libxrender1 libxi6 libxtst6 libasound2 libnspr4 libnss3 libxkbcommon-dev libxkbcommon-x11-dev libtbb2 doxygen git cmake python3-pip gcc g++ -y
sudo DEBIAN_FRONTEND=noninteractive apt install doxygen graphviz libfreetype6-dev libglu1-mesa-dev libssl-dev libtiff5-dev libwrap0-dev libxcomposite1 libxcursor1 libxi-dev libxkbcommon-x11-0 libxt-dev mesa-common-dev libtbb2 -y
sudo apt remove --auto-remove icu-devtools libicu-dev -y
- name: Install Qt
Expand All @@ -33,7 +33,7 @@ jobs:
sudo aqt install --outputdir /Qt 5.12.10 linux desktop -m qtcharts qtnetworkauth qtpurchasing qtdatavis3d qtscript qtvirtualkeyboard qtwebengine qtwebglplugin
- name: Clone MITK
run: sudo git clone --branch v2018.04.2 https://phabricator.mitk.org/source/mitk.git /MITK
run: sudo git clone --branch v2022.10 https://phabricator.mitk.org/source/mitk.git /MITK

- name: Disable tests for CppMicroServices
run: sudo sed -i 's/set(US_BUILD_TESTING ON)/set(US_BUILD_TESTING OFF)/' /MITK/Modules/CMakeLists.txt
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
env:
QT_PLUGIN_PATH: /Qt/5.12.10/gcc_64/plugins
QT_QPA_PLATFORM: minimal
run: ctest -R Cemrg -V
run: ctest -R Cemrg -C Debug -V

- name: Code Coverage
uses: codecov/codecov-action@v4
Expand Down
9 changes: 1 addition & 8 deletions CemrgApp/Applications/MainApp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ if(MITK_BUILD_APP_CemrgApp)
project(MainApp)

set(MY_APP_NAME CemrgApp)
set(_app_options)

if(MITK_SHOW_CONSOLE_WINDOW)
list(APPEND _app_options SHOW_CONSOLE)
endif()

# Create a cache entry for the provisioning file which is used to export
# the file name in the MITKConfig.cmake file. This will keep external projects
Expand All @@ -25,7 +20,7 @@ if(MITK_BUILD_APP_CemrgApp)

org.mitk.gui.qt.datamanager
org.mitk.gui.qt.basicimageprocessing
org.mitk.gui.qt.dicom
org.mitk.gui.qt.dicombrowser
#org.mitk.gui.qt.diffusionimaging
#org.mitk.gui.qt.diffusionimaging.registration
org.mitk.gui.qt.pointsetinteraction
Expand Down Expand Up @@ -75,7 +70,6 @@ if(MITK_BUILD_APP_CemrgApp)
#PLUGINS ${_plugins}
EXCLUDE_PLUGINS ${_exclude_plugins}
SOURCES ${_src_files}
${_app_options}
)

mitk_use_modules(TARGET ${MY_APP_NAME}
Expand All @@ -101,5 +95,4 @@ if(MITK_BUILD_APP_CemrgApp)
add_dependencies(${MY_APP_NAME} ${MITK_MODULES_ENABLED_PLUGINS})
endif()


endif()
2 changes: 1 addition & 1 deletion CemrgApp/Applications/MainApp/CemrgApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int main(int argc, char** argv) {
splash.setWindowFlags(Qt::SplashScreen | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
splash.show();
if (!version.isEmpty())
splash.showMessage("CemrgApp " + version + " (" + sha + ")\nPowered by: MITK v2018.04.2", Qt::AlignLeft, Qt::white);
splash.showMessage("CemrgApp " + version + " (" + sha + ")\nPowered by: MITK v2022.10", Qt::AlignLeft, Qt::white);
QTimer::singleShot(4000, &splash, SLOT(close()));

// -------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 75afd96

Please sign in to comment.