diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 597731dd..f5c605c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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/upload-release-asset@v1.0.2 - # 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/upload-release-asset@v1.0.2 + 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/upload-release-asset@v1.0.2 @@ -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 / @@ -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 @@ -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 @@ -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/ @@ -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/setup-msbuild@v1.0.2 - # - # - 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/setup-msbuild@v1.0.2 + + - 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: @@ -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 @@ -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 @@ -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 @@ -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: | @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc5d5be9..b3368efe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 / @@ -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 @@ -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 @@ -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 diff --git a/CemrgApp/Applications/MainApp/CMakeLists.txt b/CemrgApp/Applications/MainApp/CMakeLists.txt index 5b7e2f12..001018ed 100644 --- a/CemrgApp/Applications/MainApp/CMakeLists.txt +++ b/CemrgApp/Applications/MainApp/CMakeLists.txt @@ -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 @@ -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 @@ -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} @@ -101,5 +95,4 @@ if(MITK_BUILD_APP_CemrgApp) add_dependencies(${MY_APP_NAME} ${MITK_MODULES_ENABLED_PLUGINS}) endif() - endif() diff --git a/CemrgApp/Applications/MainApp/CemrgApp.cpp b/CemrgApp/Applications/MainApp/CemrgApp.cpp index 6e97e0ab..9361e728 100644 --- a/CemrgApp/Applications/MainApp/CemrgApp.cpp +++ b/CemrgApp/Applications/MainApp/CemrgApp.cpp @@ -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())); // ------------------------------------------------------------------- diff --git a/CemrgApp/Applications/MainApp/target_libraries.cmake b/CemrgApp/Applications/MainApp/target_libraries.cmake index 924c05fa..fc50e6a2 100644 --- a/CemrgApp/Applications/MainApp/target_libraries.cmake +++ b/CemrgApp/Applications/MainApp/target_libraries.cmake @@ -7,7 +7,7 @@ set(target_libraries 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 diff --git a/CemrgApp/Applications/MainApp/version.txt b/CemrgApp/Applications/MainApp/version.txt index b83ac2c3..6ef21d68 100644 --- a/CemrgApp/Applications/MainApp/version.txt +++ b/CemrgApp/Applications/MainApp/version.txt @@ -1,2 +1,2 @@ -2.2 -69e5e1e +3.0-alpha +7a0240c diff --git a/CemrgApp/CMakeExternals/VMTK.cmake b/CemrgApp/CMakeExternals/VMTK.cmake index 1e607f76..3ff73671 100644 --- a/CemrgApp/CMakeExternals/VMTK.cmake +++ b/CemrgApp/CMakeExternals/VMTK.cmake @@ -34,8 +34,8 @@ if(MITK_USE_VMTK) ) endif() - set(VMTK_GIT_REPOSITORY "https://github.com/vmtk/vmtk.git" CACHE STRING "The git repository for cloning VMTK") - set(VMTK_GIT_TAG "v1.4.0" CACHE STRING "The git tag/hash to be used when cloning from VMTK_GIT_REPOSITORY") + set(VMTK_GIT_REPOSITORY "https://github.com/OpenHeartDevelopers/vmtk.git" CACHE STRING "The git repository for cloning VMTK") + set(VMTK_GIT_TAG "098885746923a181909f4756979968925934e6ad" CACHE STRING "The git tag/hash to be used when cloning from VMTK_GIT_REPOSITORY") mark_as_advanced(VMTK_GIT_REPOSITORY VMTK_GIT_TAG) if (UNIX) diff --git a/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgFixShellApp.cpp b/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgFixShellApp.cpp index e147d4d6..b619b6ee 100644 --- a/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgFixShellApp.cpp +++ b/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgFixShellApp.cpp @@ -239,7 +239,7 @@ int main(int argc, char* argv[]) { int method; double value, thres, percentage; double data1[5]; - ifstream prodFileRead; + std::ifstream prodFileRead; QString fileRead = prodPath + "prodThresholds.txt"; prodFileRead.open(fileRead.toStdString()); @@ -262,7 +262,7 @@ int main(int argc, char* argv[]) { prodFileRead.close(); - ofstream prodFile1; + std::ofstream prodFile1; prodFile1.open((prodPath + prothresfile).toStdString()); prodFile1 << value << std::endl; prodFile1 << method << std::endl; diff --git a/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgIM2INR.cpp b/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgIM2INR.cpp index 00374a19..850c175c 100644 --- a/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgIM2INR.cpp +++ b/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgIM2INR.cpp @@ -199,7 +199,7 @@ int main(int argc, char* argv[]) { MITK_INFO(verbose) << "Write to binary file"; std::string path = outputPath.toStdString(); - ofstream myFile(path, ios::out | ios::binary); + std::ofstream myFile(path, ios::out | ios::binary); myFile.write((char*)header, 256 * sizeof(char)); myFile.write((char*)pv, dimensions * sizeof(uint8_t)); myFile.close(); diff --git a/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgMorphAnalysis.cpp b/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgMorphAnalysis.cpp index 7efe28be..c3ccd568 100644 --- a/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgMorphAnalysis.cpp +++ b/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgMorphAnalysis.cpp @@ -192,7 +192,7 @@ int main(int argc, char* argv[]) { double sphereLA = morphAnal->GetSphericity(surfLA->GetVtkPolyData()); //Store in text file - ofstream morphResult; + std::ofstream morphResult; QString morphPath = QString::fromStdString(directory) + "/morphResults_AB.txt"; morphResult.open(morphPath.toStdString(), std::ios_base::app); morphResult << "SA" << " " << surfceLA << "\n"; diff --git a/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgProjectionOptions.cpp b/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgProjectionOptions.cpp index 1e029004..b79a7182 100644 --- a/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgProjectionOptions.cpp +++ b/CemrgApp/Modules/CemrgAppModule/cmdapps/CemrgProjectionOptions.cpp @@ -92,12 +92,18 @@ int main(int argc, char* argv[]) { "input-lge", "i", mitkCommandLineParser::String, "LGE path", "Full path of LGE.nii file.", us::Any(), false); + parser.addArgument( // optional + "output-subfolder", "o", mitkCommandLineParser::File, + "Output subfolder name", "Name of output subfolder (Default=OUTPUT)"); parser.addArgument( // optional "thresholds-method", "m", mitkCommandLineParser::Int, "Thresholds method", "Choose between IIR*V (1) and M + STDV*V (2). (Default=2)"); parser.addArgument( // optional "single-voxel-projection", "svp", mitkCommandLineParser::Bool, "Single Voxel Projection", "Project LGE voxels onto Scar Map ONLY ONCE (Default=OFF)"); + parser.addArgument( // optional + "threshold-values", "tv", mitkCommandLineParser::String, + "Threshold(s)", "Specific threshold (-t 1.2):\n Multithresholds (-t 0.97,1.2,1.32)\n Sweeps (-t 0.7:0.01:1.61)"); parser.addArgument( // optional "multi-thresholds", "t", mitkCommandLineParser::Bool, "Multiple thresholds", "Produce the output for the scar score using multiple thresholds:\n\t (mean+V*stdev) V = 1:0.1:5\n\t (V*IIR) V = 0.7:0.01:1.61"); @@ -124,16 +130,26 @@ int main(int argc, char* argv[]) { // Default values for optional arguments // std::string prodthresfile = "prodThresholds.txt"; - auto thresmethod = 2; + auto method = 2; + std::string output_subfolder = "OUTPUT"; auto singlevoxelprojection = false; auto multithreshold = false; + std::string inThresholdString = (method == 2) ? "3.3" : "1.2"; auto verbose = false; // Parse, cast and set optional argument MITK_INFO << "Parsing optional arguments"; + if (parsedArgs.end() != parsedArgs.find("output-subfolder")) { + output_subfolder = us::any_cast(parsedArgs["output-subfolder"]); + } + if (parsedArgs.end() != parsedArgs.find("thresholds-method")) { - thresmethod = us::any_cast(parsedArgs["thresholds-method"]); + method = us::any_cast(parsedArgs["thresholds-method"]); + } + + if (parsedArgs.end() != parsedArgs.find("threshold-values")) { + inThresholdString = us::any_cast(parsedArgs["threshold-values"]); } if (parsedArgs.end() != parsedArgs.find("multi-thresholds")) { @@ -156,7 +172,6 @@ int main(int argc, char* argv[]) { // Code the functionality of the cmd app here. MITK_INFO(verbose) << "Verbose mode ON."; - int method = thresmethod; QString methodPref = (method == 2) ? "MplusSD_" : "IIR_"; MITK_INFO(method == 1) << "IIR METHOD"; MITK_INFO(method == 2) << "M + SD METHOD"; @@ -174,7 +189,7 @@ int main(int argc, char* argv[]) { QFileInfo fi(lgename); QString direct = fi.absolutePath(); QString lgePath = fi.absoluteFilePath(); - QString outputFolder = direct + "/" + fi.baseName() + "_OUTPUT" + "/"; + QString outputFolder = direct + "/" + QString::fromStdString(output_subfolder) + "/"; QDir d(outputFolder); @@ -256,33 +271,61 @@ int main(int argc, char* argv[]) { QString prothresfile = fi2.baseName() + "_prodStats.txt"; MITK_INFO(verbose) << "Writing to pordStats file" + prothresfile.toStdString(); - ofstream prodFile1; + std::ofstream prodFile1; prodFile1.open((outputFolder + prothresfile).toStdString()); prodFile1 << methodPref.toStdString() << std::endl; prodFile1 << mean << std::endl; prodFile1 << stdv << std::endl; - if (multithreshold) { - MITK_INFO << "Scores for multiple thresholds."; - prodFile1 << "MULTIPLE SCORES:" << std::endl; - double startVal, endVal, increment; + QString thres_str = QString::fromStdString(inThresholdString); + if (multithreshold && (thres_str.length()==3 && thres_str.contains('.'))) { + thres_str = (method == 2) ? "1.0:0.1:5.0" : "0.7:0.01:1.61"; + } - startVal = (method == 2) ? 1.0 : 0.7; - endVal = (method == 2) ? 5.0 : 1.61; - increment = (method == 2) ? 0.1 : 0.01; + bool is_sweep_threshold = false; + std::vector input_threshold_vector, threshold_vector; + QStringList thres_list = QStringList(); + if (thres_str.contains(',')){ + thres_list = thres_str.split(','); + } else if(thres_str.contains(':')){ + thres_list = thres_str.split(':'); + is_sweep_threshold = true; + } else{ + thres_list << thres_str; + } - double thisVal = startVal; - while (thisVal <= endVal) { - double thisthres = (method == 2) ? mean + thisVal * stdv : mean * thisVal; - double thispercentage = scar->Thresholding(thisthres); - prodFile1 << "V=" << thisVal << ", SCORE=" << thispercentage << std::endl; + int ix = 0; + bool ok_to_double = true; + while (ixThresholding(this_thres); + prodFile1 << "V=" << this_value << ", SCORE=" << this_percentage << std::endl; + } + + prodFile1.close(); MITK_INFO(verbose) << "Goodbye!"; } catch (const std::exception &e) { diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgAtriaClipper.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgAtriaClipper.cpp index 47445744..06323399 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgAtriaClipper.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgAtriaClipper.cpp @@ -91,17 +91,17 @@ bool CemrgAtriaClipper::ComputeCtrLines(std::vector pickedSeedLabels, vtkSm MITK_INFO << "Producibility test. "; QString prodPath = directory + "/"; mitk::IOUtil::Save(surface, (prodPath + "prodLineSurface.vtk").toStdString()); - ofstream prodFile1; + std::ofstream prodFile1; prodFile1.open((prodPath + "prodSeedLabels.txt").toStdString()); for (unsigned int i = 0; i < pickedSeedLabels.size(); i++) prodFile1 << pickedSeedLabels.at(i) << "\n"; prodFile1.close(); - ofstream prodFile2; + std::ofstream prodFile2; prodFile2.open((prodPath + "prodSeedIds.txt").toStdString()); for (unsigned int i = 0; i < pickedSeedIds->GetNumberOfIds(); i++) prodFile2 << pickedSeedIds->GetId(i) << "\n"; prodFile2.close(); - ofstream prodFile3; + std::ofstream prodFile3; prodFile3.open((prodPath + "prodLineFlip.txt").toStdString()); prodFile3 << autoLines << "\n"; prodFile3.close(); @@ -324,7 +324,7 @@ void CemrgAtriaClipper::ClipVeinsImage(std::vector pickedSeedLabels, mitk:: vtkSmartPointer diams = vtkDoubleArray::SafeDownCast(line->GetPointData()->GetArray("CenterlineSectionMinSizeArrayName")); double diam = diams->GetValue(position); - ofstream morphResult; + std::ofstream morphResult; QString morphPath = directory + "/morphResults.txt"; morphResult.open(morphPath.toStdString(), std::ios_base::app); if (i == 0) @@ -372,7 +372,7 @@ void CemrgAtriaClipper::ClipVeinsImage(std::vector pickedSeedLabels, mitk:: mitk::Surface::Pointer prodSurf = mitk::Surface::New(); prodSurf->SetVtkPolyData(circle); mitk::IOUtil::Save(prodSurf, (prodPath + "prodCutter" + QString::number(i) + ".vtk").toStdString()); - ofstream prodFile1; + std::ofstream prodFile1; prodFile1.open((prodPath + "prodCutter" + QString::number(i) + "TNormals.txt").toStdString()); prodFile1 << centreLinePolyPlanes.at(i)->GetNormal()[0] << "\n"; prodFile1 << centreLinePolyPlanes.at(i)->GetNormal()[1] << "\n"; diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgAtrialTools.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgAtrialTools.cpp index e344ec45..87be091e 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgAtrialTools.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgAtrialTools.cpp @@ -872,7 +872,9 @@ void CemrgAtrialTools::FixSingleLabelConnectivityInSurface(mitk::Surface::Pointe vtkSmartPointer CemrgAtrialTools::GetLabelConnectivity(mitk::Surface::Pointer externalSurface, double label, bool colourRegions){ // threshold at label vtkSmartPointer thres = vtkSmartPointer::New(); - thres->ThresholdBetween(label, label); + thres->SetThresholdFunction(vtkThreshold::THRESHOLD_BETWEEN); + thres->SetLowerThreshold(label); + thres->SetUpperThreshold(label); thres->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, vtkDataSetAttributes::SCALARS); thres->SetInputData(externalSurface->GetVtkPolyData()); thres->Update(); diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp index e7b8efd5..48d57408 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp @@ -61,7 +61,7 @@ CemrgCommandLine::CemrgCommandLine() { //Setup dialog layout = new QVBoxLayout(); - dial = new QDialog(0,0); + dial = new QDialog(0, Qt::WindowFlags()); dial->setFixedSize(640, 480); dial->setLayout(layout); dial->layout()->addWidget(panel); @@ -1356,8 +1356,8 @@ std::string CemrgCommandLine::PrintFullCommand(QString command, QStringList argu if (_debugvar) { QString prodPath = QString::fromStdString(mitk::IOUtil::GetProgramPath()); MITK_INFO << ("Program path: " + prodPath).toStdString(); - ofstream prodFile1; - prodFile1.open((prodPath + "dockerDebug.txt").toStdString(), ofstream::out | ofstream::app); + std::ofstream prodFile1; + prodFile1.open((prodPath + "dockerDebug.txt").toStdString(), std::ofstream::out | std::ofstream::app); prodFile1 << (command + " " + argumentList).toStdString() << "\n"; prodFile1.close(); }//_if diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgCommonUtils.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgCommonUtils.cpp index ab503a19..9d3b6dd5 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgCommonUtils.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgCommonUtils.cpp @@ -109,7 +109,7 @@ mitk::Image::Pointer CemrgCommonUtils::CropImage() { //Test input objects if (imageToCut.IsNull() || cuttingCube.IsNull()) { - return NULL; + return nullptr; } //Prepare the cutter @@ -126,7 +126,7 @@ mitk::Image::Pointer CemrgCommonUtils::CropImage() { QMessageBox::warning( NULL, "Cropping not possible!", message.c_str(), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); - return NULL; + return nullptr; }//try //Cutting successful @@ -760,7 +760,7 @@ bool CemrgCommonUtils::ConvertToCarto( outputPath = outputPath + "-carto.vtk"; //File - ofstream cartoFile; + std::ofstream cartoFile; cartoFile.open(outputPath); //Header diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgMeasure.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgMeasure.cpp index 8fafc7d2..a8064fab 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgMeasure.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgMeasure.cpp @@ -48,7 +48,7 @@ void CemrgMeasure::Convert(QString dir, mitk::DataNode::Pointer node) { items++; } - ofstream file; + std::ofstream file; file.open(dir.toStdString() + "/input.vtk"); //Header @@ -78,7 +78,7 @@ CemrgMeasure::Points CemrgMeasure::Deconvert(QString dir, int noFile) { std::string line; std::vector tokens; Points points; - ifstream file(dir.toStdString() + "/transformed-" + std::to_string(noFile) + ".vtk"); + std::ifstream file(dir.toStdString() + "/transformed-" + std::to_string(noFile) + ".vtk"); if (file.is_open()) { diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgPower.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgPower.cpp index 7261a944..17e3e912 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgPower.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgPower.cpp @@ -438,6 +438,7 @@ mitk::Surface::Pointer CemrgPower::ReferenceAHA( // Manual 6 LM = [apex, MV1, MV2, MV3, RV1, RV2] if (LandMarks.size() != 4 && LandMarks.size() != 6 && LandMarks.size() != 7) return refSurface; mitk::Point3D centre, RIV1, RIV2, APEX, MIV1, MIV2, MIV3; + if (LandMarks.size() >= 6) { APEX = LandMarks.at(0); MIV1 = LandMarks.at(1); @@ -448,7 +449,7 @@ mitk::Surface::Pointer CemrgPower::ReferenceAHA( //Calcaulte a circle through the mitral valve points centre = Circlefit3d(ZeroPoint(APEX, MIV1), ZeroPoint(APEX, MIV2), ZeroPoint(APEX, MIV3)); // Zero all points relative to apex - } else if (LandMarks.size() == 4) { + } else { // which means (LandMarks.size() == 4) APEX = LandMarks.at(0); RIV1 = LandMarks.at(2); RIV2 = LandMarks.at(3); diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgScarAdvanced.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgScarAdvanced.cpp index e44b22e3..f8ec27b6 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgScarAdvanced.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgScarAdvanced.cpp @@ -209,7 +209,7 @@ std::string CemrgScarAdvanced::num2str(double num, int precision) { void CemrgScarAdvanced::SaveStrToFile(std::string path2file, std::string filename, std::string text) { MITK_INFO << "[AdvancedScar] Saving to file: " + path2file + filename; - ofstream outst; + std::ofstream outst; std::stringstream ss; ss << (path2file + filename); @@ -359,7 +359,7 @@ void CemrgScarAdvanced::ExtractCorridorData( std::vector pointIDsInCorridor; int count = 0; - ofstream out; + std::ofstream out; xyz[0] = 1e-10; xyz[1] = 1e-10; xyz[2] = 1e-10; std::stringstream ss; @@ -465,7 +465,8 @@ void CemrgScarAdvanced::ExtractCorridorData( p2c->Update(); vtkSmartPointer threshold = vtkSmartPointer::New(); - threshold->ThresholdByUpper(_fill_threshold); + threshold->SetThresholdFunction(vtkThreshold::THRESHOLD_UPPER); + threshold->SetUpperThreshold(_fill_threshold); threshold->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::SCALARS); threshold->SetInputData(p2c->GetPolyDataOutput()); threshold->Update(); @@ -522,9 +523,9 @@ void CemrgScarAdvanced::NeighbourhoodFillingPercentage(std::vector points) double fillingcounter = 0; double total = points.size(); - // bring al lthe scalars to an array + // bring all the scalars to an array vtkFloatArray* scalars = vtkFloatArray::SafeDownCast(_SourcePolyData->GetPointData()->GetScalars()); - MITK_INFO << ("[INFO] Exploring the predeteremined neighbourhood at threshold = " + + MITK_INFO << ("[INFO] Exploring the predetermined neighbourhood at threshold = " + QString::number(_fill_threshold)).toStdString(); MITK_INFO << ("[INFO] Number of points: " + QString::number(total)).toStdString(); for (unsigned int i = 0; i < points.size(); i++) { diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgStrains.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgStrains.cpp index 6335fd89..ffc98828 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgStrains.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgStrains.cpp @@ -46,6 +46,7 @@ PURPOSE. See the above copyright notices for more information. #include #include #include +#include // C++ Standard #include @@ -312,9 +313,9 @@ std::vector CemrgStrains::ReferenceGuideLines(mitk::Data //Calculate points mitk::Point3D A1, A2, AB; mitk::Point3D PNT1, PNT2; - A1 = RIV1 - APEX; - A2 = RIV2 - APEX; - AB = CNTR - APEX; + A1 = mitk::Point3D(RIV1 - APEX); + A2 = mitk::Point3D(RIV2 - APEX); + AB = mitk::Point3D(CNTR - APEX); PNT1.SetElement(0, APEX.GetElement(0) + Dot(A1, AB) / Dot(AB, AB) * AB.GetElement(0)); PNT1.SetElement(1, APEX.GetElement(1) + Dot(A1, AB) / Dot(AB, AB) * AB.GetElement(1)); PNT1.SetElement(2, APEX.GetElement(2) + Dot(A1, AB) / Dot(AB, AB) * AB.GetElement(2)); diff --git a/CemrgApp/Modules/CemrgAppModule/src/CemrgTests.cpp b/CemrgApp/Modules/CemrgAppModule/src/CemrgTests.cpp index 5228a9de..9fd08954 100644 --- a/CemrgApp/Modules/CemrgAppModule/src/CemrgTests.cpp +++ b/CemrgApp/Modules/CemrgAppModule/src/CemrgTests.cpp @@ -49,7 +49,6 @@ PURPOSE. See the above copyright notices for more information. #include #include #include -#include #include #include #include @@ -59,12 +58,13 @@ PURPOSE. See the above copyright notices for more information. #include #include #include +#include void autoNIIconvert() { std::string frames; - ifstream file0("/home/or15/Desktop/MRI/process/frames.txt"); + std::ifstream file0("/home/or15/Desktop/MRI/process/frames.txt"); if (file0.is_open()) getline(file0, frames); file0.close(); @@ -75,7 +75,7 @@ void autoNIIconvert() { mitk::Image::Pointer img3D = mitk::Image::New(); std::string line; - ifstream file1("/home/or15/Desktop/MRI/process/" + QString::number(i).toStdString() + "/path.txt"); + std::ifstream file1("/home/or15/Desktop/MRI/process/" + QString::number(i).toStdString() + "/path.txt"); if (file1.is_open()) { getline(file1, line); while (getline(file1, line)) { @@ -85,7 +85,7 @@ void autoNIIconvert() { } } file1.close(); - ifstream file2("/home/or15/Desktop/MRI/process/" + QString::number(i).toStdString() + "/path.txt"); + std::ifstream file2("/home/or15/Desktop/MRI/process/" + QString::number(i).toStdString() + "/path.txt"); if (file2.is_open()) { bool first = true; int ctr = 0; @@ -269,7 +269,7 @@ void MeshError() { }//_if }//_for - ofstream file; + std::ofstream file; QString pathOutput = "/home/or15/Desktop/Proj/RZ/StrainsWork/MeshError/N" + QString::number(i) + "/distances.csv"; file.open(pathOutput.toStdString()); for (size_t j = 0; j < distances.size(); j++) { @@ -320,6 +320,7 @@ void polygonCutter() { writer->Write(); } +/**** The MeshUtil class was removed from the MITK **** void flattening() { mitk::Surface::Pointer surface = mitk::IOUtil::Load("/home/or15/Downloads/LGECART30MIN-Scar.vtk"); @@ -341,6 +342,7 @@ void flattening() { surface->SetVtkPolyData(MeshUtil::MeshToPolyData(mesh)); mitk::IOUtil::Save(surface, "/home/or15/Downloads/test.vtk"); } +*/ void RRcalcsAuto() { @@ -350,7 +352,7 @@ void RRcalcsAuto() { std::string lineD; //1 - ifstream dirc("/home/or15/Desktop/Proj/RZ/StrainsWork/TrackTSFFD/Transforms/dirPaths.txt"); + std::ifstream dirc("/home/or15/Desktop/Proj/RZ/StrainsWork/TrackTSFFD/Transforms/dirPaths.txt"); std::vector DS = {2, 5, 6, 8, 9, 10, 12, 13, 16, 17}; if (dirc.is_open()) { @@ -386,7 +388,7 @@ void RRcalcsAuto() { else values.push_back(rr->CalcDistance(points)); } - ofstream file; + std::ofstream file; QString path = QString::fromStdString(prePath) + QString::fromStdString(permStr) + ".csv"; file.open(path.toStdString()); for (size_t z = 0; z < values.size(); z++) { @@ -408,8 +410,8 @@ void RRcnvrtAuto() { //Converts user MPS to input.vtk for later calcs std::string lineF, lineD; - ifstream file("/home/or15/Desktop/Proj/Tom/Points/Tools/filPaths.txt"); - ifstream dirc("/home/or15/Desktop/Proj/Tom/Points/Tools/dirPaths.txt"); + std::ifstream file("/home/or15/Desktop/Proj/Tom/Points/Tools/filPaths.txt"); + std::ifstream dirc("/home/or15/Desktop/Proj/Tom/Points/Tools/dirPaths.txt"); if (file.is_open() && dirc.is_open()) { while (getline(file, lineF)) { @@ -804,7 +806,7 @@ void curvesCalculator() { fileName = "LNG.csv"; plotValueVectors = plotValueVectorsLNG; }//_if - ofstream file; + std::ofstream file; file.open(directory.toStdString() + "/" + fileName.toStdString()); std::vector values; diff --git a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresClipperView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresClipperView.cpp index ad183111..c6fd17c5 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresClipperView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresClipperView.cpp @@ -83,8 +83,9 @@ PURPOSE. See the above copyright notices for more information. // Qt #include -#include #include +#include +#include // CemrgAppModule #include @@ -125,7 +126,7 @@ void AtrialFibresClipperView::CreateQtPartControl(QWidget *parent) { defaultClipperRadius = 9.0; MITK_INFO <<"Create GUI widgets"; - inputs = new QDialog(0,0); + inputs = new QDialog(0, Qt::WindowFlags()); m_Labels.setupUi(inputs); connect(m_Labels.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_Labels.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -150,14 +151,14 @@ void AtrialFibresClipperView::CreateQtPartControl(QWidget *parent) { vtkSmartPointer renderWindow = vtkSmartPointer::New(); - m_Controls.widget_1->SetRenderWindow(renderWindow); - m_Controls.widget_1->GetRenderWindow()->AddRenderer(renderer); + m_Controls.widget_1->setRenderWindow(renderWindow); + m_Controls.widget_1->renderWindow()->AddRenderer(renderer); MITK_INFO << "Setup keyboard interactor"; callBack = vtkSmartPointer::New(); callBack->SetCallback(KeyCallBackFunc); callBack->SetClientData(this); - interactor = m_Controls.widget_1->GetRenderWindow()->GetInteractor(); + interactor = m_Controls.widget_1->renderWindow()->GetInteractor(); interactor->SetInteractorStyle(vtkSmartPointer::New()); interactor->GetInteractorStyle()->KeyPressActivationOff(); interactor->GetInteractorStyle()->AddObserver(vtkCommand::KeyPressEvent, callBack); @@ -271,7 +272,7 @@ void AtrialFibresClipperView::CtrLines() { linesActor->GetProperty()->SetColor(1,0,0); renderer->AddActor(linesActor); }//_for - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); //Adjust controllers m_Controls.button_man1_ctrlines->setEnabled(false); @@ -332,7 +333,7 @@ void AtrialFibresClipperView::CtrPlanes() { comboText = "APPENDAGE"; m_Controls.comboBox->insertItem(i, comboText); }//_for - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); //Adjust controllers m_Controls.comboBox->setCurrentIndex(0); @@ -432,7 +433,7 @@ void AtrialFibresClipperView::CtrPlanesPlacer() { clipper->CalcParamsOfPlane(ctrPlane, indexBox, position); ctrPlane->Update(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void AtrialFibresClipperView::CtrLinesSelector(int index) { @@ -472,7 +473,7 @@ void AtrialFibresClipperView::CtrLinesSelector(int index) { m_Controls.slider->setValue(position); m_Controls.spinBox->setValue(adjust); pickedCutterSeeds->SetPoints(vtkSmartPointer::New()); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void AtrialFibresClipperView::PvClipperRadius(){ @@ -523,7 +524,7 @@ void AtrialFibresClipperView::SaveLabels(){ QString prodPath = directory + "/"; std::vector ignoredIds; int ignored=0, discarded=0; - ofstream fileLabels, fileIds, fileLabelInShell, fileIgnoreIds, fileDiscardIds; + std::ofstream fileLabels, fileIds, fileLabelInShell, fileIgnoreIds, fileDiscardIds; fileLabels.open((prodPath + "prodSeedLabels.txt").toStdString()); fileIds.open((prodPath + "prodSeedIds.txt").toStdString()); @@ -580,7 +581,7 @@ void AtrialFibresClipperView::ShowPvClippers(){ bool showOnRenderer= true; CreateSphereClipperAndRadiiVectors(showOnRenderer); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); m_Controls.slider_auto->setEnabled(true); m_Controls.slider_auto->setRange(4, 30); @@ -714,7 +715,7 @@ void AtrialFibresClipperView::InterPvSpacing(){ int AtrialFibresClipperView::GetUserFixMeshingLabel(){ // returns the label to fix in the corridor (or -1 to cancel) - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UICorridor.setupUi(inputs); connect(m_UICorridor.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UICorridor.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -982,7 +983,7 @@ void AtrialFibresClipperView::PickCallBack(bool pvCorridor) { corridorLineSeeds->Modified(); } - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void AtrialFibresClipperView::ManualCutterCallBack() { @@ -1021,7 +1022,7 @@ void AtrialFibresClipperView::ManualCutterCallBack() { double* point = surface->GetVtkPolyData()->GetPoint(pickedSeedId); pickedCutterSeeds->GetPoints()->InsertNextPoint(point); pickedCutterSeeds->Modified(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void AtrialFibresClipperView::KeyCallBackFunc(vtkObject*, long unsigned int, void* ClientData, void*) { @@ -1074,7 +1075,7 @@ void AtrialFibresClipperView::KeyCallBackFunc(vtkObject*, long unsigned int, voi self->pickedSeedLabels.pop_back(); }//_if - self->m_Controls.widget_1->GetRenderWindow()->Render(); + self->m_Controls.widget_1->renderWindow()->Render(); } else if (key == "X" || key == "x"){ if(self->automaticPipeline){ if(self->corridorCountcorridorMax){ @@ -1211,7 +1212,7 @@ void AtrialFibresClipperView::KeyCallBackFunc(vtkObject*, long unsigned int, voi for (unsigned int i=0; iclipperActors.size(); i++) self->clipperActors.at(i)->GetProperty()->SetOpacity(1.0); }//_if - self->m_Controls.widget_1->GetRenderWindow()->Render(); + self->m_Controls.widget_1->renderWindow()->Render(); }//_if_key @@ -1350,7 +1351,7 @@ void AtrialFibresClipperView::SetAutomaticModeButtons(bool b){ void AtrialFibresClipperView::UserSelectPvLabel(){ int dialogCode = inputs->exec(); - QRect screenGeometry = QApplication::desktop()->screenGeometry(); + QRect screenGeometry = QGuiApplication::primaryScreen()->geometry(); int x = (screenGeometry.width() - inputs->width()) / 2; int y = (screenGeometry.height() - inputs->height()) / 2; inputs->move(x,y); diff --git a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresLandmarksView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresLandmarksView.cpp index 8179b04a..23c799e2 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresLandmarksView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresLandmarksView.cpp @@ -80,7 +80,8 @@ PURPOSE. See the above copyright notices for more information. // Qt #include -#include +#include +#include // CemrgAppModule #include @@ -109,12 +110,12 @@ void AtrialFibresLandmarksView::CreateQtPartControl(QWidget *parent) { } //Create GUI widgets - inputsRough = new QDialog(0,0); + inputsRough = new QDialog(0, Qt::WindowFlags()); m_Rough.setupUi(inputsRough); connect(m_Rough.buttonBox, SIGNAL(accepted()), inputsRough, SLOT(accept())); connect(m_Rough.buttonBox, SIGNAL(rejected()), inputsRough, SLOT(reject())); - inputsRefined = new QDialog(0,0); + inputsRefined = new QDialog(0, Qt::WindowFlags()); m_Refined.setupUi(inputsRefined); connect(m_Refined.buttonBox, SIGNAL(accepted()), inputsRefined, SLOT(accept())); connect(m_Refined.buttonBox, SIGNAL(rejected()), inputsRefined, SLOT(reject())); @@ -139,14 +140,14 @@ void AtrialFibresLandmarksView::CreateQtPartControl(QWidget *parent) { vtkSmartPointer renderWindow = vtkSmartPointer::New(); - m_Controls.widget_1->SetRenderWindow(renderWindow); - m_Controls.widget_1->GetRenderWindow()->AddRenderer(renderer); + m_Controls.widget_1->setRenderWindow(renderWindow); + m_Controls.widget_1->renderWindow()->AddRenderer(renderer); //Setup keyboard interactor callBack = vtkSmartPointer::New(); callBack->SetCallback(KeyCallBackFunc); callBack->SetClientData(this); - interactor = m_Controls.widget_1->GetRenderWindow()->GetInteractor(); + interactor = m_Controls.widget_1->renderWindow()->GetInteractor(); interactor->SetInteractorStyle(vtkSmartPointer::New()); interactor->GetInteractorStyle()->KeyPressActivationOff(); interactor->GetInteractorStyle()->AddObserver(vtkCommand::KeyPressEvent, callBack); @@ -200,7 +201,7 @@ void AtrialFibresLandmarksView::SaveRoughPoints(){ MITK_INFO << "[SaveRoughPoints] Saving rough points to file."; QString prodPath = directory + "/"; QString outname = (isLeftAtrium) ? "prodLaRoughLandmarks" : "prodRaLandmarks"; - ofstream fileRough, fileRoughLabels; + std::ofstream fileRough, fileRoughLabels; MITK_INFO << "[SaveRoughPoints] Saving TXT file."; fileRough.open((prodPath + outname + ".txt").toStdString()); @@ -244,8 +245,7 @@ void AtrialFibresLandmarksView::SaveRefinedPoints(){ MITK_INFO << "[SaveRefinedPoints] Saving refined points to file."; QString prodPath = directory + "/"; QString outname = (isLeftAtrium) ? "prodLaRefinedLandmarks" : "prodRaRegion"; - ofstream fileRefined; - ofstream fileRough, fileRefinedLabels; + std::ofstream fileRefined, fileRough, fileRefinedLabels; MITK_INFO << "[SaveRefinedPoints] Saving TXT file."; fileRefined.open((prodPath + outname + ".txt").toStdString()); @@ -415,7 +415,7 @@ void AtrialFibresLandmarksView::PickCallBack(bool refinedLandmarks) { refinedLineSeeds->Modified(); } - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void AtrialFibresLandmarksView::KeyCallBackFunc(vtkObject*, long unsigned int, void* ClientData, void*) { @@ -476,7 +476,7 @@ void AtrialFibresLandmarksView::KeyCallBackFunc(vtkObject*, long unsigned int, v self->roughSeedLabels.pop_back(); }//_if - self->m_Controls.widget_1->GetRenderWindow()->Render(); + self->m_Controls.widget_1->renderWindow()->Render(); } else if (key == "X" || key == "x"){ if(self->m_Controls.button_save2_refined->isEnabled()){ bool refinedLandmarks = true; @@ -531,7 +531,7 @@ void AtrialFibresLandmarksView::KeyCallBackFunc(vtkObject*, long unsigned int, v self->refinedSeedLabels.pop_back(); }//_if - self->m_Controls.widget_1->GetRenderWindow()->Render(); + self->m_Controls.widget_1->renderWindow()->Render(); } } else if (key == "H" || key == "h"){ self->Help(); @@ -623,7 +623,7 @@ void AtrialFibresLandmarksView::UserSelectPvLabel(bool refinedLandmarks){ void AtrialFibresLandmarksView::UserSelectPvRoughLabel(){ int dialogCode = inputsRough->exec(); - QRect screenGeometry = QApplication::desktop()->screenGeometry(); + QRect screenGeometry = QGuiApplication::primaryScreen()->geometry(); int x = (screenGeometry.width() - inputsRough->width()) / 2; int y = (screenGeometry.height() - inputsRough->height()) / 2; inputsRough->move(x,y); @@ -680,7 +680,7 @@ void AtrialFibresLandmarksView::UserSelectPvRoughLabel(){ void AtrialFibresLandmarksView::UserSelectPvRefinedLabel(){ int dialogCode = inputsRefined->exec(); - QRect screenGeometry = QApplication::desktop()->screenGeometry(); + QRect screenGeometry = QGuiApplication::primaryScreen()->geometry(); int x = (screenGeometry.width() - inputsRefined->width()) / 2; int y = (screenGeometry.height() - inputsRefined->height()) / 2; inputsRefined->move(x,y); diff --git a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp index 542947be..40466d9a 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresView.cpp @@ -74,7 +74,6 @@ PURPOSE. See the above copyright notices for more information. #include #include #include -#include #include #include @@ -1684,7 +1683,7 @@ bool AtrialFibresView::RequestProjectDirectoryFromUser() { } bool AtrialFibresView::GetUserConvertFormatInputs(QString inname, QString inext, bool cleanmesh){ - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); bool userInputAccepted=false; m_UIFormat.setupUi(inputs); connect(m_UIFormat.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); @@ -1749,7 +1748,7 @@ bool AtrialFibresView::GetUserUacOptionsInputs(bool enableFullUiOptions){ } if(!userInputAccepted){ - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIUac.setupUi(inputs); connect(m_UIUac.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIUac.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -1793,7 +1792,7 @@ bool AtrialFibresView::GetUserEditLabelsInputs(){ bool userInputAccepted=false; if(!userInputAccepted){ - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIEditLabels.setupUi(inputs); connect(m_UIEditLabels.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIEditLabels.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -1874,7 +1873,7 @@ bool AtrialFibresView::GetUserEditLabelsInputs(){ } bool AtrialFibresView::GetUserRemeshingInputs(){ - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); bool userInputAccepted=false; m_UIRemesh.setupUi(inputs); connect(m_UIRemesh.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); @@ -1949,7 +1948,7 @@ bool AtrialFibresView::GetUserAnalysisSelectorInputs(){ } if(!userInputAccepted){ - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UISelector.setupUi(inputs); connect(m_UISelector.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UISelector.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -2009,7 +2008,7 @@ bool AtrialFibresView::GetUserMeshingInputs(){ userInputAccepted=true; } } else{ - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIMeshing.setupUi(inputs); connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIMeshing.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -2048,7 +2047,7 @@ bool AtrialFibresView::GetUserMeshingInputs(){ bool AtrialFibresView::GetUserScarProjectionInputs(){ bool userInputAccepted=false; - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIcemrgnet.setupUi(inputs); connect(m_UIcemrgnet.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIcemrgnet.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -2104,7 +2103,7 @@ bool AtrialFibresView::GetUserScarProjectionInputs(){ MITK_INFO << "[UI] Creating list of thresholds"; separated_thresh_list.removeLast(); separated_thresh_list.removeLast(); - separated_thresh_list = thresh_list.split("," , QString::SkipEmptyParts); + separated_thresh_list = thresh_list.split(",", Qt::SkipEmptyParts); int listspaces = separated_thresh_list.removeAll(" "); int listduplicates = separated_thresh_list.removeDuplicates(); std::cout << "Spaces in list: " << listspaces << " Duplicates in list: " << listduplicates << '\n'; diff --git a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresVisualiseView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresVisualiseView.cpp index 45ca8fd1..c350858e 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresVisualiseView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.atrialfibres/src/internal/AtrialFibresVisualiseView.cpp @@ -119,14 +119,14 @@ void AtrialFibresVisualiseView::CreateQtPartControl(QWidget *parent) { vtkSmartPointer renderWindow = vtkSmartPointer::New(); - m_Controls.widget_1->SetRenderWindow(renderWindow); - m_Controls.widget_1->GetRenderWindow()->AddRenderer(renderer); + m_Controls.widget_1->setRenderWindow(renderWindow); + m_Controls.widget_1->renderWindow()->AddRenderer(renderer); //Setup keyboard interactor // callBack = vtkSmartPointer::New(); // callBack->SetCallback(KeyCallBackFunc); // callBack->SetClientData(this); - interactor = m_Controls.widget_1->GetRenderWindow()->GetInteractor(); + interactor = m_Controls.widget_1->renderWindow()->GetInteractor(); interactor->SetInteractorStyle(vtkSmartPointer::New()); interactor->GetInteractorStyle()->KeyPressActivationOff(); // interactor->GetInteractorStyle()->AddObserver(vtkCommand::KeyPressEvent, callBack); @@ -162,7 +162,6 @@ void AtrialFibresVisualiseView::LoadFibreFile(){ MITK_INFO << ("Fibres read. Number of fibres: " + QString::number(vectorField.size())).toStdString(); // rearrange vectorfield into vtkFlostArray fibres - vtkSmartPointer colors = vtkSmartPointer::New(); vtkSmartPointer fibres = vtkSmartPointer::New(); fibres->SetNumberOfComponents(3); fibres->SetNumberOfTuples(vectorField.size()); @@ -186,7 +185,7 @@ void AtrialFibresVisualiseView::LoadFibreFile(){ vtkNew fibresActor; fibresActor->SetMapper(fibresMapper); - fibresActor->GetProperty()->SetColor(colors->GetColor3d("Gold").GetData()); + fibresActor->GetProperty()->SetColor(255, 215, 0); // RGB value of Gold, see https://www.w3.org/TR/css-color-3/#svg-color renderer->AddActor(fibresActor); } diff --git a/CemrgApp/Plugins/kcl.cemrgapp.easi/src/internal/EASIView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.easi/src/internal/EASIView.cpp index 0c7b572c..9e26d0c9 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.easi/src/internal/EASIView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.easi/src/internal/EASIView.cpp @@ -109,8 +109,8 @@ void EASIView::OnSelectionChanged( void EASIView::LoadDICOM() { - //Use MITK DICOM editor - QString editor_id = "org.mitk.editors.dicomeditor"; + //Use MITK DICOM browser + QString editor_id = "org.mitk.editors.dicombrowser"; berry::IEditorInput::Pointer input(new berry::FileEditorInput(QString())); this->GetSite()->GetPage()->OpenEditor(input, editor_id); } @@ -446,13 +446,13 @@ void EASIView::CreateMesh() { //Write to binary file std::string path = (directory + "/converted.inr").toStdString(); - ofstream myFile(path, ios::out | ios::binary); + std::ofstream myFile(path, ios::out | ios::binary); myFile.write((char*)header, 256 * sizeof(char)); myFile.write((char*)pv, dimensions * sizeof(uint8_t)); myFile.close(); //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog *inputs = new QDialog(0, Qt::WindowFlags()); m_UIMeshing.setupUi(inputs); connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); @@ -577,7 +577,7 @@ void EASIView::ConfrmSITE() { void EASIView::Simulation() { std::string line; - ifstream file("/home/or15/Work/Strain/ResolutionStudy/paths.txt"); + std::ifstream file("/home/or15/Work/Strain/ResolutionStudy/paths.txt"); if (file.is_open()) { while (getline(file, line)) { @@ -619,7 +619,7 @@ void EASIView::Simulation() { fileName = "LV-LNG.csv"; plotValueVectors = plotValueVectorsLNG; }//_if - ofstream fileLV; + std::ofstream fileLV; fileLV.open(directory.toStdString() + "/" + fileName.toStdString()); std::vector values; for (int s = 0; s < 16; s++) { @@ -648,7 +648,7 @@ void EASIView::Simulation() { QString fileName; fileName = "LA-SQZ.csv"; - ofstream fileLA; + std::ofstream fileLA; fileLA.open(directory.toStdString() + "/" + fileName.toStdString()); std::vector values; for (int f = 0; f < 10; f++) diff --git a/CemrgApp/Plugins/kcl.cemrgapp.mainapp/src/internal/QmitkCemrgAppCommonTools.cpp b/CemrgApp/Plugins/kcl.cemrgapp.mainapp/src/internal/QmitkCemrgAppCommonTools.cpp index 5621abbc..40f98280 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.mainapp/src/internal/QmitkCemrgAppCommonTools.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.mainapp/src/internal/QmitkCemrgAppCommonTools.cpp @@ -87,7 +87,7 @@ void QmitkCemrgAppCommonTools::ConvertToCarto() { if (fullPathInfo.dir().exists("prodThresholds.txt")) { //Threshold file QString tPath = fullPathInfo.absolutePath() + "/prodThresholds.txt"; - ifstream prodFileRead(tPath.toStdString()); + std::ifstream prodFileRead(tPath.toStdString()); if (prodFileRead.is_open()) { std::string line; @@ -103,7 +103,7 @@ void QmitkCemrgAppCommonTools::ConvertToCarto() { }//_if //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog *inputs = new QDialog(0, Qt::WindowFlags()); m_CartoUIThresholding.setupUi(inputs); connect(m_CartoUIThresholding.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_CartoUIThresholding.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -262,7 +262,7 @@ void QmitkCemrgAppCommonTools::PadImageEdgesWithConstant(){ } //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0,0); + QDialog *inputs = new QDialog(0, Qt::WindowFlags()); m_ImagePadding.setupUi(inputs); connect(m_ImagePadding.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_ImagePadding.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); diff --git a/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp index d63c218b..f88dc28a 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwView.cpp @@ -125,8 +125,8 @@ void MmcwView::OnSelectionChanged( */ void MmcwView::LoadDICOM() { - //Use MITK DICOM editor - QString editor_id = "org.mitk.editors.dicomeditor"; + //Use MITK DICOM browser + QString editor_id = "org.mitk.editors.dicombrowser"; berry::IEditorInput::Pointer input(new berry::FileEditorInput(QString())); this->GetSite()->GetPage()->OpenEditor(input, editor_id); } @@ -555,7 +555,7 @@ void MmcwView::CreateSurf() { return; //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog *inputs = new QDialog(0, Qt::WindowFlags()); m_UIMeshing.setupUi(inputs); connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIMeshing.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -683,7 +683,7 @@ void MmcwView::Tracking() { }//_if //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); QSignalMapper* signalMapper = new QSignalMapper(this); m_UITracking.setupUi(inputs); @@ -709,16 +709,45 @@ void MmcwView::Tracking() { QString aPath; if (time.isEmpty()) { - ofstream file; - - MITK_INFO << "[ATTENTION] Saving imgTimes.lst file to project directory."; - time = directory + "/imgTimes.lst"; - file.open(time.toStdString(), ofstream::binary); - file << "dcm- .nii\n"; + std::ofstream file; + if (!para.isEmpty()) { + QFileInfo fi(para); + aPath = fi.absolutePath(); + } + else { + //Absolute path + aPath = QCoreApplication::applicationDirPath() + "/MLib"; + } - for (int i = 0; i < timePoints; i++) { - MITK_INFO << "File contents: " << i << " " << i * 10 << "\n"; - file << i << " " << i * 10 << "\n"; + bool dcm_path_fix = true; + if (dcm_path_fix) { + MITK_INFO << "[ATTENTION] Saving imgTimes.lst file to project directory."; + time = directory + "/imgTimes.lst"; + file.open(time.toStdString(), std::ofstream::binary); + file << "dcm- .nii\n"; + } + else { + QDir apathd(aPath); + if (apathd.mkpath(aPath)) { + // file.open(aPath.toStdString() + "/imgTimes.lst"); + QDir mainDirectory(directory); + QString aRelativePath = mainDirectory.relativeFilePath(aPath); + time = aPath + "/imgTimes.lst"; + file.open(time.toStdString(), std::ofstream::binary); + if (aRelativePath==".") + file << "dcm- .nii\n"; + else + file << aRelativePath << "/dcm- .nii\n"; + + } else { + QMessageBox::warning(NULL, "Attention", "Error creating path:\n" + aPath); + directory = QString(); + return; + } + } + for (int i=0; istrain = std::unique_ptr(new CemrgStrains());; this->AHA_camera = vtkSmartPointer::New(); this->AHA_renderer = vtkSmartPointer::New(); - this->AHA_interactor = m_Controls.widget_1->GetRenderWindow()->GetInteractor(); + this->AHA_interactor = m_Controls.widget_1->renderWindow()->GetInteractor(); } void MmcwViewPlot::SetFocus() { @@ -97,13 +97,13 @@ void MmcwViewPlot::CreateQtPartControl(QWidget *parent) { //AHA bullseye plot vtkSmartPointer renderWindow = vtkSmartPointer::New(); - m_Controls.widget_1->SetRenderWindow(renderWindow); + m_Controls.widget_1->setRenderWindow(renderWindow); AHA_renderer = vtkSmartPointer::New(); AHA_renderer->SetBackground(0, 0, 0); m_Controls.horizontalSlider->setMaximum(noFrames * smoothness); - m_Controls.widget_1->GetRenderWindow()->AddRenderer(AHA_renderer); - AHA_interactor = m_Controls.widget_1->GetRenderWindow()->GetInteractor(); + m_Controls.widget_1->renderWindow()->AddRenderer(AHA_renderer); + AHA_interactor = m_Controls.widget_1->renderWindow()->GetInteractor(); AHA_interactor->RemoveObservers(vtkCommand::LeftButtonPressEvent); AHA_interactor->RemoveObservers(vtkCommand::LeftButtonReleaseEvent); AHA_interactor->RemoveObservers(vtkCommand::RightButtonPressEvent); @@ -628,7 +628,8 @@ void MmcwViewPlot::WritePlotToCSV(QString dir) { fileName = "SQZ_at_pacing_0.66.csv"; fileName = QInputDialog::getText(NULL, tr("Save As"), tr("File Name:"), QLineEdit::Normal, fileName, &ok); if (ok && !fileName.isEmpty() && fileName.endsWith(".csv")) { - ofstream file; + + std::ofstream file; file.open(dir.toStdString() + "/" + fileName.toStdString()); std::vector values; for (int i = 0; i < 16; i++) { diff --git a/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwViewPlotControls.ui b/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwViewPlotControls.ui index 5ac7a887..1f50200f 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwViewPlotControls.ui +++ b/CemrgApp/Plugins/kcl.cemrgapp.mmcwplugin/src/internal/MmcwViewPlotControls.ui @@ -156,7 +156,7 @@ - + 0 @@ -271,9 +271,9 @@ - QVTKOpenGLWidget + QVTKOpenGLStereoWidget QWidget -
QVTKOpenGLWidget.h
+
QVTKOpenGLStereoWidget.h
1
diff --git a/CemrgApp/Plugins/kcl.cemrgapp.mmeasurement/src/internal/MmeasurementView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.mmeasurement/src/internal/MmeasurementView.cpp index 2af630de..4264b3c3 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.mmeasurement/src/internal/MmeasurementView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.mmeasurement/src/internal/MmeasurementView.cpp @@ -113,8 +113,9 @@ void MmeasurementView::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*sourc } void MmeasurementView::LoadDICOM() { - // Use MITK DICOM editor - QString editor_id = "org.mitk.editors.dicomeditor"; + + //Use MITK DICOM browser + QString editor_id = "org.mitk.editors.dicombrowser"; berry::IEditorInput::Pointer input(new berry::FileEditorInput(QString())); this->GetSite()->GetPage()->OpenEditor(input, editor_id); } @@ -528,7 +529,7 @@ void MmeasurementView::Tracking() { }//_if //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); QSignalMapper* signalMapper = new QSignalMapper(this); m_UITracking.setupUi(inputs); @@ -553,7 +554,7 @@ void MmeasurementView::Tracking() { QMessageBox::warning(NULL, "Attention", "Reverting to default time or parameter file!"); if (time.isEmpty()) { - ofstream file; + std::ofstream file; //Absolute path QString aPath = QCoreApplication::applicationDirPath() + "/MLib"; file.open(aPath.toStdString() + "/imgTimes.lst"); @@ -626,7 +627,7 @@ void MmeasurementView::Applying() { rr->Convert(directory, node); //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); QSignalMapper* signalMapper = new QSignalMapper(this); m_UIApplying.setupUi(inputs); @@ -711,7 +712,7 @@ void MmeasurementView::WriteFileButton() { fileName = QInputDialog::getText(NULL, tr("Save As"), tr("File Name:"), QLineEdit::Normal, fileName, &ok); if (ok && !fileName.isEmpty() && fileName.endsWith(".csv")) { - ofstream file; + std::ofstream file; file.open(directory.toStdString() + "/" + fileName.toStdString()); std::vector values; for (int i = 0; i < timePoints * smoothness; i++) diff --git a/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransView.cpp index a1fccf9f..0c6e7d1d 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransView.cpp @@ -130,8 +130,8 @@ void powertransView::OnSelectionChanged( void powertransView::LoadDICOM() { - //Use MITK DICOM editor - QString editor_id = "org.mitk.editors.dicomeditor"; + //Use MITK DICOM browser + QString editor_id = "org.mitk.editors.dicombrowser"; berry::IEditorInput::Pointer input(new berry::FileEditorInput(QString())); this->GetSite()->GetPage()->OpenEditor(input, editor_id); @@ -396,7 +396,7 @@ void powertransView::MapPowerTop() { } void powertransView::ResetRibSpacing() { - QDialog* inputs = new QDialog(0, 0); + QDialog *inputs = new QDialog(0, Qt::WindowFlags()); m_UIRibSpacing.setupUi(inputs); connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); @@ -445,7 +445,7 @@ void powertransView::LandmarkSelection() { //Ask for user input to set the ribSpacing number if (ribSpacing==0) { - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIRibSpacing.setupUi(inputs); connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); @@ -501,7 +501,7 @@ void powertransView::MapPowerTransLM() { } //Ask for user input to set the ribSpacing number if (ribSpacing == 0) { - QDialog* inputs = new QDialog(0, 0); + QDialog *inputs = new QDialog(0, Qt::WindowFlags()); m_UIRibSpacing.setupUi(inputs); connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); @@ -575,7 +575,7 @@ void powertransView::MapPowerTransLM() { } //Ask for user input to set the ribSpacing number if (ribSpacing==0) { - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIRibSpacing.setupUi(inputs); connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); @@ -665,7 +665,7 @@ void powertransView::CalculatePower() { } //Ask for user input to set the ribSpacing number if (ribSpacing == 0) { - QDialog* inputs = new QDialog(0, 0); + QDialog *inputs = new QDialog(0, Qt::WindowFlags()); m_UIRibSpacing.setupUi(inputs); connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); @@ -760,7 +760,7 @@ void powertransView::AHALandmarkSelection() { void powertransView::MapAHAfromInput() { //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog *inputs = new QDialog(0, Qt::WindowFlags()); QSignalMapper* signalMapper = new QSignalMapper(this); m_UIAhaInput.setupUi(inputs); diff --git a/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransViewPlot.cpp b/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransViewPlot.cpp index 717f8980..ea9c4ca7 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransViewPlot.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransViewPlot.cpp @@ -628,7 +628,7 @@ void powertransViewPlot::WritePlotToCSV(QString dir) { fileName = QInputDialog::getText(NULL, tr("Save As"), tr("File Name:"), QLineEdit::Normal, fileName, &ok); if (ok && !fileName.isEmpty() && fileName.endsWith(".csv")) { - ofstream file; + std::ofstream file; file.open(dir.toStdString() + "/" + fileName.toStdString()); std::vector values; for (int i = 0; i < 16; i++) { diff --git a/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransViewPlotControls.ui b/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransViewPlotControls.ui index 6ef36ff5..6c4ead18 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransViewPlotControls.ui +++ b/CemrgApp/Plugins/kcl.cemrgapp.powertrans/src/internal/powertransViewPlotControls.ui @@ -38,7 +38,7 @@
- + 0 @@ -134,9 +134,9 @@ - QVTKOpenGLWidget + QVTKOpenGLStereoWidget QWidget -
QVTKOpenGLWidget.h
+
QVTKOpenGLStereoWidget.h
1
diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/CMakeLists.txt b/CemrgApp/Plugins/kcl.cemrgapp.scar/CMakeLists.txt index 3eea8f3a..8938ba6b 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/CMakeLists.txt +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/CMakeLists.txt @@ -4,4 +4,5 @@ mitk_create_plugin( EXPORT_DIRECTIVE SCAR_EXPORT EXPORTED_INCLUDE_SUFFIXES src MODULE_DEPENDS MitkQtWidgetsExt MitkCemrgAppModule + PACKAGE_DEPENDS PRIVATE VTK|CommonSystem ) diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperView.cpp index 58d174ec..edaa3d8d 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperView.cpp @@ -62,7 +62,8 @@ PURPOSE. See the above copyright notices for more information. // Qt #include -#include +#include +#include // CemrgAppModule #include @@ -73,7 +74,7 @@ QString AtrialScarClipperView::directory; const std::string AtrialScarClipperView::VIEW_ID = "org.mitk.views.scarclipper"; AtrialScarClipperView::AtrialScarClipperView(){ - this->inputs = new QDialog(0, 0); + this->inputs = new QDialog(0, Qt::WindowFlags()); } void AtrialScarClipperView::CreateQtPartControl(QWidget *parent) { @@ -88,7 +89,7 @@ void AtrialScarClipperView::CreateQtPartControl(QWidget *parent) { connect(m_Controls.comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(CtrLinesSelector(int))); //Create GUI widgets - inputs = new QDialog(0, 0); + inputs = new QDialog(0, Qt::WindowFlags()); m_Labels.setupUi(inputs); //QDialogButtonBox connect(m_Labels.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_Labels.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -105,14 +106,14 @@ void AtrialScarClipperView::CreateQtPartControl(QWidget *parent) { renderer->AddActor2D(txtActor); vtkSmartPointer renderWindow = vtkSmartPointer::New(); - m_Controls.widget_1->SetRenderWindow(renderWindow); - m_Controls.widget_1->GetRenderWindow()->AddRenderer(renderer); + m_Controls.widget_1->setRenderWindow(renderWindow); + m_Controls.widget_1->renderWindow()->AddRenderer(renderer); //Setup keyboard interactor callBack = vtkSmartPointer::New(); callBack->SetCallback(KeyCallBackFunc); callBack->SetClientData(this); - interactor = m_Controls.widget_1->GetRenderWindow()->GetInteractor(); + interactor = m_Controls.widget_1->renderWindow()->GetInteractor(); interactor->SetInteractorStyle(vtkSmartPointer::New()); interactor->GetInteractorStyle()->KeyPressActivationOff(); interactor->GetInteractorStyle()->AddObserver(vtkCommand::KeyPressEvent, callBack); @@ -180,7 +181,7 @@ void AtrialScarClipperView::iniPreSurf() { }//_if //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIMeshing.setupUi(inputs); connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIMeshing.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -308,7 +309,7 @@ void AtrialScarClipperView::CtrLines() { renderer->AddActor(linesActor); }//_for // m_Controls.widget_1->GetVtkRenderWindow()->Render(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); //Adjust controllers m_Controls.button_1->setEnabled(false); @@ -376,7 +377,7 @@ void AtrialScarClipperView::CtrPlanes() { comboText = "APPENDAGE UNCUT"; m_Controls.comboBox->insertItem(i, comboText); }//_for - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); //Adjust controllers m_Controls.comboBox->setCurrentIndex(0); @@ -463,7 +464,7 @@ void AtrialScarClipperView::CtrPlanesPlacer() { clipper->CalcParamsOfPlane(ctrPlane, indexBox, position); ctrPlane->Update(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void AtrialScarClipperView::CtrLinesSelector(int index) { @@ -502,7 +503,7 @@ void AtrialScarClipperView::CtrLinesSelector(int index) { m_Controls.slider->setValue(position); m_Controls.spinBox->setValue(adjust); pickedCutterSeeds->SetPoints(vtkSmartPointer::New()); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void AtrialScarClipperView::Visualiser() { @@ -561,7 +562,7 @@ void AtrialScarClipperView::PickCallBack() { double* point = surface->GetVtkPolyData()->GetPoint(pickedSeedId); pickedLineSeeds->GetPoints()->InsertNextPoint(point); pickedLineSeeds->Modified(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void AtrialScarClipperView::ManualCutterCallBack() { @@ -614,7 +615,7 @@ void AtrialScarClipperView::ManualCutterCallBack() { double* point = surface->GetVtkPolyData()->GetPoint(pickedSeedId); pickedCutterSeeds->GetPoints()->InsertNextPoint(point); pickedCutterSeeds->Modified(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void AtrialScarClipperView::KeyCallBackFunc(vtkObject*, long unsigned int, void* ClientData, void*) { @@ -630,7 +631,7 @@ void AtrialScarClipperView::KeyCallBackFunc(vtkObject*, long unsigned int, void* //Ask the labels self->PickCallBack(); int dialogCode = self->inputs->exec(); - QRect screenGeometry = QApplication::desktop()->screenGeometry(); + QRect screenGeometry = QGuiApplication::primaryScreen()->geometry(); int x = (screenGeometry.width() - self->inputs->width()) / 2; int y = (screenGeometry.height() - self->inputs->height()) / 2; self->inputs->move(x, y); @@ -716,7 +717,7 @@ void AtrialScarClipperView::KeyCallBackFunc(vtkObject*, long unsigned int, void* self->pickedSeedLabels.pop_back(); }//_if - self->m_Controls.widget_1->GetRenderWindow()->Render(); + self->m_Controls.widget_1->renderWindow()->Render(); }//_if_space } else if (self->clipper->GetCentreLinePolyPlanes().size() != 0 && !self->m_Controls.button_1->isEnabled() && @@ -814,7 +815,7 @@ void AtrialScarClipperView::KeyCallBackFunc(vtkObject*, long unsigned int, void* for (unsigned int i = 0; i < self->clipperActors.size(); i++) self->clipperActors.at(i)->GetProperty()->SetOpacity(1.0); }//_if - self->m_Controls.widget_1->GetRenderWindow()->Render(); + self->m_Controls.widget_1->renderWindow()->Render(); }//_if_key diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperViewControls.ui b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperViewControls.ui index 36b6a25a..e96cc4c4 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperViewControls.ui +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarClipperViewControls.ui @@ -40,7 +40,7 @@
- + 0 @@ -113,9 +113,9 @@ background-color: yellow; - QVTKOpenGLWidget + QVTKOpenGLStereoWidget QWidget -
QVTKOpenGLWidget.h
+
QVTKOpenGLStereoWidget.h
1
diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp index 6a63c531..7416407b 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/AtrialScarView.cpp @@ -201,7 +201,7 @@ void AtrialScarView::LoadDICOM() { } else { MITK_WARN << "Problem with conversion."; - QMessageBox::warning(NULL, "Attention", "Problem with alternative conversion. Try MITK Dicom editor?"); + QMessageBox::warning(NULL, "Attention", "Problem with alternative conversion. Try MITK DICOM browser?"); return; }//_if @@ -209,8 +209,8 @@ void AtrialScarView::LoadDICOM() { } else { - MITK_INFO << "Using MITK DICOM editor"; - QString editor_id = "org.mitk.editors.dicomeditor"; + MITK_INFO << "Using MITK DICOM browser"; + QString editor_id = "org.mitk.editors.dicombrowser"; berry::IEditorInput::Pointer input(new berry::FileEditorInput(QString())); this->GetSite()->GetPage()->OpenEditor(input, editor_id); @@ -362,7 +362,7 @@ void AtrialScarView::AutomaticAnalysis() { } }//_while - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIcemrgnet.setupUi(inputs); connect(m_UIcemrgnet.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIcemrgnet.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -420,7 +420,7 @@ void AtrialScarView::AutomaticAnalysis() { MITK_INFO << "[UI] Creating list of thresholds"; separated_thresh_list.removeLast(); separated_thresh_list.removeLast(); - separated_thresh_list = thresh_list.split(",", QString::SkipEmptyParts); + separated_thresh_list = thresh_list.split(",", Qt::SkipEmptyParts); int listspaces = separated_thresh_list.removeAll(" "); int listduplicates = separated_thresh_list.removeDuplicates(); separated_thresh_list.sort(); @@ -1167,7 +1167,7 @@ void AtrialScarView::CreateSurf() { }//_if //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIMeshing.setupUi(inputs); connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIMeshing.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -1421,7 +1421,7 @@ void AtrialScarView::ScarMap() { if (scar) { //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIScar.setupUi(inputs); connect(m_UIScar.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIScar.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -1448,7 +1448,7 @@ void AtrialScarView::ScarMap() { * Producibility Test **/ QString prodPath = directory + "/"; - ofstream prodFile1; + std::ofstream prodFile1; prodFile1.open((prodPath + "prodScarMapInputs.txt").toStdString()); prodFile1 << minStep << "\n"; prodFile1 << maxStep << "\n"; @@ -1650,7 +1650,7 @@ void AtrialScarView::Threshold() { }//_data //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UISQuant.setupUi(inputs); connect(m_UISQuant.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UISQuant.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/ScarCalculationsView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/ScarCalculationsView.cpp index d53b2067..d98c8645 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/ScarCalculationsView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/ScarCalculationsView.cpp @@ -84,7 +84,7 @@ QString ScarCalculationsView::postScarFile; const std::string ScarCalculationsView::VIEW_ID = "org.mitk.views.scarcalculations"; ScarCalculationsView::ScarCalculationsView() { - this->inputs = new QDialog(0, 0); + this->inputs = new QDialog(0, Qt::WindowFlags()); this->method = -1; this->value = -1; this->mean = -1; @@ -214,8 +214,8 @@ void ScarCalculationsView::GetInputsFromFile() { else prodPath = ScarCalculationsView::postdir + "/"; - ifstream prodFileRead; - ofstream prodFileWrite; + std::ifstream prodFileRead; + std::ofstream prodFileWrite; prodFileRead.open((prodPath + "prodThresholds.txt").toStdString()); prodFileWrite.open((prodPathOut + "prodThresholds" + need2load.at(i) + ".txt").toStdString()); @@ -258,14 +258,14 @@ void ScarCalculationsView::CreateQtPartControl(QWidget *parent) { vtkSmartPointer renderWindow = vtkSmartPointer::New(); - m_Controls.widget_1->SetRenderWindow(renderWindow); - m_Controls.widget_1->GetRenderWindow()->AddRenderer(renderer); + m_Controls.widget_1->setRenderWindow(renderWindow); + m_Controls.widget_1->renderWindow()->AddRenderer(renderer); //Setup keyboard interactor callBack = vtkSmartPointer::New(); callBack->SetCallback(KeyCallBackFunc); callBack->SetClientData(this); - interactor = m_Controls.widget_1->GetRenderWindow()->GetInteractor(); + interactor = m_Controls.widget_1->renderWindow()->GetInteractor(); interactor->SetInteractorStyle(vtkSmartPointer::New()); interactor->GetInteractorStyle()->KeyPressActivationOff(); interactor->GetInteractorStyle()->AddObserver(vtkCommand::KeyPressEvent, callBack); @@ -336,7 +336,7 @@ void ScarCalculationsView::iniPreSurf() { // Load file information MITK_INFO << "Loading threshold information from file"; double datainfo[5]; - ifstream prodFileRead; + std::ifstream prodFileRead; QString prodPathAdv = ScarCalculationsView::advdir + "/"; prodFileRead.open((prodPathAdv + "prodThresholdsPre.txt").toStdString()); @@ -404,7 +404,7 @@ void ScarCalculationsView::KeyCallBackFunc(vtkObject*, long unsigned int, void* for (int i = 0; i < points->GetNumberOfPoints() - 1; i++) newPoints->InsertNextPoint(points->GetPoint(i)); self->pickedLineSeeds->SetPoints(newPoints); - self->m_Controls.widget_1->GetRenderWindow()->Render(); + self->m_Controls.widget_1->renderWindow()->Render(); } else if (key == "r" || key == "R") { MITK_INFO << "[INFO][KeyCallBackFunc] Pressed R key.\n"; @@ -542,7 +542,7 @@ void ScarCalculationsView::CtrlPrePostSelection(const QString& text) { // Load file information MITK_INFO << "Loading threshold information from file"; double datainfo[5]; - ifstream prodFileRead; + std::ifstream prodFileRead; QString prodPathAdv = ScarCalculationsView::advdir + "/"; QString shellpath = prodPathAdv; @@ -595,7 +595,7 @@ void ScarCalculationsView::CtrlPrePostSelection(const QString& text) { Visualiser(); csadv->SetMaxScalar(this->maxScalar); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); SetShortcutLegend(); } @@ -633,7 +633,7 @@ void ScarCalculationsView::EditThreshold() { csadv->ResetValues(); BinVisualiser(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void ScarCalculationsView::SetNewThreshold(const QString& text) { @@ -668,7 +668,7 @@ void ScarCalculationsView::SetNewThreshold(const QString& text) { csadv->ResetValues(); BinVisualiser(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void ScarCalculationsView::SaveNewThreshold() { @@ -720,7 +720,7 @@ void ScarCalculationsView::SaveNewThreshold() { Visualiser(); csadv->SetMaxScalar(this->maxScalar); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); SetShortcutLegend(); } @@ -779,7 +779,7 @@ void ScarCalculationsView::CancelThresholdEdit() { Visualiser(); csadv->SetMaxScalar(this->maxScalar); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); SetShortcutLegend(); } @@ -810,7 +810,7 @@ void ScarCalculationsView::PickCallBack() { double* point = surface->GetVtkPolyData()->GetPoint(pickedSeedId); pickedLineSeeds->GetPoints()->InsertNextPoint(point); pickedLineSeeds->Modified(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } // Button functionalities @@ -863,7 +863,7 @@ void ScarCalculationsView::GapMeasurement() { MITK_INFO << "Creating shortest path and corridor."; // Choose parameters: neighbourhood size, left/right prefix - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UICorridor.setupUi(inputs); connect(m_UICorridor.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UICorridor.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -897,7 +897,7 @@ void ScarCalculationsView::GapMeasurement() { renderer->AddActor(this->dijkstraActors[i]); } - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); QMessageBox::warning(NULL, "F&I T2 - FINISHED CALCULATION", (csadv->PrintAblationGapsResults(mean, stdv, value)).c_str()); @@ -941,7 +941,7 @@ void ScarCalculationsView::GapMeasurementVisualisation(const QString& text) { csadv->ResetValues(); BinVisualiser(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } } else MITK_INFO << "Empty name of file. "; @@ -1037,7 +1037,7 @@ void ScarCalculationsView::BeforeAndAfterCompVisualisation() { csadv->ResetValues(); BinVisualiser(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void ScarCalculationsView::Sphericity() { @@ -1076,7 +1076,7 @@ void ScarCalculationsView::TransformMeshesForComparison() { void ScarCalculationsView::GetThresholdValuesFromFile(QString filepath) { double data1[5]; - ifstream prodFileRead; + std::ifstream prodFileRead; prodFileRead.open(filepath.toStdString()); MITK_INFO << "READ FILE: " + filepath; @@ -1095,7 +1095,7 @@ void ScarCalculationsView::GetThresholdValuesFromFile(QString filepath) { void ScarCalculationsView::SetThresholdValuesToFile(QString filepath) { double data1[5]; - ofstream prodFileWrite; + std::ofstream prodFileWrite; prodFileWrite.open(filepath.toStdString()); data1[0] = value; diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/ScarCalculationsViewControls.ui b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/ScarCalculationsViewControls.ui index 931439c6..7ae16f01 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/ScarCalculationsViewControls.ui +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/ScarCalculationsViewControls.ui @@ -57,7 +57,7 @@
- + 0 @@ -119,9 +119,9 @@ - QVTKOpenGLWidget + QVTKOpenGLStereoWidget QWidget -
QVTKOpenGLWidget.h
+
QVTKOpenGLStereoWidget.h
1
diff --git a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/YZSegView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/YZSegView.cpp index dad1d33e..2d754630 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/YZSegView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.scar/src/internal/YZSegView.cpp @@ -112,8 +112,9 @@ void YZSegView::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*source*/, co } void YZSegView::LoadDICOM() { - //Use MITK DICOM editor - QString editor_id = "org.mitk.editors.dicomeditor"; + + //Use MITK DICOM browser + QString editor_id = "org.mitk.editors.dicombrowser"; berry::IEditorInput::Pointer input(new berry::FileEditorInput(QString())); this->GetSite()->GetPage()->OpenEditor(input, editor_id); } diff --git a/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsClipperView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsClipperView.cpp index 19138722..44d9de92 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsClipperView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsClipperView.cpp @@ -73,7 +73,8 @@ PURPOSE. See the above copyright notices for more information. // Qt #include -#include +#include +#include // CemrgAppModule #include @@ -84,7 +85,7 @@ QString WallThicknessCalculationsClipperView::directory; const std::string WallThicknessCalculationsClipperView::VIEW_ID = "org.mitk.views.wathcaclipperview"; WallThicknessCalculationsClipperView::WallThicknessCalculationsClipperView() { - this->inputs = new QDialog(0, 0); + this->inputs = new QDialog(0, Qt::WindowFlags()); } void WallThicknessCalculationsClipperView::CreateQtPartControl(QWidget *parent) { @@ -99,7 +100,7 @@ void WallThicknessCalculationsClipperView::CreateQtPartControl(QWidget *parent) connect(m_Controls.comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(CtrLinesSelector(int))); //Create GUI widgets - inputs = new QDialog(0, 0); + inputs = new QDialog(0, Qt::WindowFlags()); m_Labels.setupUi(inputs); connect(m_Labels.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_Labels.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -116,14 +117,14 @@ void WallThicknessCalculationsClipperView::CreateQtPartControl(QWidget *parent) renderer->AddActor2D(txtActor); vtkSmartPointer renderWindow = vtkSmartPointer::New(); - m_Controls.widget_1->SetRenderWindow(renderWindow); - m_Controls.widget_1->GetRenderWindow()->AddRenderer(renderer); + m_Controls.widget_1->setRenderWindow(renderWindow); + m_Controls.widget_1->renderWindow()->AddRenderer(renderer); //Setup keyboard interactor callBack = vtkSmartPointer::New(); callBack->SetCallback(KeyCallBackFunc); callBack->SetClientData(this); - interactor = m_Controls.widget_1->GetRenderWindow()->GetInteractor(); + interactor = m_Controls.widget_1->renderWindow()->GetInteractor(); interactor->SetInteractorStyle(vtkSmartPointer::New()); interactor->GetInteractorStyle()->KeyPressActivationOff(); interactor->GetInteractorStyle()->AddObserver(vtkCommand::KeyPressEvent, callBack); @@ -189,7 +190,7 @@ void WallThicknessCalculationsClipperView::iniPreSurf() { }//_if //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0, 0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIMeshing.setupUi(inputs); connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_UIMeshing.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); @@ -336,7 +337,7 @@ void WallThicknessCalculationsClipperView::CtrLines() { linesActor->GetProperty()->SetColor(1, 0, 0); renderer->AddActor(linesActor); }//_for - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); //Adjust controllers m_Controls.button_1->setEnabled(false); @@ -403,7 +404,7 @@ void WallThicknessCalculationsClipperView::CtrPlanes() { comboText = "APPENDAGE UNCUT"; m_Controls.comboBox->insertItem(i, comboText); }//_for - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); //Adjust controllers m_Controls.comboBox->setCurrentIndex(0); @@ -503,7 +504,7 @@ void WallThicknessCalculationsClipperView::CtrPlanesPlacer() { clipper->CalcParamsOfPlane(ctrPlane, indexBox, position); ctrPlane->Update(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void WallThicknessCalculationsClipperView::CtrLinesSelector(int index) { @@ -542,7 +543,7 @@ void WallThicknessCalculationsClipperView::CtrLinesSelector(int index) { m_Controls.slider->setValue(position); m_Controls.spinBox->setValue(adjust); pickedCutterSeeds->SetPoints(vtkSmartPointer::New()); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void WallThicknessCalculationsClipperView::Visualiser() { @@ -601,7 +602,7 @@ void WallThicknessCalculationsClipperView::PickCallBack() { double* point = surface->GetVtkPolyData()->GetPoint(pickedSeedId); pickedLineSeeds->GetPoints()->InsertNextPoint(point); pickedLineSeeds->Modified(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void WallThicknessCalculationsClipperView::ManualCutterCallBack() { @@ -654,7 +655,7 @@ void WallThicknessCalculationsClipperView::ManualCutterCallBack() { double* point = surface->GetVtkPolyData()->GetPoint(pickedSeedId); pickedCutterSeeds->GetPoints()->InsertNextPoint(point); pickedCutterSeeds->Modified(); - m_Controls.widget_1->GetRenderWindow()->Render(); + m_Controls.widget_1->renderWindow()->Render(); } void WallThicknessCalculationsClipperView::KeyCallBackFunc(vtkObject*, long unsigned int, void* ClientData, void*) { @@ -670,7 +671,7 @@ void WallThicknessCalculationsClipperView::KeyCallBackFunc(vtkObject*, long unsi //Ask the labels self->PickCallBack(); int dialogCode = self->inputs->exec(); - QRect screenGeometry = QApplication::desktop()->screenGeometry(); + QRect screenGeometry = QGuiApplication::primaryScreen()->geometry(); int x = (screenGeometry.width() - self->inputs->width()) / 2; int y = (screenGeometry.height() - self->inputs->height()) / 2; self->inputs->move(x, y); @@ -756,7 +757,7 @@ void WallThicknessCalculationsClipperView::KeyCallBackFunc(vtkObject*, long unsi self->pickedSeedLabels.pop_back(); }//_if - self->m_Controls.widget_1->GetRenderWindow()->Render(); + self->m_Controls.widget_1->renderWindow()->Render(); }//_if_space } else if (self->clipper->GetCentreLinePolyPlanes().size() != 0 && !self->m_Controls.button_1->isEnabled() && @@ -854,7 +855,7 @@ void WallThicknessCalculationsClipperView::KeyCallBackFunc(vtkObject*, long unsi for (unsigned int i = 0; i < self->clipperActors.size(); i++) self->clipperActors.at(i)->GetProperty()->SetOpacity(1.0); }//_if - self->m_Controls.widget_1->GetRenderWindow()->Render(); + self->m_Controls.widget_1->renderWindow()->Render(); }//_if_key diff --git a/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsClipperViewControls.ui b/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsClipperViewControls.ui index fed04756..d833c9d0 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsClipperViewControls.ui +++ b/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsClipperViewControls.ui @@ -40,7 +40,7 @@
- + 0 @@ -113,9 +113,9 @@ background-color: yellow; - QVTKOpenGLWidget + QVTKOpenGLStereoWidget QWidget -
QVTKOpenGLWidget.h
+
QVTKOpenGLStereoWidget.h
1
diff --git a/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsView.cpp b/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsView.cpp index f9667c47..1a9d1843 100644 --- a/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsView.cpp +++ b/CemrgApp/Plugins/kcl.cemrgapp.wathca/src/internal/WallThicknessCalculationsView.cpp @@ -142,8 +142,8 @@ void WallThicknessCalculationsView::OnSelectionChanged( void WallThicknessCalculationsView::LoadDICOM() { - //Use MITK DICOM editor - QString editor_id = "org.mitk.editors.dicomeditor"; + //Use MITK DICOM browser + QString editor_id = "org.mitk.editors.dicombrowser"; berry::IEditorInput::Pointer input(new berry::FileEditorInput(QString())); this->GetSite()->GetPage()->OpenEditor(input, editor_id); } @@ -554,7 +554,7 @@ void WallThicknessCalculationsView::MorphologyAnalysis() { mitk::Image::Pointer bp = mitk::IOUtil::Load(directory.toStdString() + "/PVeinsCroppedImage.nii"); //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_UIMeshing.setupUi(inputs); connect(m_UIMeshing.buttonBox, &QDialogButtonBox::accepted, inputs, &QDialog::accept); connect(m_UIMeshing.buttonBox, &QDialogButtonBox::rejected, inputs, &QDialog::reject); @@ -656,7 +656,7 @@ void WallThicknessCalculationsView::MorphologyAnalysis() { double volumeAP = morphAnal->calcVolumeMesh(surfAP); //Store in text file - ofstream morphResult; + std::ofstream morphResult; QString morphPath = directory + "/morphResults.txt"; morphResult.open(morphPath.toStdString(), std::ios_base::app); morphResult << "SA" << " " << surfceLA << "\n"; @@ -816,13 +816,13 @@ void WallThicknessCalculationsView::ThicknessCalculator() { //Write to binary file std::string path = (directory + "/converted.inr").toStdString(); - ofstream myFile(path, ios::out | ios::binary); + std::ofstream myFile(path, ios::out | ios::binary); myFile.write((char*)header, 256 * sizeof(char)); myFile.write((char*)pv, dimensions * sizeof(uint8_t)); myFile.close(); //Ask for user input to set the parameters - QDialog* inputs = new QDialog(0,0); + QDialog* inputs = new QDialog(0, Qt::WindowFlags()); m_Thickness.setupUi(inputs); connect(m_Thickness.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept())); connect(m_Thickness.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject())); diff --git a/versionOnsplashScreen.sh b/versionOnsplashScreen.sh deleted file mode 100755 index 681738e2..00000000 --- a/versionOnsplashScreen.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -OUTFILE="./CemrgApp/Applications/MainApp/version.txt" - -# SHAVAR=$(git log --oneline -1 | awk -F ' ' '{print $1}') -# VERVAR=$(git tag --points-at=${SHAVAR}) -# -# echo $VERVAR -# echo $SHAVAR -# -# echo $VERVAR > $OUTFILE -# echo $SHAVAR >> $OUTFILE - -MYVAR=$(git tag) -echo $MYVAR | awk -F v '{print $NF}' > $OUTFILE - -MYVAR2=$(echo $MYVAR | awk -F v '{print $NF}') -git log v$MYVAR2 --oneline -1 | awk -F ' ' '{print $1}' >> $OUTFILE