diff --git a/Applications/FlowBench/MitkFlowBench.cpp b/Applications/FlowBench/MitkFlowBench.cpp index bcf68e09a2..68f548deb5 100644 --- a/Applications/FlowBench/MitkFlowBench.cpp +++ b/Applications/FlowBench/MitkFlowBench.cpp @@ -1,42 +1,42 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include int main(int argc, char **argv) { mitk::BaseApplication app(argc, argv); app.setSingleMode(true); app.setApplicationName("MITK FlowBench"); app.setOrganizationName("DKFZ"); - // Preload the org.mitk.gui.qt.ext plug-in (and hence also QmitkExt) to speed + // Preload the org.mitk.gui.qt.application plug-in to speed // up a clean-cache start. This also works around bugs in older gcc and glibc implementations, // which have difficulties with multiple dynamic opening and closing of shared libraries with // many global static initializers. It also helps if dependent libraries have weird static // initialization methods and/or missing de-initialization code. QStringList preloadLibs; - preloadLibs << "liborg_mitk_gui_qt_ext"; + preloadLibs << "org_mitk_gui_qt_application"; app.setPreloadLibraries(preloadLibs); - app.setProperty(mitk::BaseApplication::PROP_PRODUCT, "org.mitk.gui.qt.flowbenchapplication.workbench"); + app.setProperty(mitk::BaseApplication::PROP_PRODUCT, "org.mitk.gui.qt.flowapplication.workbench"); // Run the workbench. return app.run(); } diff --git a/Applications/FlowBench/target_libraries.cmake b/Applications/FlowBench/target_libraries.cmake index 1b3f103f90..554862e5c0 100644 --- a/Applications/FlowBench/target_libraries.cmake +++ b/Applications/FlowBench/target_libraries.cmake @@ -1,10 +1,10 @@ # A list of plug-in targets which should be automatically enabled # (or be available in external projects) for this application. set(target_libraries org_blueberry_ui_qt org_blueberry_ui_qt_help - org_mitk_gui_qt_flowbenchapplication + org_mitk_gui_qt_flowapplication org_mitk_gui_qt_stdmultiwidgeteditor ) diff --git a/CMake/BuildConfigurations/FlowBenchSegmentation.cmake b/CMake/BuildConfigurations/FlowBenchSegmentation.cmake index ace7950a9a..a5bf915e3e 100644 --- a/CMake/BuildConfigurations/FlowBenchSegmentation.cmake +++ b/CMake/BuildConfigurations/FlowBenchSegmentation.cmake @@ -1,16 +1,16 @@ set(MITK_CONFIG_PACKAGES Qt5 BLUEBERRY ) set(MITK_BUILD_APP_FlowBench ON CACHE BOOL "Build MITK FlowBench" FORCE) set(MITK_CONFIG_PLUGINS org.mitk.gui.qt.stdmultiwidgeteditor org.mitk.gui.qt.imagenavigator org.mitk.gui.qt.properties org.mitk.gui.qt.multilabelsegmentation - org.mitk.gui.qt.flowbench.segmentation + org.mitk.gui.qt.flow.segmentation ) set(MITK_VTK_DEBUG_LEAKS OFF CACHE BOOL "Enable VTK Debug Leaks" FORCE) \ No newline at end of file diff --git a/CMake/Whitelists/FlowBenchSegmentation.cmake b/CMake/Whitelists/FlowBenchSegmentation.cmake index 8a279143b0..41d3c61250 100644 --- a/CMake/Whitelists/FlowBenchSegmentation.cmake +++ b/CMake/Whitelists/FlowBenchSegmentation.cmake @@ -1,57 +1,57 @@ set(enabled_modules Core CppMicroServices DICOMReader DICOMPM DataTypesExt AlgorithmsExt DICOMQI Multilabel SceneSerializationBase DICOMPMIO DICOMReaderServices ContourModel DICOMSegIO LegacyGL MapperExt SceneSerialization LegacyIO IOExt MultilabelIO AppUtil QtWidgets QtWidgetsExt Segmentation SegmentationUI PlanarFigure Annotation IpSegmentation IpFunc SurfaceInterpolation GraphAlgorithms ImageExtraction ImageStatistics ) set(enabled_plugins org.blueberry.core.commands org.blueberry.core.expressions org.blueberry.core.runtime org.blueberry.ui.qt org.blueberry.ui.qt.help org.blueberry.ui.qt.log org.mitk.core.ext org.mitk.core.services org.mitk.gui.common org.mitk.gui.qt.application org.mitk.gui.qt.common org.mitk.gui.qt.datamanager -org.mitk.gui.qt.flowbench.segmentation -org.mitk.gui.qt.flowbenchapplication +org.mitk.gui.qt.flow.segmentation +org.mitk.gui.qt.flowapplication org.mitk.gui.qt.imagenavigator org.mitk.gui.qt.multilabelsegmentation org.mitk.gui.qt.properties org.mitk.gui.qt.segmentation org.mitk.gui.qt.stdmultiwidgeteditor org.mitk.planarfigure ) diff --git a/Plugins/PluginList.cmake b/Plugins/PluginList.cmake index b3b8bdae84..75c0bd20be 100644 --- a/Plugins/PluginList.cmake +++ b/Plugins/PluginList.cmake @@ -1,104 +1,104 @@ # Plug-ins must be ordered according to their dependencies set(MITK_PLUGINS org.blueberry.core.runtime:ON org.blueberry.core.expressions:OFF org.blueberry.core.commands:OFF org.blueberry.core.jobs:OFF org.blueberry.ui.qt:OFF org.blueberry.ui.qt.help:ON org.blueberry.ui.qt.log:ON org.blueberry.ui.qt.objectinspector:OFF #org.blueberry.test:ON #org.blueberry.uitest:ON #Testing/org.blueberry.core.runtime.tests:ON #Testing/org.blueberry.osgi.tests:ON org.mitk.core.services:ON org.mitk.gui.common:ON org.mitk.planarfigure:ON org.mitk.core.ext:OFF org.mitk.core.jobs:OFF org.mitk.gui.qt.application:ON org.mitk.gui.qt.coreapplication:OFF org.mitk.gui.qt.ext:OFF org.mitk.gui.qt.extapplication:OFF org.mitk.gui.qt.common:ON org.mitk.gui.qt.stdmultiwidgeteditor:ON org.mitk.gui.qt.mxnmultiwidgeteditor:OFF org.mitk.gui.qt.common.legacy:OFF org.mitk.gui.qt.cmdlinemodules:OFF org.mitk.gui.qt.chartExample:OFF org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.datamanagerlight:OFF org.mitk.gui.qt.datastorageviewertest:OFF org.mitk.gui.qt.properties:ON org.mitk.gui.qt.basicimageprocessing:OFF org.mitk.gui.qt.dicom:OFF org.mitk.gui.qt.dicominspector:OFF org.mitk.gui.qt.dosevisualization:OFF org.mitk.gui.qt.geometrytools:OFF org.mitk.gui.qt.igtexamples:OFF org.mitk.gui.qt.igttracking:OFF org.mitk.gui.qt.lasercontrol:OFF org.mitk.gui.qt.openigtlink:OFF org.mitk.gui.qt.imagecropper:OFF org.mitk.gui.qt.imagenavigator:ON org.mitk.gui.qt.viewnavigator:OFF org.mitk.gui.qt.materialeditor:OFF org.mitk.gui.qt.measurementtoolbox:OFF org.mitk.gui.qt.moviemaker:OFF org.mitk.gui.qt.pointsetinteraction:OFF org.mitk.gui.qt.pointsetinteractionmultispectrum:OFF org.mitk.gui.qt.python:OFF org.mitk.gui.qt.remeshing:OFF org.mitk.gui.qt.segmentation:OFF org.mitk.gui.qt.aicpregistration:OFF org.mitk.gui.qt.renderwindowmanager:OFF org.mitk.gui.qt.semanticrelations:OFF org.mitk.gui.qt.toftutorial:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.tubegraph:OFF org.mitk.gui.qt.ugvisualization:OFF org.mitk.gui.qt.photoacoustics.pausviewer:OFF org.mitk.gui.qt.photoacoustics.pausmotioncompensation:OFF org.mitk.gui.qt.photoacoustics.imageprocessing:OFF org.mitk.gui.qt.photoacoustics.simulation:OFF org.mitk.gui.qt.photoacoustics.spectralunmixing:OFF org.mitk.gui.qt.ultrasound:OFF org.mitk.gui.qt.volumevisualization:OFF org.mitk.gui.qt.eventrecorder:OFF org.mitk.gui.qt.xnat:OFF org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation:OFF org.mitk.gui.qt.spectrocamrecorder:OFF org.mitk.gui.qt.classificationsegmentation:OFF org.mitk.gui.qt.overlaymanager:OFF org.mitk.gui.qt.igt.app.hummelprotocolmeasurements:OFF org.mitk.gui.qt.multilabelsegmentation:OFF org.mitk.matchpoint.core.helper:OFF org.mitk.gui.qt.matchpoint.algorithm.browser:OFF org.mitk.gui.qt.matchpoint.algorithm.control:OFF org.mitk.gui.qt.matchpoint.algorithm.batch:OFF org.mitk.gui.qt.matchpoint.mapper:OFF org.mitk.gui.qt.matchpoint.framereg:OFF org.mitk.gui.qt.matchpoint.visualizer:OFF org.mitk.gui.qt.matchpoint.evaluator:OFF org.mitk.gui.qt.matchpoint.manipulator:OFF org.mitk.gui.qt.preprocessing.resampling:OFF org.mitk.gui.qt.radiomics:OFF org.mitk.gui.qt.cest:OFF org.mitk.gui.qt.fit.demo:OFF org.mitk.gui.qt.fit.inspector:OFF org.mitk.gui.qt.fit.genericfitting:OFF org.mitk.gui.qt.pharmacokinetics.mri:OFF org.mitk.gui.qt.pharmacokinetics.pet:OFF org.mitk.gui.qt.pharmacokinetics.simulation:OFF org.mitk.gui.qt.pharmacokinetics.curvedescriptor:OFF org.mitk.gui.qt.pharmacokinetics.concentration.mri:OFF - org.mitk.gui.qt.flowbench.segmentation:OFF - org.mitk.gui.qt.flowbenchapplication:OFF + org.mitk.gui.qt.flowapplication:OFF + org.mitk.gui.qt.flow.segmentation:OFF ) diff --git a/Plugins/org.mitk.gui.qt.flow.segmentation/CMakeLists.txt b/Plugins/org.mitk.gui.qt.flow.segmentation/CMakeLists.txt new file mode 100644 index 0000000000..b9e2f34736 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/CMakeLists.txt @@ -0,0 +1,7 @@ +project(org_mitk_gui_qt_flow_segmentation) + +mitk_create_plugin( + EXPORT_DIRECTIVE MITK_GUI_QT_FLOW_SEGMENTATION_EXPORT + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDS MitkQtWidgets MitkMultilabel +) diff --git a/Plugins/org.mitk.gui.qt.flow.segmentation/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.flow.segmentation/documentation/UserManual/Manual.dox new file mode 100644 index 0000000000..11ebcc0a36 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/documentation/UserManual/Manual.dox @@ -0,0 +1,6 @@ +/** +\page org_mitk_gui_qt_flow_segmentation The Segmentation Flow + + +*/ + diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/doxygen/modules.dox b/Plugins/org.mitk.gui.qt.flow.segmentation/documentation/doxygen/modules.dox similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/doxygen/modules.dox rename to Plugins/org.mitk.gui.qt.flow.segmentation/documentation/doxygen/modules.dox diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/files.cmake b/Plugins/org.mitk.gui.qt.flow.segmentation/files.cmake similarity index 78% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/files.cmake rename to Plugins/org.mitk.gui.qt.flow.segmentation/files.cmake index 9d819ea96f..2d5b0a93a5 100644 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/files.cmake +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/files.cmake @@ -1,46 +1,46 @@ set(SRC_CPP_FILES ) set(INTERNAL_CPP_FILES - org_mitk_gui_qt_flowbench_segmentation_Activator.cpp + org_mitk_gui_qt_flow_segmentation_Activator.cpp QmitkSegmentationFlowControlView.cpp - perspectives/QmitkFlowBenchSegmentationPerspective.cpp + perspectives/QmitkFlowSegmentationPerspective.cpp ) set(UI_FILES src/internal/QmitkSegmentationFlowControlView.ui ) set(MOC_H_FILES - src/internal/org_mitk_gui_qt_flowbench_segmentation_Activator.h + src/internal/org_mitk_gui_qt_flow_segmentation_Activator.h src/internal/QmitkSegmentationFlowControlView.h - src/internal/perspectives/QmitkFlowBenchSegmentationPerspective.h + src/internal/perspectives/QmitkFlowSegmentationPerspective.h ) # list of resource files which can be used by the plug-in # system without loading the plug-ins shared library, # for example the icon used in the menu and tabs for the # plug-in views in the workbench set(CACHED_RESOURCE_FILES resources/icon.svg plugin.xml resources/perspectives/segmentation_icon.svg ) # list of Qt .qrc files which contain additional resources # specific to this plugin set(QRC_FILES ) set(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.flow.segmentation/manifest_headers.cmake similarity index 63% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/manifest_headers.cmake rename to Plugins/org.mitk.gui.qt.flow.segmentation/manifest_headers.cmake index 081ed078ff..724db97aef 100644 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/manifest_headers.cmake +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/manifest_headers.cmake @@ -1,5 +1,5 @@ -set(Plugin-Name "FlowBench Segmentation Controll") +set(Plugin-Name "Flow Segmentation Control") set(Plugin-Version "0.1") set(Plugin-Vendor "DKFZ, Medical Image Computing") set(Plugin-ContactAddress "http://www.mitk.org") -set(Require-Plugin org.mitk.gui.qt.common org.mitk.gui.qt.multilabelsegmentation) #org.mitk.gui.qt.flowbenchapplication) +set(Require-Plugin org.mitk.gui.qt.common org.mitk.gui.qt.multilabelsegmentation org.mitk.gui.qt.flowapplication) diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/plugin.xml b/Plugins/org.mitk.gui.qt.flow.segmentation/plugin.xml similarity index 73% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/plugin.xml rename to Plugins/org.mitk.gui.qt.flow.segmentation/plugin.xml index 7a805a606d..393d53ce91 100644 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/plugin.xml +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/plugin.xml @@ -1,21 +1,21 @@ - diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/resources/icon.svg b/Plugins/org.mitk.gui.qt.flow.segmentation/resources/icon.svg similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/resources/icon.svg rename to Plugins/org.mitk.gui.qt.flow.segmentation/resources/icon.svg diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/resources/perspectives/segmentation_icon.svg b/Plugins/org.mitk.gui.qt.flow.segmentation/resources/perspectives/segmentation_icon.svg similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/resources/perspectives/segmentation_icon.svg rename to Plugins/org.mitk.gui.qt.flow.segmentation/resources/perspectives/segmentation_icon.svg diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/QmitkSegmentationFlowControlView.cpp b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.cpp similarity index 97% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/QmitkSegmentationFlowControlView.cpp rename to Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.cpp index ade1e6025b..06a4f45a85 100644 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/QmitkSegmentationFlowControlView.cpp +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.cpp @@ -1,126 +1,126 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#include "org_mitk_gui_qt_flowbench_segmentation_Activator.h" +#include "org_mitk_gui_qt_flow_segmentation_Activator.h" // Blueberry #include #include #include //MITK #include "mitkLabelSetImage.h" #include "mitkNodePredicateAnd.h" #include "mitkNodePredicateNot.h" #include "mitkNodePredicateProperty.h" #include "mitkNodePredicateDataType.h" #include "mitkIOUtil.h" // Qmitk #include "QmitkSegmentationFlowControlView.h" // Qt #include -const std::string QmitkSegmentationFlowControlView::VIEW_ID = "org.mitk.views.flowbench.control"; +const std::string QmitkSegmentationFlowControlView::VIEW_ID = "org.mitk.views.flow.control"; QmitkSegmentationFlowControlView::QmitkSegmentationFlowControlView() : m_Parent(nullptr) { auto nodePredicate = mitk::NodePredicateAnd::New(); nodePredicate->AddPredicate(mitk::TNodePredicateDataType::New()); nodePredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object"))); m_SegmentationPredicate = nodePredicate; m_OutputDir = itksys::SystemTools::GetCurrentWorkingDirectory(); m_FileExtension = "nrrd"; } void QmitkSegmentationFlowControlView::SetFocus() { m_Controls.btnStoreAndAccept->setFocus(); } void QmitkSegmentationFlowControlView::CreateQtPartControl(QWidget* parent) { // create GUI widgets from the Qt Designer's .ui file m_Controls.setupUi(parent); m_Parent = parent; connect(m_Controls.btnStoreAndAccept, SIGNAL(clicked()), this, SLOT(OnAcceptButtonPushed())); m_Controls.labelStored->setVisible(false); UpdateControls(); auto arguments = QCoreApplication::arguments(); bool isFlagFound = false; for (auto arg : arguments) { if (isFlagFound) { m_OutputDir = arg.toLatin1(); break; } isFlagFound = arg.startsWith("--flow.outputdir"); } isFlagFound = false; for (auto arg : arguments) { if (isFlagFound) { m_FileExtension = arg.toLatin1(); break; } isFlagFound = arg.startsWith("--flow.outputformat"); } } void QmitkSegmentationFlowControlView::OnAcceptButtonPushed() { auto nodes = this->GetDataStorage()->GetSubset(m_SegmentationPredicate); for (auto node : *nodes) { std::string outputpath = m_OutputDir + "\\" + node->GetName() + "." + m_FileExtension; mitk::IOUtil::Save(node->GetData(), outputpath); } m_Controls.labelStored->setVisible(true); } void QmitkSegmentationFlowControlView::UpdateControls() { auto nodes = this->GetDataStorage()->GetSubset(m_SegmentationPredicate); m_Controls.btnStoreAndAccept->setEnabled(!nodes->empty()); }; void QmitkSegmentationFlowControlView::NodeAdded(const mitk::DataNode* node) { UpdateControls(); }; void QmitkSegmentationFlowControlView::NodeChanged(const mitk::DataNode* node) { UpdateControls(); }; void QmitkSegmentationFlowControlView::NodeRemoved(const mitk::DataNode* node) { UpdateControls(); }; diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/QmitkSegmentationFlowControlView.h b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.h similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/QmitkSegmentationFlowControlView.h rename to Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.h diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/QmitkSegmentationFlowControlView.ui b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.ui similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/QmitkSegmentationFlowControlView.ui rename to Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.ui diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/org_mitk_gui_qt_flowbench_segmentation_Activator.cpp b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/org_mitk_gui_qt_flow_segmentation_Activator.cpp similarity index 56% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/org_mitk_gui_qt_flowbench_segmentation_Activator.cpp rename to Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/org_mitk_gui_qt_flow_segmentation_Activator.cpp index 1737c1124a..f8dddd25e8 100644 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/org_mitk_gui_qt_flowbench_segmentation_Activator.cpp +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/org_mitk_gui_qt_flow_segmentation_Activator.cpp @@ -1,42 +1,42 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#include "org_mitk_gui_qt_flowbench_segmentation_Activator.h" +#include "org_mitk_gui_qt_flow_segmentation_Activator.h" #include "QmitkSegmentationFlowControlView.h" -#include "perspectives/QmitkFlowBenchSegmentationPerspective.h" +#include "perspectives/QmitkFlowSegmentationPerspective.h" -ctkPluginContext* org_mitk_gui_qt_flowbench_segmentation_Activator::m_Context = nullptr; +ctkPluginContext* org_mitk_gui_qt_flow_segmentation_Activator::m_Context = nullptr; -void org_mitk_gui_qt_flowbench_segmentation_Activator::start(ctkPluginContext* context) +void org_mitk_gui_qt_flow_segmentation_Activator::start(ctkPluginContext* context) { BERRY_REGISTER_EXTENSION_CLASS(QmitkSegmentationFlowControlView, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkFlowBenchSegmentationPerspective, context); + BERRY_REGISTER_EXTENSION_CLASS(QmitkFlowSegmentationPerspective, context); m_Context = context; } -void org_mitk_gui_qt_flowbench_segmentation_Activator::stop(ctkPluginContext* context) +void org_mitk_gui_qt_flow_segmentation_Activator::stop(ctkPluginContext* context) { Q_UNUSED(context) m_Context = nullptr; } -ctkPluginContext* org_mitk_gui_qt_flowbench_segmentation_Activator::GetContext() +ctkPluginContext* org_mitk_gui_qt_flow_segmentation_Activator::GetContext() { return m_Context; } diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/org_mitk_gui_qt_flowbench_segmentation_Activator.h b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/org_mitk_gui_qt_flow_segmentation_Activator.h similarity index 73% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/org_mitk_gui_qt_flowbench_segmentation_Activator.h rename to Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/org_mitk_gui_qt_flow_segmentation_Activator.h index cf8beb8d71..f20e8dcb37 100644 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/org_mitk_gui_qt_flowbench_segmentation_Activator.h +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/org_mitk_gui_qt_flow_segmentation_Activator.h @@ -1,43 +1,43 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef org_mitk_gui_qt_flowbench_segmentation_Activator_h -#define org_mitk_gui_qt_flowbench_segmentation_Activator_h +#ifndef org_mitk_gui_qt_flow_segmentation_Activator_h +#define org_mitk_gui_qt_flow_segmentation_Activator_h #include -class org_mitk_gui_qt_flowbench_segmentation_Activator : +class org_mitk_gui_qt_flow_segmentation_Activator : public QObject, public ctkPluginActivator { Q_OBJECT - Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_flowbench_segmentation") + Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_flow_segmentation") Q_INTERFACES(ctkPluginActivator) public: void start(ctkPluginContext* context) override; void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; -#endif // org_mitk_gui_qt_flowbench_segmentation_Activator_h +#endif // org_mitk_gui_qt_flow_segmentation_Activator_h diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/perspectives/QmitkFlowBenchSegmentationPerspective.cpp b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.cpp similarity index 69% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/perspectives/QmitkFlowBenchSegmentationPerspective.cpp rename to Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.cpp index b52d262490..59982c7017 100644 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/perspectives/QmitkFlowBenchSegmentationPerspective.cpp +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.cpp @@ -1,47 +1,47 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#include "QmitkFlowBenchSegmentationPerspective.h" +#include "QmitkFlowSegmentationPerspective.h" #include "berryIViewLayout.h" -QmitkFlowBenchSegmentationPerspective::QmitkFlowBenchSegmentationPerspective() +QmitkFlowSegmentationPerspective::QmitkFlowSegmentationPerspective() { } -void QmitkFlowBenchSegmentationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) +void QmitkFlowSegmentationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) { QString editorArea = layout->GetEditorArea(); layout->AddView("org.mitk.views.multilabelsegmentation", berry::IPageLayout::LEFT, 0.3f, editorArea); berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.multilabelsegmentation"); lo->SetCloseable(false); - layout->AddStandaloneView("org.mitk.views.flowbench.control",false, berry::IPageLayout::RIGHT, 0.6f, editorArea); - lo = layout->GetViewLayout("org.mitk.views.flowbench.control"); + layout->AddStandaloneView("org.mitk.views.flow.control",false, berry::IPageLayout::RIGHT, 0.6f, editorArea); + lo = layout->GetViewLayout("org.mitk.views.flow.control"); lo->SetCloseable(false); layout->AddView("org.mitk.views.imagenavigator", - berry::IPageLayout::TOP, 0.1f, "org.mitk.views.flowbench.control"); + berry::IPageLayout::TOP, 0.1f, "org.mitk.views.flow.control"); berry::IPlaceholderFolderLayout::Pointer bottomFolder = layout->CreatePlaceholderFolder("bottom", berry::IPageLayout::BOTTOM, 0.7f, editorArea); bottomFolder->AddPlaceholder("org.blueberry.views.logview"); berry::IPlaceholderFolderLayout::Pointer rightFolder = layout->CreatePlaceholderFolder("right", berry::IPageLayout::RIGHT, 0.3f, editorArea); rightFolder->AddPlaceholder("org.mitk.views.datamanager"); - layout->AddPerspectiveShortcut("org.mitk.qt.flowbenchapplication.defaultperspective"); + layout->AddPerspectiveShortcut("org.mitk.qt.flowapplication.defaultperspective"); } diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/perspectives/QmitkFlowBenchSegmentationPerspective.h b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.h similarity index 70% rename from Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/perspectives/QmitkFlowBenchSegmentationPerspective.h rename to Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.h index 991fe7ee5d..0cfcf1abcd 100644 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/src/internal/perspectives/QmitkFlowBenchSegmentationPerspective.h +++ b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.h @@ -1,36 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef QMITKFLOWBENCHSEGMENTATIONPERSPECTIVE_H_ -#define QMITKFLOWBENCHSEGMENTATIONPERSPECTIVE_H_ +#ifndef QMITKFLOWSEGMENTATIONPERSPECTIVE_H_ +#define QMITKFLOWSEGMENTATIONPERSPECTIVE_H_ #include -class QmitkFlowBenchSegmentationPerspective : public QObject, public berry::IPerspectiveFactory +class QmitkFlowSegmentationPerspective : public QObject, public berry::IPerspectiveFactory { Q_OBJECT Q_INTERFACES(berry::IPerspectiveFactory) public: - QmitkFlowBenchSegmentationPerspective(); + QmitkFlowSegmentationPerspective(); void CreateInitialLayout(berry::IPageLayout::Pointer layout) override; }; -#endif /* QMITKFLOWBENCHSEGMENTATIONPERSPECTIVE_H_ */ +#endif /* QMITKFLOWSEGMENTATIONPERSPECTIVE_H_ */ diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/CMakeLists.txt b/Plugins/org.mitk.gui.qt.flowapplication/CMakeLists.txt similarity index 88% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/CMakeLists.txt rename to Plugins/org.mitk.gui.qt.flowapplication/CMakeLists.txt index fbfa5f186c..68e309ef49 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.flowapplication/CMakeLists.txt @@ -1,17 +1,17 @@ -project(org_mitk_gui_qt_flowbenchapplication) +project(org_mitk_gui_qt_flowapplication) # see bug-19679 set(additional_dependencies "") if(APPLE) set(additional_dependencies Qt5|DBus) endif() mitk_create_plugin( EXPORT_DIRECTIVE MITK_QT_FLOW_BENCH_APP_EXPORT EXPORTED_INCLUDE_SUFFIXES src MODULE_DEPENDS PRIVATE MitkQtWidgetsExt MitkSceneSerialization MitkAppUtil PACKAGE_DEPENDS Qt5|WebEngineWidgets ${additional_dependencies} ) diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/documentation/UserManual/QmitkMITKWorkbenchUserManual.dox b/Plugins/org.mitk.gui.qt.flowapplication/documentation/UserManual/QmitkMITKWorkbenchUserManual.dox similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/documentation/UserManual/QmitkMITKWorkbenchUserManual.dox rename to Plugins/org.mitk.gui.qt.flowapplication/documentation/UserManual/QmitkMITKWorkbenchUserManual.dox diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/documentation/UserManual/VisualizationPerspective.dox b/Plugins/org.mitk.gui.qt.flowapplication/documentation/UserManual/VisualizationPerspective.dox similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/documentation/UserManual/VisualizationPerspective.dox rename to Plugins/org.mitk.gui.qt.flowapplication/documentation/UserManual/VisualizationPerspective.dox diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/documentation/UserManual/eye.png b/Plugins/org.mitk.gui.qt.flowapplication/documentation/UserManual/eye.png similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/documentation/UserManual/eye.png rename to Plugins/org.mitk.gui.qt.flowapplication/documentation/UserManual/eye.png diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/documentation/doxygen/modules.dox b/Plugins/org.mitk.gui.qt.flowapplication/documentation/doxygen/modules.dox similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/documentation/doxygen/modules.dox rename to Plugins/org.mitk.gui.qt.flowapplication/documentation/doxygen/modules.dox diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/files.cmake b/Plugins/org.mitk.gui.qt.flowapplication/files.cmake similarity index 61% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/files.cmake rename to Plugins/org.mitk.gui.qt.flowapplication/files.cmake index 6022691dee..56a4d17a2d 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/files.cmake +++ b/Plugins/org.mitk.gui.qt.flowapplication/files.cmake @@ -1,42 +1,42 @@ set(SRC_CPP_FILES ) set(INTERNAL_CPP_FILES - QmitkFlowBenchApplication.cpp - QmitkFlowBenchApplicationPlugin.cpp - QmitkFlowBenchApplicationWorkbenchAdvisor.cpp - QmitkFlowBenchApplicationWorkbenchWindowAdvisor.cpp + QmitkFlowApplication.cpp + QmitkFlowApplicationPlugin.cpp + QmitkFlowApplicationWorkbenchAdvisor.cpp + QmitkFlowApplicationWorkbenchWindowAdvisor.cpp QmitkExtFileSaveProjectAction.cpp ) set(MOC_H_FILES - src/internal/QmitkFlowBenchApplication.h - src/internal/QmitkFlowBenchApplicationPlugin.h - src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisor.h - src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack.h + src/internal/QmitkFlowApplication.h + src/internal/QmitkFlowApplicationPlugin.h + src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.h + src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h src/internal/QmitkExtFileSaveProjectAction.h ) set(CACHED_RESOURCE_FILES # list of resource files which can be used by the plug-in # system without loading the plug-ins shared library, # for example the icon used in the menu and tabs for the # plug-in views in the workbench plugin.xml resources/icon_research.xpm ) set(QRC_FILES -resources/QmitkFlowBenchApplication.qrc +resources/QmitkFlowApplication.qrc ) set(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.flowapplication/manifest_headers.cmake similarity index 70% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/manifest_headers.cmake rename to Plugins/org.mitk.gui.qt.flowapplication/manifest_headers.cmake index 5b747db3a3..3f8747c24d 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/manifest_headers.cmake +++ b/Plugins/org.mitk.gui.qt.flowapplication/manifest_headers.cmake @@ -1,5 +1,5 @@ -set(Plugin-Name "MITK FlowBench") +set(Plugin-Name "MITK Flow Application") set(Plugin-Version "1.0.0") set(Plugin-Vendor "DKFZ, Medical Image Computing") set(Plugin-ContactAddress "http://www.mitk.org") -set(Require-Plugin org.mitk.core.ext org.mitk.gui.qt.application org.mitk.gui.qt.flowbench.segmentation) +set(Require-Plugin org.mitk.core.ext org.mitk.gui.qt.application) # org.mitk.gui.qt.flow.segmentation) diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/plugin.xml b/Plugins/org.mitk.gui.qt.flowapplication/plugin.xml similarity index 85% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/plugin.xml rename to Plugins/org.mitk.gui.qt.flowapplication/plugin.xml index acd3ffa912..065ceb26fe 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/plugin.xml +++ b/Plugins/org.mitk.gui.qt.flowapplication/plugin.xml @@ -1,30 +1,30 @@ - + - + - + diff --git a/Plugins/org.mitk.gui.qt.flowapplication/resources/QmitkFlowApplication.qrc b/Plugins/org.mitk.gui.qt.flowapplication/resources/QmitkFlowApplication.qrc new file mode 100644 index 0000000000..4348c5cf18 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.flowapplication/resources/QmitkFlowApplication.qrc @@ -0,0 +1,5 @@ + + + icon.png + + diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/resources/icon.png b/Plugins/org.mitk.gui.qt.flowapplication/resources/icon.png similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/resources/icon.png rename to Plugins/org.mitk.gui.qt.flowapplication/resources/icon.png diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/resources/icon_research.xpm b/Plugins/org.mitk.gui.qt.flowapplication/resources/icon_research.xpm similarity index 100% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/resources/icon_research.xpm rename to Plugins/org.mitk.gui.qt.flowapplication/resources/icon_research.xpm diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkExtFileSaveProjectAction.cpp b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.cpp similarity index 97% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkExtFileSaveProjectAction.cpp rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.cpp index e0267eba64..2e342b351b 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkExtFileSaveProjectAction.cpp +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.cpp @@ -1,180 +1,180 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkExtFileSaveProjectAction.h" -#include "QmitkFlowBenchApplicationPlugin.h" +#include "QmitkFlowApplicationPlugin.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "berryPlatform.h" QmitkExtFileSaveProjectAction::QmitkExtFileSaveProjectAction(berry::IWorkbenchWindow::Pointer window) : QAction(nullptr) , m_Window(nullptr) { this->Init(window.GetPointer()); } QmitkExtFileSaveProjectAction::QmitkExtFileSaveProjectAction(berry::IWorkbenchWindow* window) : QAction(nullptr) , m_Window(nullptr) { this->Init(window); } void QmitkExtFileSaveProjectAction::Init(berry::IWorkbenchWindow* window) { m_Window = window; this->setText("&Save Project..."); this->setToolTip("Save content of Data Manager as a .mitk project file"); this->connect(this, SIGNAL(triggered(bool)), this, SLOT(Run())); } void QmitkExtFileSaveProjectAction::Run() { try { /** * @brief stores the last path of last saved file */ static QString m_LastPath; mitk::IDataStorageReference::Pointer dsRef; { - ctkPluginContext* context = QmitkFlowBenchApplicationPlugin::GetDefault()->GetPluginContext(); + ctkPluginContext* context = QmitkFlowApplicationPlugin::GetDefault()->GetPluginContext(); mitk::IDataStorageService* dss = nullptr; ctkServiceReference dsServiceRef = context->getServiceReference(); if (dsServiceRef) { dss = context->getService(dsServiceRef); } if (!dss) { QString msg = "IDataStorageService service not available. Unable to open files."; MITK_WARN << msg.toStdString(); QMessageBox::warning(QApplication::activeWindow(), "Unable to open files", msg); return; } // Get the active data storage (or the default one, if none is active) dsRef = dss->GetDataStorage(); context->ungetService(dsServiceRef); } mitk::DataStorage::Pointer storage = dsRef->GetDataStorage(); QString dialogTitle = "Save MITK Scene (%1)"; QString fileName = QFileDialog::getSaveFileName(nullptr, dialogTitle.arg(dsRef->GetLabel()), m_LastPath, "MITK scene files (*.mitk)", nullptr ); if (fileName.isEmpty() ) return; // remember the location m_LastPath = fileName; if ( fileName.right(5) != ".mitk" ) fileName += ".mitk"; mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New(); mitk::ProgressBar::GetInstance()->AddStepsToDo(2); /* Build list of nodes that should be saved */ mitk::NodePredicateNot::Pointer isNotHelperObject = mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object", mitk::BoolProperty::New(true))); mitk::DataStorage::SetOfObjects::ConstPointer nodesToBeSaved = storage->GetSubset(isNotHelperObject); if ( !sceneIO->SaveScene( nodesToBeSaved, storage, fileName.toStdString() ) ) { QMessageBox::information(nullptr, "Scene saving", "Scene could not be written completely. Please check the log.", QMessageBox::Ok); } mitk::ProgressBar::GetInstance()->Progress(2); mitk::SceneIO::FailedBaseDataListType::ConstPointer failedNodes = sceneIO->GetFailedNodes(); if (!failedNodes->empty()) { std::stringstream ss; ss << "The following nodes could not be serialized:" << std::endl; for ( mitk::SceneIO::FailedBaseDataListType::const_iterator iter = failedNodes->begin(); iter != failedNodes->end(); ++iter ) { ss << " - "; if ( mitk::BaseData* data =(*iter)->GetData() ) { ss << data->GetNameOfClass(); } else { ss << "(nullptr)"; } ss << " contained in node '" << (*iter)->GetName() << "'" << std::endl; } MITK_WARN << ss.str(); } mitk::PropertyList::ConstPointer failedProperties = sceneIO->GetFailedProperties(); if (!failedProperties->GetMap()->empty()) { std::stringstream ss; ss << "The following properties could not be serialized:" << std::endl; const mitk::PropertyList::PropertyMap* propmap = failedProperties->GetMap(); for ( mitk::PropertyList::PropertyMap::const_iterator iter = propmap->begin(); iter != propmap->end(); ++iter ) { ss << " - " << iter->second->GetNameOfClass() << " associated to key '" << iter->first << "'" << std::endl; } MITK_WARN << ss.str(); } } catch (std::exception& e) { MITK_ERROR << "Exception caught during scene saving: " << e.what(); } } diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkExtFileSaveProjectAction.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.h similarity index 95% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkExtFileSaveProjectAction.h rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.h index df6e722344..626e649981 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkExtFileSaveProjectAction.h +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.h @@ -1,51 +1,51 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkExtFileSaveProjectAction_H_ #define QmitkExtFileSaveProjectAction_H_ #include -#include +#include #include namespace berry { struct IWorkbenchWindow; } class MITK_QT_FLOW_BENCH_APP_EXPORT QmitkExtFileSaveProjectAction : public QAction { Q_OBJECT public: QmitkExtFileSaveProjectAction(berry::SmartPointer window); QmitkExtFileSaveProjectAction(berry::IWorkbenchWindow* window); protected slots: void Run(); private: void Init(berry::IWorkbenchWindow* window); berry::IWorkbenchWindow* m_Window; }; #endif /*QmitkExtFileSaveProjectAction_H_*/ diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplication.cpp b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.cpp similarity index 68% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplication.cpp rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.cpp index 1ec957bfb6..6cc79ec08f 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplication.cpp +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.cpp @@ -1,43 +1,43 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#include "QmitkFlowBenchApplication.h" +#include "QmitkFlowApplication.h" #include -#include "QmitkFlowBenchApplicationWorkbenchAdvisor.h" +#include "QmitkFlowApplicationWorkbenchAdvisor.h" -QmitkFlowBenchApplication::QmitkFlowBenchApplication() +QmitkFlowApplication::QmitkFlowApplication() { } -QVariant QmitkFlowBenchApplication::Start(berry::IApplicationContext* /*context*/) +QVariant QmitkFlowApplication::Start(berry::IApplicationContext* /*context*/) { QScopedPointer display(berry::PlatformUI::CreateDisplay()); - QScopedPointer wbAdvisor(new QmitkFlowBenchApplicationWorkbenchAdvisor()); + QScopedPointer wbAdvisor(new QmitkFlowApplicationWorkbenchAdvisor()); int code = berry::PlatformUI::CreateAndRunWorkbench(display.data(), wbAdvisor.data()); // exit the application with an appropriate return code return code == berry::PlatformUI::RETURN_RESTART ? EXIT_RESTART : EXIT_OK; } -void QmitkFlowBenchApplication::Stop() +void QmitkFlowApplication::Stop() { } diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplication.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.h similarity index 73% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplication.h rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.h index 0de302c314..eee3062ef8 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplication.h +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.h @@ -1,36 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef QMITKFLOWBENCHAPPLICATIONLICATION_H_ -#define QMITKFLOWBENCHAPPLICATIONLICATION_H_ +#ifndef QMITKFLOWAPPLICATIONLICATION_H_ +#define QMITKFLOWAPPLICATIONLICATION_H_ #include -class QmitkFlowBenchApplication : public QObject, public berry::IApplication +class QmitkFlowApplication : public QObject, public berry::IApplication { Q_OBJECT Q_INTERFACES(berry::IApplication) public: - QmitkFlowBenchApplication(); + QmitkFlowApplication(); QVariant Start(berry::IApplicationContext* context) override; void Stop() override; }; -#endif /*QMITKFLOWBENCHAPPLICATIONLICATION_H_*/ +#endif /*QMITKFLOWAPPLICATIONLICATION_H_*/ diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationPlugin.cpp b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.cpp similarity index 85% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationPlugin.cpp rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.cpp index 2666ccb8bf..b775190eb7 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationPlugin.cpp +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.cpp @@ -1,213 +1,213 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#include "QmitkFlowBenchApplicationPlugin.h" -#include "QmitkFlowBenchApplication.h" +#include "QmitkFlowApplicationPlugin.h" +#include "QmitkFlowApplication.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include -QmitkFlowBenchApplicationPlugin* QmitkFlowBenchApplicationPlugin::inst = nullptr; +QmitkFlowApplicationPlugin* QmitkFlowApplicationPlugin::inst = nullptr; -QmitkFlowBenchApplicationPlugin::QmitkFlowBenchApplicationPlugin() +QmitkFlowApplicationPlugin::QmitkFlowApplicationPlugin() { inst = this; } -QmitkFlowBenchApplicationPlugin::~QmitkFlowBenchApplicationPlugin() +QmitkFlowApplicationPlugin::~QmitkFlowApplicationPlugin() { } -QmitkFlowBenchApplicationPlugin* QmitkFlowBenchApplicationPlugin::GetDefault() +QmitkFlowApplicationPlugin* QmitkFlowApplicationPlugin::GetDefault() { return inst; } -void QmitkFlowBenchApplicationPlugin::start(ctkPluginContext* context) +void QmitkFlowApplicationPlugin::start(ctkPluginContext* context) { berry::AbstractUICTKPlugin::start(context); this->_context = context; QtWidgetsExtRegisterClasses(); - BERRY_REGISTER_EXTENSION_CLASS(QmitkFlowBenchApplication, context); + BERRY_REGISTER_EXTENSION_CLASS(QmitkFlowApplication, context); ctkServiceReference cmRef = context->getServiceReference(); ctkConfigurationAdmin* configAdmin = nullptr; if (cmRef) { configAdmin = context->getService(cmRef); } // Use the CTK Configuration Admin service to configure the BlueBerry help system if (configAdmin) { ctkConfigurationPtr conf = configAdmin->getConfiguration("org.blueberry.services.help", QString()); ctkDictionary helpProps; - helpProps.insert("homePage", "qthelp://org.mitk.gui.qt.flowbenchapplication/bundle/index.html"); + helpProps.insert("homePage", "qthelp://org.mitk.gui.qt.flowapplication/bundle/index.html"); conf->update(helpProps); context->ungetService(cmRef); } else { MITK_WARN << "Configuration Admin service unavailable, cannot set home page url."; } if (qApp->metaObject()->indexOfSignal("messageReceived(QByteArray)") > -1) { connect(qApp, SIGNAL(messageReceived(QByteArray)), this, SLOT(handleIPCMessage(QByteArray))); } // This is a potentially long running operation. loadDataFromDisk(berry::Platform::GetApplicationArgs(), true); } -void QmitkFlowBenchApplicationPlugin::stop(ctkPluginContext* context) +void QmitkFlowApplicationPlugin::stop(ctkPluginContext* context) { Q_UNUSED(context) this->_context = nullptr; } -ctkPluginContext* QmitkFlowBenchApplicationPlugin::GetPluginContext() const +ctkPluginContext* QmitkFlowApplicationPlugin::GetPluginContext() const { return _context; } -void QmitkFlowBenchApplicationPlugin::loadDataFromDisk(const QStringList &arguments, bool globalReinit) +void QmitkFlowApplicationPlugin::loadDataFromDisk(const QStringList &arguments, bool globalReinit) { if (!arguments.empty()) { ctkServiceReference serviceRef = _context->getServiceReference(); if (serviceRef) { mitk::IDataStorageService* dataStorageService = _context->getService(serviceRef); mitk::DataStorage::Pointer dataStorage = dataStorageService->GetDefaultDataStorage()->GetDataStorage(); int argumentsAdded = 0; for (int i = 0; i < arguments.size(); ++i) { if (arguments[i].startsWith("--flow.")) { //By convention no further files are specified as soon as a flow arguments comes. break; } else if (arguments[i].right(5) == ".mitk") { mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New(); bool clearDataStorageFirst(false); mitk::ProgressBar::GetInstance()->AddStepsToDo(2); dataStorage = sceneIO->LoadScene(arguments[i].toLocal8Bit().constData(), dataStorage, clearDataStorageFirst); mitk::ProgressBar::GetInstance()->Progress(2); argumentsAdded++; } else if (arguments[i].right(15) == ".mitksceneindex") { mitk::SceneIO::Pointer sceneIO = mitk::SceneIO::New(); bool clearDataStorageFirst(false); mitk::ProgressBar::GetInstance()->AddStepsToDo(2); dataStorage = sceneIO->LoadSceneUnzipped(arguments[i].toLocal8Bit().constData(), dataStorage, clearDataStorageFirst); mitk::ProgressBar::GetInstance()->Progress(2); argumentsAdded++; } else { try { const std::string path(arguments[i].toStdString()); auto addedNodes = mitk::IOUtil::Load(path, *dataStorage); for (auto const node : *addedNodes) { node->SetIntProperty("layer", argumentsAdded); } argumentsAdded++; } catch (...) { MITK_WARN << "Failed to load command line argument: " << arguments[i].toStdString(); } } } // end for each command line argument if (argumentsAdded > 0 && globalReinit) { // calculate bounding geometry mitk::RenderingManager::GetInstance()->InitializeViews(dataStorage->ComputeBoundingGeometry3D()); } } else { MITK_ERROR << "A service reference for mitk::IDataStorageService does not exist"; } } } -void QmitkFlowBenchApplicationPlugin::handleIPCMessage(const QByteArray& msg) +void QmitkFlowApplicationPlugin::handleIPCMessage(const QByteArray& msg) { QDataStream ds(msg); QString msgType; ds >> msgType; // we only handle messages containing command line arguments if (msgType != "$cmdLineArgs") return; // activate the current workbench window berry::IWorkbenchWindow::Pointer window = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow(); QMainWindow* mainWindow = static_cast (window->GetShell()->GetControl()); mainWindow->setWindowState(mainWindow->windowState() & ~Qt::WindowMinimized); mainWindow->raise(); mainWindow->activateWindow(); // Get the preferences for the instantiation behavior berry::IPreferencesService* prefService = berry::Platform::GetPreferencesService(); berry::IPreferences::Pointer prefs = prefService->GetSystemPreferences()->Node("/General"); bool newInstanceAlways = prefs->GetBool("newInstance.always", false); bool newInstanceScene = prefs->GetBool("newInstance.scene", true); QStringList args; ds >> args; loadDataFromDisk(args, false); } \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationPlugin.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.h similarity index 68% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationPlugin.h rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.h index 7f4a8240a4..fe5ffb1712 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationPlugin.h +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.h @@ -1,61 +1,61 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef QMITKFLOWBENCHAPPLICATIONLICATIONPLUGIN_H_ -#define QMITKFLOWBENCHAPPLICATIONLICATIONPLUGIN_H_ +#ifndef QMITKFLOWAPPLICATIONLICATIONPLUGIN_H_ +#define QMITKFLOWAPPLICATIONLICATIONPLUGIN_H_ #include #include -class QmitkFlowBenchApplicationPlugin : public berry::AbstractUICTKPlugin +class QmitkFlowApplicationPlugin : public berry::AbstractUICTKPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_flowbenchapplication") + Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_flowapplication") Q_INTERFACES(ctkPluginActivator) public: - QmitkFlowBenchApplicationPlugin(); - ~QmitkFlowBenchApplicationPlugin() override; + QmitkFlowApplicationPlugin(); + ~QmitkFlowApplicationPlugin() override; - static QmitkFlowBenchApplicationPlugin* GetDefault(); + static QmitkFlowApplicationPlugin* GetDefault(); ctkPluginContext* GetPluginContext() const; void start(ctkPluginContext*) override; void stop(ctkPluginContext* context) override; QString GetQtHelpCollectionFile() const; private: void loadDataFromDisk(const QStringList& args, bool globalReinit); void startNewInstance(const QStringList& args, const QStringList &files); private Q_SLOTS: void handleIPCMessage(const QByteArray &msg); private: - static QmitkFlowBenchApplicationPlugin* inst; + static QmitkFlowApplicationPlugin* inst; ctkPluginContext* _context; }; -#endif /* QMITKFLOWBENCHAPPLICATIONLICATIONPLUGIN_H_ */ +#endif /* QMITKFLOWAPPLICATIONLICATIONPLUGIN_H_ */ diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchAdvisor.cpp b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.cpp similarity index 63% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchAdvisor.cpp rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.cpp index 8e1a6cd19c..b5ef6a0544 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchAdvisor.cpp +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.cpp @@ -1,60 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#include "QmitkFlowBenchApplicationWorkbenchAdvisor.h" -#include "internal/QmitkFlowBenchApplicationPlugin.h" +#include "QmitkFlowApplicationWorkbenchAdvisor.h" +#include "internal/QmitkFlowApplicationPlugin.h" -#include "QmitkFlowBenchApplicationWorkbenchWindowAdvisor.h" +#include "QmitkFlowApplicationWorkbenchWindowAdvisor.h" -const QString QmitkFlowBenchApplicationWorkbenchAdvisor::DEFAULT_PERSPECTIVE_ID = - "org.mitk.qt.flowbenchapplication.defaultperspective"; +const QString QmitkFlowApplicationWorkbenchAdvisor::DEFAULT_PERSPECTIVE_ID = + "org.mitk.qt.flowapplication.defaultperspective"; void -QmitkFlowBenchApplicationWorkbenchAdvisor::Initialize(berry::IWorkbenchConfigurer::Pointer configurer) +QmitkFlowApplicationWorkbenchAdvisor::Initialize(berry::IWorkbenchConfigurer::Pointer configurer) { berry::QtWorkbenchAdvisor::Initialize(configurer); configurer->SetSaveAndRestore(true); } berry::WorkbenchWindowAdvisor* -QmitkFlowBenchApplicationWorkbenchAdvisor::CreateWorkbenchWindowAdvisor( +QmitkFlowApplicationWorkbenchAdvisor::CreateWorkbenchWindowAdvisor( berry::IWorkbenchWindowConfigurer::Pointer configurer) { - QmitkFlowBenchApplicationWorkbenchWindowAdvisor* advisor = new - QmitkFlowBenchApplicationWorkbenchWindowAdvisor(this, configurer); + QmitkFlowApplicationWorkbenchWindowAdvisor* advisor = new + QmitkFlowApplicationWorkbenchWindowAdvisor(this, configurer); // Exclude the help perspective from org.blueberry.ui.qt.help from // the normal perspective list. // The perspective gets a dedicated menu entry in the help menu QList excludePerspectives; excludePerspectives.push_back("org.blueberry.perspectives.help"); advisor->SetPerspectiveExcludeList(excludePerspectives); // Exclude some views from the normal view list QList excludeViews; excludeViews.push_back("org.mitk.views.modules"); excludeViews.push_back( "org.blueberry.ui.internal.introview" ); advisor->SetViewExcludeList(excludeViews); - advisor->SetWindowIcon(":/org.mitk.gui.qt.flowbenchapp/icon.png"); + advisor->SetWindowIcon(":/org.mitk.gui.qt.flowapplication/icon.png"); return advisor; } -QString QmitkFlowBenchApplicationWorkbenchAdvisor::GetInitialWindowPerspectiveId() +QString QmitkFlowApplicationWorkbenchAdvisor::GetInitialWindowPerspectiveId() { return DEFAULT_PERSPECTIVE_ID; } diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchAdvisor.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.h similarity index 78% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchAdvisor.h rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.h index 847ed9121a..56bb9ac590 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchAdvisor.h +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.h @@ -1,37 +1,37 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef QMITKFLOWBENCHAPPLICATIONWORKBENCHADVISOR_H_ -#define QMITKFLOWBENCHAPPLICATIONWORKBENCHADVISOR_H_ +#ifndef QMITKFLOWAPPLICATIONWORKBENCHADVISOR_H_ +#define QMITKFLOWAPPLICATIONWORKBENCHADVISOR_H_ #include -class QmitkFlowBenchApplicationWorkbenchAdvisor: public berry::QtWorkbenchAdvisor +class QmitkFlowApplicationWorkbenchAdvisor: public berry::QtWorkbenchAdvisor { public: static const QString DEFAULT_PERSPECTIVE_ID; // = "org.mitk.extapp.defaultperspective" void Initialize(berry::IWorkbenchConfigurer::Pointer configurer) override; berry::WorkbenchWindowAdvisor* CreateWorkbenchWindowAdvisor( berry::IWorkbenchWindowConfigurer::Pointer configurer) override; QString GetInitialWindowPerspectiveId() override; }; -#endif /*QMITKFLOWBENCHAPPLICATIONWORKBENCHADVISOR_H_*/ +#endif /*QMITKFLOWAPPLICATIONWORKBENCHADVISOR_H_*/ diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisor.cpp b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.cpp similarity index 84% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisor.cpp rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.cpp index b968c3856c..44ba984995 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisor.cpp +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.cpp @@ -1,1149 +1,1149 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#include "QmitkFlowBenchApplicationWorkbenchWindowAdvisor.h" +#include "QmitkFlowApplicationWorkbenchWindowAdvisor.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "QmitkExtFileSaveProjectAction.h" #include #include #include #include #include #include #include #include // UGLYYY -#include "QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack.h" -#include "QmitkFlowBenchApplicationPlugin.h" +#include "QmitkFlowApplicationWorkbenchWindowAdvisorHack.h" +#include "QmitkFlowApplicationPlugin.h" #include "mitkUndoController.h" #include "mitkVerboseLimitedLinearUndo.h" #include #include #include #include #include #include -QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack* QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack = - new QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack(); +QmitkFlowApplicationWorkbenchWindowAdvisorHack* QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack = + new QmitkFlowApplicationWorkbenchWindowAdvisorHack(); -QString QmitkFlowBenchApplicationWorkbenchWindowAdvisor::QT_SETTINGS_FILENAME = "QtSettings.ini"; +QString QmitkFlowApplicationWorkbenchWindowAdvisor::QT_SETTINGS_FILENAME = "QtSettings.ini"; class PartListenerForTitle: public berry::IPartListener { public: - PartListenerForTitle(QmitkFlowBenchApplicationWorkbenchWindowAdvisor* wa) + PartListenerForTitle(QmitkFlowApplicationWorkbenchWindowAdvisor* wa) : windowAdvisor(wa) { } Events::Types GetPartEventTypes() const override { return Events::ACTIVATED | Events::BROUGHT_TO_TOP | Events::CLOSED | Events::HIDDEN | Events::VISIBLE; } void PartActivated(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref.Cast ()) { windowAdvisor->UpdateTitle(false); } } void PartBroughtToTop(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref.Cast ()) { windowAdvisor->UpdateTitle(false); } } void PartClosed(const berry::IWorkbenchPartReference::Pointer& /*ref*/) override { windowAdvisor->UpdateTitle(false); } void PartHidden(const berry::IWorkbenchPartReference::Pointer& ref) override { if (!windowAdvisor->lastActiveEditor.Expired() && ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock()) { windowAdvisor->UpdateTitle(true); } } void PartVisible(const berry::IWorkbenchPartReference::Pointer& ref) override { if (!windowAdvisor->lastActiveEditor.Expired() && ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock()) { windowAdvisor->UpdateTitle(false); } } private: - QmitkFlowBenchApplicationWorkbenchWindowAdvisor* windowAdvisor; + QmitkFlowApplicationWorkbenchWindowAdvisor* windowAdvisor; }; class PartListenerForImageNavigator: public berry::IPartListener { public: PartListenerForImageNavigator(QAction* act) : imageNavigatorAction(act) { } Events::Types GetPartEventTypes() const override { return Events::OPENED | Events::CLOSED | Events::HIDDEN | Events::VISIBLE; } void PartOpened(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(true); } } void PartClosed(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(false); } } void PartVisible(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(true); } } void PartHidden(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(false); } } private: QAction* imageNavigatorAction; }; class PerspectiveListenerForTitle: public berry::IPerspectiveListener { public: - PerspectiveListenerForTitle(QmitkFlowBenchApplicationWorkbenchWindowAdvisor* wa) + PerspectiveListenerForTitle(QmitkFlowApplicationWorkbenchWindowAdvisor* wa) : windowAdvisor(wa) , perspectivesClosed(false) { } Events::Types GetPerspectiveEventTypes() const override { return Events::ACTIVATED | Events::SAVED_AS | Events::DEACTIVATED | Events::CLOSED | Events::OPENED; } void PerspectiveActivated(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override { windowAdvisor->UpdateTitle(false); } void PerspectiveSavedAs(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*oldPerspective*/, const berry::IPerspectiveDescriptor::Pointer& /*newPerspective*/) override { windowAdvisor->UpdateTitle(false); } void PerspectiveDeactivated(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override { windowAdvisor->UpdateTitle(false); } void PerspectiveOpened(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override { if (perspectivesClosed) { QListIterator i(windowAdvisor->viewActions); while (i.hasNext()) { i.next()->setEnabled(true); } windowAdvisor->fileSaveProjectAction->setEnabled(true); windowAdvisor->undoAction->setEnabled(true); windowAdvisor->redoAction->setEnabled(true); windowAdvisor->imageNavigatorAction->setEnabled(true); windowAdvisor->resetPerspAction->setEnabled(true); } perspectivesClosed = false; } void PerspectiveClosed(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override { berry::IWorkbenchWindow::Pointer wnd = windowAdvisor->GetWindowConfigurer()->GetWindow(); bool allClosed = true; if (wnd->GetActivePage()) { QList perspectives(wnd->GetActivePage()->GetOpenPerspectives()); allClosed = perspectives.empty(); } if (allClosed) { perspectivesClosed = true; QListIterator i(windowAdvisor->viewActions); while (i.hasNext()) { i.next()->setEnabled(false); } windowAdvisor->fileSaveProjectAction->setEnabled(false); windowAdvisor->undoAction->setEnabled(false); windowAdvisor->redoAction->setEnabled(false); windowAdvisor->imageNavigatorAction->setEnabled(false); windowAdvisor->resetPerspAction->setEnabled(false); } } private: - QmitkFlowBenchApplicationWorkbenchWindowAdvisor* windowAdvisor; + QmitkFlowApplicationWorkbenchWindowAdvisor* windowAdvisor; bool perspectivesClosed; }; class PerspectiveListenerForMenu: public berry::IPerspectiveListener { public: - PerspectiveListenerForMenu(QmitkFlowBenchApplicationWorkbenchWindowAdvisor* wa) + PerspectiveListenerForMenu(QmitkFlowApplicationWorkbenchWindowAdvisor* wa) : windowAdvisor(wa) { } Events::Types GetPerspectiveEventTypes() const override { return Events::ACTIVATED | Events::DEACTIVATED; } void PerspectiveActivated(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& perspective) override { QAction* action = windowAdvisor->mapPerspIdToAction[perspective->GetId()]; if (action) { action->setChecked(true); } } void PerspectiveDeactivated(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& perspective) override { QAction* action = windowAdvisor->mapPerspIdToAction[perspective->GetId()]; if (action) { action->setChecked(false); } } private: - QmitkFlowBenchApplicationWorkbenchWindowAdvisor* windowAdvisor; + QmitkFlowApplicationWorkbenchWindowAdvisor* windowAdvisor; }; -QmitkFlowBenchApplicationWorkbenchWindowAdvisor::QmitkFlowBenchApplicationWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor, +QmitkFlowApplicationWorkbenchWindowAdvisor::QmitkFlowApplicationWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor, berry::IWorkbenchWindowConfigurer::Pointer configurer) : berry::WorkbenchWindowAdvisor(configurer) , lastInput(nullptr) , wbAdvisor(wbAdvisor) , showViewToolbar(true) , showVersionInfo(true) , showMitkVersionInfo(true) , showMemoryIndicator(true) , dropTargetListener(new QmitkDefaultDropTargetListener) { productName = QCoreApplication::applicationName(); viewExcludeList.push_back("org.mitk.views.viewnavigatorview"); } -QmitkFlowBenchApplicationWorkbenchWindowAdvisor::~QmitkFlowBenchApplicationWorkbenchWindowAdvisor() +QmitkFlowApplicationWorkbenchWindowAdvisor::~QmitkFlowApplicationWorkbenchWindowAdvisor() { } -QWidget* QmitkFlowBenchApplicationWorkbenchWindowAdvisor::CreateEmptyWindowContents(QWidget* parent) +QWidget* QmitkFlowApplicationWorkbenchWindowAdvisor::CreateEmptyWindowContents(QWidget* parent) { QWidget* parentWidget = static_cast(parent); auto label = new QLabel(parentWidget); label->setText("No perspectives are open. Open a perspective in the Window->Open Perspective menu."); label->setContentsMargins(10,10,10,10); label->setAlignment(Qt::AlignTop); label->setEnabled(false); parentWidget->layout()->addWidget(label); return label; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::ShowMemoryIndicator(bool show) +void QmitkFlowApplicationWorkbenchWindowAdvisor::ShowMemoryIndicator(bool show) { showMemoryIndicator = show; } -bool QmitkFlowBenchApplicationWorkbenchWindowAdvisor::GetShowMemoryIndicator() +bool QmitkFlowApplicationWorkbenchWindowAdvisor::GetShowMemoryIndicator() { return showMemoryIndicator; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::ShowViewToolbar(bool show) +void QmitkFlowApplicationWorkbenchWindowAdvisor::ShowViewToolbar(bool show) { showViewToolbar = show; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::ShowVersionInfo(bool show) +void QmitkFlowApplicationWorkbenchWindowAdvisor::ShowVersionInfo(bool show) { showVersionInfo = show; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::ShowMitkVersionInfo(bool show) +void QmitkFlowApplicationWorkbenchWindowAdvisor::ShowMitkVersionInfo(bool show) { showMitkVersionInfo = show; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::SetProductName(const QString& product) +void QmitkFlowApplicationWorkbenchWindowAdvisor::SetProductName(const QString& product) { productName = product; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::SetWindowIcon(const QString& wndIcon) +void QmitkFlowApplicationWorkbenchWindowAdvisor::SetWindowIcon(const QString& wndIcon) { windowIcon = wndIcon; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::PostWindowCreate() +void QmitkFlowApplicationWorkbenchWindowAdvisor::PostWindowCreate() { // very bad hack... berry::IWorkbenchWindow::Pointer window = this->GetWindowConfigurer()->GetWindow(); QMainWindow* mainWindow = qobject_cast (window->GetShell()->GetControl()); if (!windowIcon.isEmpty()) { mainWindow->setWindowIcon(QIcon(windowIcon)); } mainWindow->setContextMenuPolicy(Qt::PreventContextMenu); // Load icon theme QIcon::setThemeSearchPaths(QStringList() << QStringLiteral(":/org_mitk_icons/icons/")); QIcon::setThemeName(QStringLiteral("awesome")); // ==== Application menu ============================ QMenuBar* menuBar = mainWindow->menuBar(); menuBar->setContextMenuPolicy(Qt::PreventContextMenu); #ifdef __APPLE__ menuBar->setNativeMenuBar(true); #else menuBar->setNativeMenuBar(false); #endif auto basePath = QStringLiteral(":/org_mitk_icons/icons/awesome/scalable/actions/"); fileSaveProjectAction = new QmitkExtFileSaveProjectAction(window); fileSaveProjectAction->setIcon(berry::QtStyleManager::ThemeIcon(basePath + "document-save.svg")); auto perspGroup = new QActionGroup(menuBar); std::map VDMap; // sort elements (converting vector to map...) QList::const_iterator iter; berry::IViewRegistry* viewRegistry = berry::PlatformUI::GetWorkbench()->GetViewRegistry(); const QList viewDescriptors = viewRegistry->GetViews(); bool skip = false; for (iter = viewDescriptors.begin(); iter != viewDescriptors.end(); ++iter) { // if viewExcludeList is set, it contains the id-strings of view, which // should not appear as an menu-entry in the menu if (viewExcludeList.size() > 0) { for (int i=0; iGetId()) { skip = true; break; } } if (skip) { skip = false; continue; } } if ((*iter)->GetId() == "org.blueberry.ui.internal.introview") continue; if ((*iter)->GetId() == "org.mitk.views.imagenavigator") continue; if ((*iter)->GetId() == "org.mitk.views.viewnavigatorview") continue; std::pair p((*iter)->GetLabel(), (*iter)); VDMap.insert(p); } std::map::const_iterator MapIter; for (MapIter = VDMap.begin(); MapIter != VDMap.end(); ++MapIter) { berry::QtShowViewAction* viewAction = new berry::QtShowViewAction(window, (*MapIter).second); viewActions.push_back(viewAction); } QMenu* fileMenu = menuBar->addMenu("&File"); fileMenu->setObjectName("FileMenu"); fileMenu->addAction(fileSaveProjectAction); fileMenu->addSeparator(); QAction* fileExitAction = new QmitkFileExitAction(window); fileExitAction->setIcon(berry::QtStyleManager::ThemeIcon(basePath + "system-log-out.svg")); fileExitAction->setShortcut(QKeySequence::Quit); fileExitAction->setObjectName("QmitkFileExitAction"); fileMenu->addAction(fileExitAction); // another bad hack to get an edit/undo menu... QMenu* editMenu = menuBar->addMenu("&Edit"); undoAction = editMenu->addAction(berry::QtStyleManager::ThemeIcon(basePath + "edit-undo.svg"), "&Undo", - QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onUndo()), + QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onUndo()), QKeySequence("CTRL+Z")); undoAction->setToolTip("Undo the last action (not supported by all modules)"); redoAction = editMenu->addAction(berry::QtStyleManager::ThemeIcon(basePath + "edit-redo.svg"), "&Redo", - QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onRedo()), + QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onRedo()), QKeySequence("CTRL+Y")); redoAction->setToolTip("execute the last action that was undone again (not supported by all modules)"); // ==== Window Menu ========================== QMenu* windowMenu = menuBar->addMenu("Window"); QMenu* perspMenu = windowMenu->addMenu("&Open Perspective"); windowMenu->addSeparator(); resetPerspAction = windowMenu->addAction("&Reset Perspective", - QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onResetPerspective())); + QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onResetPerspective())); windowMenu->addSeparator(); windowMenu->addAction("&Preferences...", - QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onEditPreferences()), + QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onEditPreferences()), QKeySequence("CTRL+P")); // fill perspective menu berry::IPerspectiveRegistry* perspRegistry = window->GetWorkbench()->GetPerspectiveRegistry(); QList perspectives( perspRegistry->GetPerspectives()); skip = false; for (QList::iterator perspIt = perspectives.begin(); perspIt != perspectives.end(); ++perspIt) { // if perspectiveExcludeList is set, it contains the id-strings of perspectives, which // should not appear as an menu-entry in the perspective menu if (perspectiveExcludeList.size() > 0) { for (int i=0; iGetId()) { skip = true; break; } } if (skip) { skip = false; continue; } } QAction* perspAction = new berry::QtOpenPerspectiveAction(window, *perspIt, perspGroup); mapPerspIdToAction.insert((*perspIt)->GetId(), perspAction); } perspMenu->addActions(perspGroup->actions()); // ===== Help menu ==================================== QMenu* helpMenu = menuBar->addMenu("&Help"); helpMenu->addAction("&Welcome",this, SLOT(onIntro())); helpMenu->addAction("&Open Help Perspective", this, SLOT(onHelpOpenHelpPerspective())); helpMenu->addAction("&Context Help",this, SLOT(onHelp()), QKeySequence("F1")); helpMenu->addAction("&About",this, SLOT(onAbout())); // ===================================================== // toolbar for showing file open, undo, redo and other main actions auto mainActionsToolBar = new QToolBar; mainActionsToolBar->setObjectName("mainActionsToolBar"); mainActionsToolBar->setContextMenuPolicy(Qt::PreventContextMenu); #ifdef __APPLE__ mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextUnderIcon ); #else mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon ); #endif basePath = QStringLiteral(":/org.mitk.gui.qt.ext/"); imageNavigatorAction = new QAction(berry::QtStyleManager::ThemeIcon(basePath + "image_navigator.svg"), "&Image Navigator", nullptr); bool imageNavigatorViewFound = window->GetWorkbench()->GetViewRegistry()->Find("org.mitk.views.imagenavigator"); if (imageNavigatorViewFound) { - QObject::connect(imageNavigatorAction, SIGNAL(triggered(bool)), QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onImageNavigator())); + QObject::connect(imageNavigatorAction, SIGNAL(triggered(bool)), QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack, SLOT(onImageNavigator())); imageNavigatorAction->setCheckable(true); // add part listener for image navigator imageNavigatorPartListener.reset(new PartListenerForImageNavigator(imageNavigatorAction)); window->GetPartService()->AddPartListener(imageNavigatorPartListener.data()); berry::IViewPart::Pointer imageNavigatorView = window->GetActivePage()->FindView("org.mitk.views.imagenavigator"); imageNavigatorAction->setChecked(false); if (imageNavigatorView) { bool isImageNavigatorVisible = window->GetActivePage()->IsPartVisible(imageNavigatorView); if (isImageNavigatorVisible) imageNavigatorAction->setChecked(true); } imageNavigatorAction->setToolTip("Toggle image navigator for navigating through image"); } mainActionsToolBar->addAction(undoAction); mainActionsToolBar->addAction(redoAction); if (imageNavigatorViewFound) { mainActionsToolBar->addAction(imageNavigatorAction); } mainWindow->addToolBar(mainActionsToolBar); // ==== View Toolbar ================================== if (showViewToolbar) { auto prefService = berry::WorkbenchPlugin::GetDefault()->GetPreferencesService(); berry::IPreferences::Pointer stylePrefs = prefService->GetSystemPreferences()->Node(berry::QtPreferences::QT_STYLES_NODE); bool showCategoryNames = stylePrefs->GetBool(berry::QtPreferences::QT_SHOW_TOOLBAR_CATEGORY_NAMES, true); // Order view descriptors by category QMultiMap categoryViewDescriptorMap; for (auto labelViewDescriptorPair : VDMap) { auto viewDescriptor = labelViewDescriptorPair.second; auto category = !viewDescriptor->GetCategoryPath().isEmpty() ? viewDescriptor->GetCategoryPath().back() : QString(); categoryViewDescriptorMap.insert(category, viewDescriptor); } // Create a separate toolbar for each category for (auto category : categoryViewDescriptorMap.uniqueKeys()) { auto viewDescriptorsInCurrentCategory = categoryViewDescriptorMap.values(category); QList > relevantViewDescriptors; for (auto viewDescriptor : viewDescriptorsInCurrentCategory) { - if (viewDescriptor->GetId() != "org.mitk.views.flowbench.control") + if (viewDescriptor->GetId() != "org.mitk.views.flow.control") { relevantViewDescriptors.push_back(viewDescriptor); } } if (!relevantViewDescriptors.isEmpty()) { auto toolbar = new QToolBar; toolbar->setObjectName(category + " View Toolbar"); mainWindow->addToolBar(toolbar); if (showCategoryNames && !category.isEmpty()) { auto categoryButton = new QToolButton; categoryButton->setToolButtonStyle(Qt::ToolButtonTextOnly); categoryButton->setText(category); categoryButton->setStyleSheet("background: transparent; margin: 0; padding: 0;"); toolbar->addWidget(categoryButton); connect(categoryButton, &QToolButton::clicked, [toolbar]() { for (QWidget* widget : toolbar->findChildren()) { if (QStringLiteral("qt_toolbar_ext_button") == widget->objectName() && widget->isVisible()) { QMouseEvent pressEvent(QEvent::MouseButtonPress, QPointF(0.0f, 0.0f), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPointF(0.0f, 0.0f), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QApplication::sendEvent(widget, &pressEvent); QApplication::sendEvent(widget, &releaseEvent); } } }); } for (auto viewDescriptor : relevantViewDescriptors) { auto viewAction = new berry::QtShowViewAction(window, viewDescriptor); toolbar->addAction(viewAction); } } } } QSettings settings(GetQSettingsFile(), QSettings::IniFormat); mainWindow->restoreState(settings.value("ToolbarPosition").toByteArray()); auto qStatusBar = new QStatusBar(); //creating a QmitkStatusBar for Output on the QStatusBar and connecting it with the MainStatusBar auto statusBar = new QmitkStatusBar(qStatusBar); //disabling the SizeGrip in the lower right corner statusBar->SetSizeGripEnabled(false); auto progBar = new QmitkProgressBar(); qStatusBar->addPermanentWidget(progBar, 0); progBar->hide(); mainWindow->setStatusBar(qStatusBar); if (showMemoryIndicator) { auto memoryIndicator = new QmitkMemoryUsageIndicatorView(); qStatusBar->addPermanentWidget(memoryIndicator, 0); } } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::PreWindowOpen() +void QmitkFlowApplicationWorkbenchWindowAdvisor::PreWindowOpen() { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); this->HookTitleUpdateListeners(configurer); menuPerspectiveListener.reset(new PerspectiveListenerForMenu(this)); configurer->GetWindow()->AddPerspectiveListener(menuPerspectiveListener.data()); configurer->AddEditorAreaTransfer(QStringList("text/uri-list")); configurer->ConfigureEditorAreaDropListener(dropTargetListener.data()); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::PostWindowOpen() +void QmitkFlowApplicationWorkbenchWindowAdvisor::PostWindowOpen() { berry::WorkbenchWindowAdvisor::PostWindowOpen(); // Force Rendering Window Creation on startup. berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); - ctkPluginContext* context = QmitkFlowBenchApplicationPlugin::GetDefault()->GetPluginContext(); + ctkPluginContext* context = QmitkFlowApplicationPlugin::GetDefault()->GetPluginContext(); ctkServiceReference serviceRef = context->getServiceReference(); if (serviceRef) { mitk::IDataStorageService *dsService = context->getService(serviceRef); if (dsService) { mitk::IDataStorageReference::Pointer dsRef = dsService->GetDataStorage(); mitk::DataStorageEditorInput::Pointer dsInput(new mitk::DataStorageEditorInput(dsRef)); mitk::WorkbenchUtil::OpenEditor(configurer->GetWindow()->GetActivePage(),dsInput); } } } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::onIntro() +void QmitkFlowApplicationWorkbenchWindowAdvisor::onIntro() { - QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack->onIntro(); + QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack->onIntro(); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::onHelp() +void QmitkFlowApplicationWorkbenchWindowAdvisor::onHelp() { - QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack->onHelp(); + QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack->onHelp(); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::onHelpOpenHelpPerspective() +void QmitkFlowApplicationWorkbenchWindowAdvisor::onHelpOpenHelpPerspective() { - QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack->onHelpOpenHelpPerspective(); + QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack->onHelpOpenHelpPerspective(); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::onAbout() +void QmitkFlowApplicationWorkbenchWindowAdvisor::onAbout() { - QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::undohack->onAbout(); + QmitkFlowApplicationWorkbenchWindowAdvisorHack::undohack->onAbout(); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::HookTitleUpdateListeners(berry::IWorkbenchWindowConfigurer::Pointer configurer) +void QmitkFlowApplicationWorkbenchWindowAdvisor::HookTitleUpdateListeners(berry::IWorkbenchWindowConfigurer::Pointer configurer) { // hook up the listeners to update the window title titlePartListener.reset(new PartListenerForTitle(this)); titlePerspectiveListener.reset(new PerspectiveListenerForTitle(this)); editorPropertyListener.reset(new berry::PropertyChangeIntAdapter< - QmitkFlowBenchApplicationWorkbenchWindowAdvisor>(this, - &QmitkFlowBenchApplicationWorkbenchWindowAdvisor::PropertyChange)); + QmitkFlowApplicationWorkbenchWindowAdvisor>(this, + &QmitkFlowApplicationWorkbenchWindowAdvisor::PropertyChange)); configurer->GetWindow()->AddPerspectiveListener(titlePerspectiveListener.data()); configurer->GetWindow()->GetPartService()->AddPartListener(titlePartListener.data()); } -QString QmitkFlowBenchApplicationWorkbenchWindowAdvisor::ComputeTitle() +QString QmitkFlowApplicationWorkbenchWindowAdvisor::ComputeTitle() { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); berry::IWorkbenchPage::Pointer currentPage = configurer->GetWindow()->GetActivePage(); berry::IEditorPart::Pointer activeEditor; if (currentPage) { activeEditor = lastActiveEditor.Lock(); } QString title; berry::IProduct::Pointer product = berry::Platform::GetProduct(); if (product.IsNotNull()) { title = product->GetName(); } if (title.isEmpty()) { // instead of the product name, we use a custom variable for now title = productName; } if(showMitkVersionInfo) { QString mitkVersionInfo = MITK_REVISION_DESC; if(mitkVersionInfo.isEmpty()) mitkVersionInfo = MITK_VERSION_STRING; title += " " + mitkVersionInfo; } if (showVersionInfo) { // add version informatioin QString versions = QString(" (ITK %1.%2.%3 | VTK %4.%5.%6 | Qt %7)") .arg(ITK_VERSION_MAJOR).arg(ITK_VERSION_MINOR).arg(ITK_VERSION_PATCH) .arg(VTK_MAJOR_VERSION).arg(VTK_MINOR_VERSION).arg(VTK_BUILD_VERSION) .arg(QT_VERSION_STR); title += versions; } if (currentPage) { if (activeEditor) { lastEditorTitle = activeEditor->GetTitleToolTip(); if (!lastEditorTitle.isEmpty()) title = lastEditorTitle + " - " + title; } berry::IPerspectiveDescriptor::Pointer persp = currentPage->GetPerspective(); QString label = ""; if (persp) { label = persp->GetLabel(); } berry::IAdaptable* input = currentPage->GetInput(); if (input && input != wbAdvisor->GetDefaultPageInput()) { label = currentPage->GetLabel(); } if (!label.isEmpty()) { title = label + " - " + title; } } title += " (Not for use in diagnosis or treatment of patients)"; return title; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::RecomputeTitle() +void QmitkFlowApplicationWorkbenchWindowAdvisor::RecomputeTitle() { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); QString oldTitle = configurer->GetTitle(); QString newTitle = ComputeTitle(); if (newTitle != oldTitle) { configurer->SetTitle(newTitle); } } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::UpdateTitle(bool editorHidden) +void QmitkFlowApplicationWorkbenchWindowAdvisor::UpdateTitle(bool editorHidden) { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); berry::IWorkbenchWindow::Pointer window = configurer->GetWindow(); berry::IEditorPart::Pointer activeEditor; berry::IWorkbenchPage::Pointer currentPage = window->GetActivePage(); berry::IPerspectiveDescriptor::Pointer persp; berry::IAdaptable* input = nullptr; if (currentPage) { activeEditor = currentPage->GetActiveEditor(); persp = currentPage->GetPerspective(); input = currentPage->GetInput(); } if (editorHidden) { activeEditor = nullptr; } // Nothing to do if the editor hasn't changed if (activeEditor == lastActiveEditor.Lock() && currentPage == lastActivePage.Lock() && persp == lastPerspective.Lock() && input == lastInput) { return; } if (!lastActiveEditor.Expired()) { lastActiveEditor.Lock()->RemovePropertyListener(editorPropertyListener.data()); } lastActiveEditor = activeEditor; lastActivePage = currentPage; lastPerspective = persp; lastInput = input; if (activeEditor) { activeEditor->AddPropertyListener(editorPropertyListener.data()); } RecomputeTitle(); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::PropertyChange(const berry::Object::Pointer& /*source*/, int propId) +void QmitkFlowApplicationWorkbenchWindowAdvisor::PropertyChange(const berry::Object::Pointer& /*source*/, int propId) { if (propId == berry::IWorkbenchPartConstants::PROP_TITLE) { if (!lastActiveEditor.Expired()) { QString newTitle = lastActiveEditor.Lock()->GetPartName(); if (lastEditorTitle != newTitle) { RecomputeTitle(); } } } } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::SetPerspectiveExcludeList(const QList& v) +void QmitkFlowApplicationWorkbenchWindowAdvisor::SetPerspectiveExcludeList(const QList& v) { this->perspectiveExcludeList = v; } -QList QmitkFlowBenchApplicationWorkbenchWindowAdvisor::GetPerspectiveExcludeList() +QList QmitkFlowApplicationWorkbenchWindowAdvisor::GetPerspectiveExcludeList() { return this->perspectiveExcludeList; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::SetViewExcludeList(const QList& v) +void QmitkFlowApplicationWorkbenchWindowAdvisor::SetViewExcludeList(const QList& v) { this->viewExcludeList = v; } -QList QmitkFlowBenchApplicationWorkbenchWindowAdvisor::GetViewExcludeList() +QList QmitkFlowApplicationWorkbenchWindowAdvisor::GetViewExcludeList() { return this->viewExcludeList; } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisor::PostWindowClose() +void QmitkFlowApplicationWorkbenchWindowAdvisor::PostWindowClose() { berry::IWorkbenchWindow::Pointer window = this->GetWindowConfigurer()->GetWindow(); QMainWindow* mainWindow = static_cast (window->GetShell()->GetControl()); QSettings settings(GetQSettingsFile(), QSettings::IniFormat); settings.setValue("ToolbarPosition", mainWindow->saveState()); } -QString QmitkFlowBenchApplicationWorkbenchWindowAdvisor::GetQSettingsFile() const +QString QmitkFlowApplicationWorkbenchWindowAdvisor::GetQSettingsFile() const { - QFileInfo settingsInfo = QmitkFlowBenchApplicationPlugin::GetDefault()->GetPluginContext()->getDataFile(QT_SETTINGS_FILENAME); + QFileInfo settingsInfo = QmitkFlowApplicationPlugin::GetDefault()->GetPluginContext()->getDataFile(QT_SETTINGS_FILENAME); return settingsInfo.canonicalFilePath(); } //-------------------------------------------------------------------------------- // Ugly hack from here on. Feel free to delete when command framework // and undo buttons are done. //-------------------------------------------------------------------------------- -QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack() +QmitkFlowApplicationWorkbenchWindowAdvisorHack::QmitkFlowApplicationWorkbenchWindowAdvisorHack() : QObject() { } -QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::~QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack() +QmitkFlowApplicationWorkbenchWindowAdvisorHack::~QmitkFlowApplicationWorkbenchWindowAdvisorHack() { } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onUndo() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onUndo() { mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel(); if (model) { if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast(model)) { mitk::VerboseLimitedLinearUndo::StackDescription descriptions = verboseundo->GetUndoDescriptions(); if (descriptions.size() >= 1) { MITK_INFO << "Undo " << descriptions.front().second; } } model->Undo(); } else { MITK_ERROR << "No undo model instantiated"; } } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onRedo() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onRedo() { mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel(); if (model) { if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast(model)) { mitk::VerboseLimitedLinearUndo::StackDescription descriptions = verboseundo->GetRedoDescriptions(); if (descriptions.size() >= 1) { MITK_INFO << "Redo " << descriptions.front().second; } } model->Redo(); } else { MITK_ERROR << "No undo model instantiated"; } } // safe calls to the complete chain // berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->FindView("org.mitk.views.imagenavigator"); // to cover for all possible cases of closed pages etc. static void SafeHandleNavigatorView(QString view_query_name) { berry::IWorkbench* wbench = berry::PlatformUI::GetWorkbench(); if (wbench == nullptr) return; berry::IWorkbenchWindow::Pointer wbench_window = wbench->GetActiveWorkbenchWindow(); if (wbench_window.IsNull()) return; berry::IWorkbenchPage::Pointer wbench_page = wbench_window->GetActivePage(); if (wbench_page.IsNull()) return; auto wbench_view = wbench_page->FindView(view_query_name); if (wbench_view.IsNotNull()) { bool isViewVisible = wbench_page->IsPartVisible(wbench_view); if (isViewVisible) { wbench_page->HideView(wbench_view); return; } } wbench_page->ShowView(view_query_name); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onImageNavigator() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onImageNavigator() { // show/hide ImageNavigatorView SafeHandleNavigatorView("org.mitk.views.imagenavigator"); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onEditPreferences() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onEditPreferences() { QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow()); _PreferencesDialog.exec(); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onQuit() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onQuit() { berry::PlatformUI::GetWorkbench()->Close(); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onResetPerspective() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onResetPerspective() { berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective(); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onClosePerspective() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onClosePerspective() { berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage(); page->ClosePerspective(page->GetPerspective(), true, true); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onIntro() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onIntro() { bool hasIntro = berry::PlatformUI::GetWorkbench()->GetIntroManager()->HasIntro(); if (!hasIntro) { QRegExp reg("(.*)(\\n)*"); QRegExp reg2("(\\n)*(.*)"); QFile file(":/org.mitk.gui.qt.ext/index.html"); file.open(QIODevice::ReadOnly | QIODevice::Text); //text file only for reading QString text = QString(file.readAll()); file.close(); QString title = text; title.replace(reg, ""); title.replace(reg2, ""); std::cout << title.toStdString() << std::endl; QMessageBox::information(nullptr, title, text, "Close"); } else { berry::PlatformUI::GetWorkbench()->GetIntroManager()->ShowIntro( berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow(), false); } } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onHelp() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onHelp() { - ctkPluginContext* context = QmitkFlowBenchApplicationPlugin::GetDefault()->GetPluginContext(); + ctkPluginContext* context = QmitkFlowApplicationPlugin::GetDefault()->GetPluginContext(); if (context == nullptr) { MITK_WARN << "Plugin context not set, unable to open context help"; return; } // Check if the org.blueberry.ui.qt.help plug-in is installed and started QList > plugins = context->getPlugins(); foreach(QSharedPointer p, plugins) { if (p->getSymbolicName() == "org.blueberry.ui.qt.help") { if (p->getState() != ctkPlugin::ACTIVE) { // try to activate the plug-in explicitly try { p->start(ctkPlugin::START_TRANSIENT); } catch (const ctkPluginException& pe) { MITK_ERROR << "Activating org.blueberry.ui.qt.help failed: " << pe.what(); return; } } } } ctkServiceReference eventAdminRef = context->getServiceReference(); ctkEventAdmin* eventAdmin = nullptr; if (eventAdminRef) { eventAdmin = context->getService(eventAdminRef); } if (eventAdmin == nullptr) { MITK_WARN << "ctkEventAdmin service not found. Unable to open context help"; } else { ctkEvent ev("org/blueberry/ui/help/CONTEXTHELP_REQUESTED"); eventAdmin->postEvent(ev); } } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onHelpOpenHelpPerspective() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onHelpOpenHelpPerspective() { berry::PlatformUI::GetWorkbench()->ShowPerspective("org.blueberry.perspectives.help", berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()); } -void QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack::onAbout() +void QmitkFlowApplicationWorkbenchWindowAdvisorHack::onAbout() { auto aboutDialog = new QmitkAboutDialog(QApplication::activeWindow(), nullptr); aboutDialog->open(); } diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisor.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.h similarity index 86% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisor.h rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.h index 5a771970e1..1591426222 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisor.h +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.h @@ -1,156 +1,156 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef QMITKFLOWBENCHAPPLICATIONWORKBENCHWINDOWADVISOR_H_ -#define QMITKFLOWBENCHAPPLICATIONWORKBENCHWINDOWADVISOR_H_ +#ifndef QMITKFLOWAPPLICATIONWORKBENCHWINDOWADVISOR_H_ +#define QMITKFLOWAPPLICATIONWORKBENCHWINDOWADVISOR_H_ #include #include #include #include #include #include -#include +#include #include class QAction; class QMenu; -class MITK_QT_FLOW_BENCH_APP_EXPORT QmitkFlowBenchApplicationWorkbenchWindowAdvisor : public QObject, public berry::WorkbenchWindowAdvisor +class MITK_QT_FLOW_BENCH_APP_EXPORT QmitkFlowApplicationWorkbenchWindowAdvisor : public QObject, public berry::WorkbenchWindowAdvisor { Q_OBJECT public: - QmitkFlowBenchApplicationWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor, + QmitkFlowApplicationWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor, berry::IWorkbenchWindowConfigurer::Pointer configurer); - ~QmitkFlowBenchApplicationWorkbenchWindowAdvisor() override; + ~QmitkFlowApplicationWorkbenchWindowAdvisor() override; QWidget* CreateEmptyWindowContents(QWidget* parent) override; void PostWindowCreate() override; void PreWindowOpen() override; void PostWindowOpen() override; void PostWindowClose() override; void ShowViewToolbar(bool show); void ShowVersionInfo(bool show); void ShowMitkVersionInfo(bool show); void ShowMemoryIndicator(bool show); bool GetShowMemoryIndicator(); //TODO should be removed when product support is here void SetProductName(const QString& product); void SetWindowIcon(const QString& wndIcon); void SetPerspectiveExcludeList(const QList &v); QList GetPerspectiveExcludeList(); void SetViewExcludeList(const QList &v); QList GetViewExcludeList(); protected slots: virtual void onIntro(); virtual void onHelp(); virtual void onHelpOpenHelpPerspective(); virtual void onAbout(); private: /** * Hooks the listeners needed on the window * * @param configurer */ void HookTitleUpdateListeners(berry::IWorkbenchWindowConfigurer::Pointer configurer); QString ComputeTitle(); void RecomputeTitle(); QString GetQSettingsFile() const; /** * Updates the window title. Format will be: [pageInput -] * [currentPerspective -] [editorInput -] [workspaceLocation -] productName * @param editorHidden TODO */ void UpdateTitle(bool editorHidden); void PropertyChange(const berry::Object::Pointer& /*source*/, int propId); static QString QT_SETTINGS_FILENAME; QScopedPointer titlePartListener; QScopedPointer titlePerspectiveListener; QScopedPointer menuPerspectiveListener; QScopedPointer imageNavigatorPartListener; QScopedPointer editorPropertyListener; - friend struct berry::PropertyChangeIntAdapter; + friend struct berry::PropertyChangeIntAdapter; friend class PartListenerForTitle; friend class PerspectiveListenerForTitle; friend class PerspectiveListenerForMenu; friend class PartListenerForImageNavigator; friend class PartListenerForViewNavigator; berry::IEditorPart::WeakPtr lastActiveEditor; berry::IPerspectiveDescriptor::WeakPtr lastPerspective; berry::IWorkbenchPage::WeakPtr lastActivePage; QString lastEditorTitle; berry::IAdaptable* lastInput; berry::WorkbenchAdvisor* wbAdvisor; bool showViewToolbar; bool showVersionInfo; bool showMitkVersionInfo; bool showMemoryIndicator; QString productName; QString windowIcon; // enables DnD on the editor area QScopedPointer dropTargetListener; // stringlist for excluding perspectives from the perspective menu entry (e.g. Welcome Perspective) QList perspectiveExcludeList; // stringlist for excluding views from the menu entry QList viewExcludeList; // maps perspective ids to QAction objects QHash mapPerspIdToAction; // actions which will be enabled/disabled depending on the application state QList viewActions; QAction* fileSaveProjectAction; QAction* undoAction; QAction* redoAction; QAction* imageNavigatorAction; QAction* resetPerspAction; }; -#endif /*QMITKFLOWBENCHAPPLICATIONWORKBENCHWINDOWADVISOR_H_*/ +#endif /*QMITKFLOWAPPLICATIONWORKBENCHWINDOWADVISOR_H_*/ diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h similarity index 82% rename from Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack.h rename to Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h index c13d3096c3..3cd0d48862 100644 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/src/internal/QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack.h +++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h @@ -1,58 +1,58 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include class ctkPluginContext; class QmitkPreferencesDialog; /** This class is a "hack" due to the currently missing command framework. It is a direct clone of QmitkExtWorkbenchWindowAdvisorHack.*/ -class QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack : public QObject +class QmitkFlowApplicationWorkbenchWindowAdvisorHack : public QObject { Q_OBJECT public slots: void onUndo(); void onRedo(); void onImageNavigator(); void onEditPreferences(); void onQuit(); void onResetPerspective(); void onClosePerspective(); void onIntro(); /** * @brief This slot is called if the user klicks the menu item "help->context help" or presses F1. * The help page is shown in a workbench editor. */ void onHelp(); void onHelpOpenHelpPerspective(); /** * @brief This slot is called if the user clicks in help menu the about button */ void onAbout(); public: - QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack(); - ~QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack() override; + QmitkFlowApplicationWorkbenchWindowAdvisorHack(); + ~QmitkFlowApplicationWorkbenchWindowAdvisorHack() override; - static QmitkFlowBenchApplicationWorkbenchWindowAdvisorHack* undohack; + static QmitkFlowApplicationWorkbenchWindowAdvisorHack* undohack; }; diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/CMakeLists.txt b/Plugins/org.mitk.gui.qt.flowbench.segmentation/CMakeLists.txt deleted file mode 100644 index 38c753aa33..0000000000 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -project(org_mitk_gui_qt_flowbench_segmentation) - -mitk_create_plugin( - EXPORT_DIRECTIVE MITK_GUI_QT_FLOWBENCH_SEGMENTATION_EXPORT - EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgets MitkMultilabel -) diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/Manual.dox deleted file mode 100644 index c02863a2a6..0000000000 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/Manual.dox +++ /dev/null @@ -1,85 +0,0 @@ -/** -\page org_mitk_gui_qt_matchpoint_mapper The MatchPoint Image Mapper View - -\imageMacro{map_mapper_icon_doc.svg, "Icon of the MatchPoint Image Mapper",3} - -\tableofcontents - -\section MAP_MAPPER_Introduction Introduction -This view offers the possibility to map any image or point set in the data manager using a user selected registration object. -Using the Mapper to map images the user can control the field of view (image geometry) the image should be mapped into, as well as -interpolation strategy that should be used.\n -It is one of several MatchPoint registration plugins.\n -Typical usage scenarios\n -\li You have registered image I1 onto image I2. Now you want to transfer the segmentation of I1 to I2 in order to evaluate I2 within this mapped segmentation using \ref org_mitk_views_imagestatistics . -\li You have registered image I1 onto image I2. Now you want to map I3 (e.g. an other MRI sequence of the same session) also onto I2 with the same registration. -\li You have registered image I1 onto image I2. Now you want to map a segmentation done on I1 also onto I2 with the same registration. -\li You have registered image I1 onto image I2. Now you want to map a point set of image I1 also onto I2 with the same registration. - -\section MAP_MAPPER_Contact Contact information -This plug-in is being developed by the SIDT group (Software development for Integrated Diagnostics -and Therapy) at the DKFZ (German Cancer Research Center). If you have any questions, need support, -find a bug or have a feature request, feel free to contact us at www.mitk.org. - -\section MAP_MAPPER_Usage Usage -\imageMacro{map_mapper-examplescreen.png, "Example screenshot showing the Mapper plugin in use.", 14} -To use the mapper at least an input data (image or point set) must be selected. Additionally you may select a registration object and a reference image. -Registration objects are marked with a small blue icon (e.g. the data "Registration" in the data manager of the screen shot above). -The Reference image defines the geometry (field of view, orientation, spacing) that should be used for the result image. -By default the view will try to automatically determine the reference image (by default it is the target image of the selected registration). -If auto selection cannot determine the reference it will choose the input image as reference. -The reference image can be also defined by the user explicitly by activating manual selection.\n -REMARK: If you map point sets you can ignore the reference image slot. It has no affect.\n -You can multi select registration and data (press the CTRL-key while selecting the nodes in the data manager). -The Mapper will automatically sort the selections in the correct "slots" of the view.\n -REMARK: The mapping results will be added as child nodes to the used input node.\n -REMARK: If you do not select an registration the view will assume that you make an identity transform. This is a convenient way if you -just want to resample an image into the geometry of an other image (when no registration is needed). Also in this use case you can take -advantage of the different interpolation and sub/super sampling strategies. - -\imageMacro{map_mapper.png, "Details of the mapper view.", 8} -(1) The currently selected registration, that will be used for mapping.\n -(2) The currently selected input data, that will be mapped.\n -(3) The currently (automatically or by user) selected reference image, that defines the geometry of the result.\n -(4) The name of the result data in the data manger.\n -(5) The start button(s) to commence the mapping process. For details regarding the two options see \ref MAP_MAPPER_Refine.\n -(6) Log windows with messages regarding the mapping process.\n\n - -Every "slot" has the ability to be locked. If locked the last selection will be kept, regardless the current selection in the data manager. -You can use this for example to lock the registration, if you want to map multiple images. Doing so it is enough to just select the next image -in the data manager. To lock a slot, click at the "lock" button at the right side (see example images below). -\imageMacro{map_node-unlocked.png, "Unlocked slot/node (default state). Changes with the selections in the data manager.",6} -\imageMacro{map_node-locked.png, "Locked slot/node. Stays, regardless the selections in the data manager.",6} - -\section MAP_MAPPER_Refine Mapping or geometry refinement -The mapper view offers two options to map images:\n -\li "Map" (default) -\li "Refine geometry" -For images "Map" fills the pixels of the output image by interpolating input image pixels using the registration object. This option always works. -But may take longer and introduces interpolation errors, because a new image is resampled.\n -The second option "Refine geometry" is only offered, if the registration (more precise its inverse kernel) is matrix based and the selected data is an image. -In this case it just clones the image and refines its image geometry (origin and orientation) to project it to the position indicated by the registration; thus no interpolation artefacts are introduced. -\remark If you want to use a mapped image in conjunction with the statistic plugin and an mask of the reference image (or you want to proceed any other computation that expects the voxel to be in the same grid for direct numeric comparison), you must use "Map" to ensure the same geometry -(including the same image grid; including same spacing and resolution). Otherwise operations like the statistic plugin will fail. - -\section MAP_MAPPER_Settings Settings -If you map the image (and not just refine the geometry), you have several settings available:\n -\li "Allow undefined pixels": Activate to handle pixels of the result image that are not in the field of view of the input image. This pixel will get the "padding value". -\li "Allow error pixels": Activate to handle pixels of the result image that can not be mapped because the registration does not support this part of the output image. This pixel will get the "error value". -\li "Interpolator": Set to choose the interpolation strategy that should be used for mapping. -\li "Activate super/sub sampling": Activate if you want to use origin and orientation of the reference image but want to alter the spacing. - -\section MAP_MAPPER_Interpolation Interpolation -You can choose from the following interpolation strategies:\n -\li "nearest neighbor": Use the value of the nearest pixel. Fastest, but high interpolation errors for gray value images. Right choice for label images or masks. -\li "Linear": Fast linear interpolation with often sufficient quality. Tends to blur edges. -\li "BSpline (3rd order)": Good trade off between time and quality. -\li "Windowed Sinc (Hamming)": Good interpolation quality but very time consuming. -\li "Windowed Sinc (Welch)": Good interpolation quality but very time consuming. - -\section MAP_MAPPER_Masks Handling of masks/segmentations -If you select an mask as input image, the plugin will be automatically reconfigured to settings that are suitable for the task of mapping masks. -Most importantly the interpolator will be set to "nearest neighbor". - -*/ - diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper-examplescreen.png b/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper-examplescreen.png deleted file mode 100644 index 438d48fc90..0000000000 Binary files a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper-examplescreen.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper-settings.png b/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper-settings.png deleted file mode 100644 index fb7ba5f47b..0000000000 Binary files a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper-settings.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper.png b/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper.png deleted file mode 100644 index 2ddec78f8f..0000000000 Binary files a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper_icon_doc.svg b/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper_icon_doc.svg deleted file mode 100644 index bcd39e5e84..0000000000 --- a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_mapper_icon_doc.svg +++ /dev/null @@ -1,204 +0,0 @@ - - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_node-locked.png b/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_node-locked.png deleted file mode 100644 index abc66c27c4..0000000000 Binary files a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_node-locked.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_node-unlocked.png b/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_node-unlocked.png deleted file mode 100644 index 4ec502eec3..0000000000 Binary files a/Plugins/org.mitk.gui.qt.flowbench.segmentation/documentation/UserManual/map_node-unlocked.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.flowbenchapplication/resources/QmitkFlowBenchApplication.qrc b/Plugins/org.mitk.gui.qt.flowbenchapplication/resources/QmitkFlowBenchApplication.qrc deleted file mode 100644 index 14b93f0a84..0000000000 --- a/Plugins/org.mitk.gui.qt.flowbenchapplication/resources/QmitkFlowBenchApplication.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - icon.png - -