diff --git a/Modules/Bundles/CMakeLists.txt b/Modules/Bundles/CMakeLists.txt index 76d09566f0..1a2eb6b147 100644 --- a/Modules/Bundles/CMakeLists.txt +++ b/Modules/Bundles/CMakeLists.txt @@ -1,51 +1,53 @@ IF(MITK_USE_BLUEBERRY) SET(MITK_DEFAULT_SUBPROJECTS MITK-Plugins) SET(_mitk_bundles_default ) IF(QT4_FOUND) LIST(APPEND _mitk_bundles_default "org.mitk.gui.qt.imagenavigator") # BlueBerry depends on CTK which depends on Qt, so we # need the Qt include direcotries INCLUDE(${QT_USE_FILE}) ENDIF() SET(PLUGIN_EXCLUDE_LIST org.mitk.core.ext org.mitk.gui.qt.volumetry org.mitk.core.jobs org.mitk.diffusionimaging org.mitk.gui.qt.diffusionimaging org.mitk.gui.qt.ext org.mitk.gui.qt.extapplication org.mitk.gui.qt.datamanager org.mitk.gui.qt.regiongrowing org.mitk.gui.qt.segmentation org.mitk.planarfigure org.mitk.gui.qt.igtnavigationtoolmanager org.mitk.gui.qt.igttrackingtoolbox org.mitk.gui.qt.igttoolpairnavigation org.mitk.gui.qt.basicimageprocessing org.mitk.gui.qt.colourimageprocessing org.mitk.gui.qt.navigationdataplayer org.mitk.gui.qt.tofutil org.mitk.gui.qt.imagenavigator org.mitk.gui.qt.moviemaker + org.mitk.gui.qt.deformableregistration + org.mitk.gui.qt.rigidregistration ) MACRO_COLLECT_PLUGINS(OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ExtBundles CACHE_PLUGIN_SOURCE_DIRS MITK_MODULES_PLUGIN_SOURCE_DIRS CACHE_PLUGIN_OUTPUT_DIRS MITK_MODULES_PLUGIN_OUTPUT_DIRS CACHE_PLUGIN_TARGETS MITK_MODULES_ENABLED_PLUGINS BUNDLE_LIST_PATH "${MITK_BINARY_DIR}/Bundles/MITKModulesBundleList.cmake" CMAKE_CACHE_PREFIX "MITK" PLUGIN_DEFAULT_ON ${_mitk_bundles_default} PLUGIN_EXCLUDES ${PLUGIN_EXCLUDE_LIST} ${MITK_BUILD_ALL_PLUGINS_OPTION}) ENDIF(MITK_USE_BLUEBERRY) diff --git a/Modules/Bundles/PluginList.cmake b/Modules/Bundles/PluginList.cmake index 26ba4061d0..6ac1c79c8e 100644 --- a/Modules/Bundles/PluginList.cmake +++ b/Modules/Bundles/PluginList.cmake @@ -1,21 +1,23 @@ SET(MITK_EXT_PLUGINS org.mitk.core.ext:ON org.mitk.core.jobs:OFF org.mitk.diffusionimaging:OFF org.mitk.gui.qt.diffusionimaging:OFF org.mitk.gui.qt.ext:ON org.mitk.gui.qt.extapplication:ON org.mitk.gui.qt.segmentation:OFF org.mitk.planarfigure:ON org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.igtnavigationtoolmanager:OFF org.mitk.gui.qt.igttoolpairnavigation:ON org.mitk.gui.qt.igttrackingtoolbox:OFF org.mitk.gui.qt.regiongrowing:OFF org.mitk.gui.qt.navigationdataplayer:ON org.mitk.gui.qt.basicimageprocessing:OFF org.mitk.gui.qt.colourimageprocessing:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.imagenavigator:ON org.mitk.gui.qt.moviemaker:ON + org.mitk.gui.qt.deformableregistration:ON + org.mitk.gui.qt.rigidregistration:ON ) diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/CMakeLists.txt b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/CMakeLists.txt index 1402e30ae6..775e09cc70 100644 --- a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/CMakeLists.txt +++ b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/CMakeLists.txt @@ -1,2 +1,6 @@ +PROJECT(org_mitk_gui_qt_deformableregistration) -MACRO_CREATE_MITK_PLUGIN(QmitkExt MitkDeformableRegistration MitkDeformableRegistrationUI) +MACRO_CREATE_MITK_CTK_PLUGIN( + EXPORT_DIRECTIVE DEFORMABLEREGISTRATION_EXPORT + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDENCIES QmitkExt MitkDeformableRegistration MitkDeformableRegistrationUI) diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/META-INF/MANIFEST.MF b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/META-INF/MANIFEST.MF deleted file mode 100644 index 87c038ea21..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Name: Deformable Registration -Bundle-SymbolicName: org.mitk.gui.qt.deformableregistration -Bundle-Version: 0.1 -Bundle-Vendor: DKFZ, Medical and Biological Informatics -Require-Bundle: org.mitk.gui.qt.common -Bundle-Activator: diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/files.cmake b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/files.cmake index 02acd6278a..7891b767b6 100644 --- a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/files.cmake @@ -1,38 +1,40 @@ SET(SRC_CPP_FILES - + QmitkDeformableRegistrationView.cpp ) -SET(INTERNAL_CPP_FILES - QmitkDeformableRegistrationView.cpp +SET(INTERNAL_CPP_FILES + mitkPluginActivator.cpp ) SET(UI_FILES src/internal/QmitkDeformableRegistrationViewControls.ui ) SET(MOC_H_FILES - src/internal/QmitkDeformableRegistrationView.h + src/QmitkDeformableRegistrationView.h + src/internal/mitkPluginActivator.h ) -SET(RESOURCE_FILES +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 resources/DeformableRegistration.xpm + plugin.xml ) -SET(RES_FILES +SET(QRC_FILES resources/QmitkDeformableRegistrationView.qrc ) -SET(CPP_FILES manifest.cpp) +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/Modules/Bundles/org.mitk.gui.qt.deformableregistration/manifest.cpp b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/manifest.cpp deleted file mode 100644 index 8f8c630222..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/manifest.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision: 16719 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#include - -#include -#include "src/internal/QmitkDeformableRegistrationView.h" - - -POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart) - POCO_EXPORT_CLASS(::QmitkDeformableRegistrationView) -POCO_END_MANIFEST diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/manifest_headers.cmake b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/manifest_headers.cmake new file mode 100644 index 0000000000..894c0ef0fc --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "Deformable registration") +set(Plugin-Version "1.0") +set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") +set(Plugin-ContactAddress "www.mitk.org") +set(Require-Plugin org.mitk.gui.qt.common) diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/plugin.xml index cd7c88d1bb..22ad7c5f5a 100644 --- a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/plugin.xml @@ -1,11 +1,11 @@ diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/DeformableregistrationDll.h b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/DeformableregistrationDll.h deleted file mode 100644 index be82c712d6..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/DeformableregistrationDll.h +++ /dev/null @@ -1,43 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision: 16719 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef _DEFORMABLEREGISTRATION_EXPORT_DLL_H_ -#define _DEFORMABLEREGISTRATION_EXPORT_DLL_H_ - - -// -// The following block is the standard way of creating macros which make exporting -// from a DLL simpler. All files within this DLL are compiled with the org_mitk_gui_qt_deformableregistration_EXPORTS -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see -// org_mitk_gui_qt_deformableregistration_EXPORTS functions as being imported from a DLL, wheras this DLL sees symbols -// defined with this macro as being exported. -// -#if defined(_WIN32) && !defined(MITK_STATIC) - #if defined(org_mitk_gui_qt_deformableregistration_EXPORTS) - #define DEFORMABLEREGISTRATION_EXPORT __declspec(dllexport) - #else - #define DEFORMABLEREGISTRATION_EXPORT __declspec(dllimport) - #endif -#endif - - -#if !defined(DEFORMABLEREGISTRATION_EXPORT) - #define DEFORMABLEREGISTRATION_EXPORT -#endif - -#endif /*_DEFORMABLEREGISTRATION_EXPORT_DLL_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationView.cpp b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/QmitkDeformableRegistrationView.cpp similarity index 100% rename from Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationView.cpp rename to Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/QmitkDeformableRegistrationView.cpp diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationView.h b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/QmitkDeformableRegistrationView.h similarity index 95% rename from Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationView.h rename to Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/QmitkDeformableRegistrationView.h index bb4205cc72..4c4ede2acc 100644 --- a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/QmitkDeformableRegistrationView.h @@ -1,207 +1,214 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QMITKDEFORMABLEREGISTRATION_H #define QMITKDEFORMABLEREGISTRATION_H #include "QmitkFunctionality.h" #include "ui_QmitkDeformableRegistrationViewControls.h" -#include "../DeformableregistrationDll.h" +#include #include "berryISelectionListener.h" #include "berryIStructuredSelection.h" /*! \brief The DeformableRegistration functionality is used to perform deformable registration. This functionality allows you to register two 2D as well as two 3D images in a non rigid manner. Register means to align two images, so that they become as similar as possible. Therefore you can select from different deformable registration methods. Registration results will directly be applied to the Moving Image. The result is shown in the multi-widget. For more informations see: \ref QmitkDeformableRegistrationUserManual \sa QmitkFunctionality \ingroup Functionalities \ingroup DeformableRegistration */ class DEFORMABLEREGISTRATION_EXPORT QmitkDeformableRegistrationView : public QmitkFunctionality { friend struct SelListenerDeformableRegistration; Q_OBJECT public: static const std::string VIEW_ID; /*! \brief default constructor */ QmitkDeformableRegistrationView(QObject *parent=0, const char *name=0); + QmitkDeformableRegistrationView(const QmitkDeformableRegistrationView& other) + { + Q_UNUSED(other) + throw std::runtime_error("Copy constructor not implemented"); + } + + /*! \brief default destructor */ virtual ~QmitkDeformableRegistrationView(); /*! \brief method for creating the applications main widget */ virtual void CreateQtPartControl(QWidget *parent); /*! \brief Sets the StdMultiWidget and connects it to the functionality. */ virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); /*! \brief Removes the StdMultiWidget and disconnects it from the functionality. */ virtual void StdMultiWidgetNotAvailable(); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Method which is called when this functionality is selected in MITK */ virtual void Activated(); /*! \brief Method which is called whenever the functionality is deselected in MITK */ virtual void Deactivated(); virtual void Visible(); virtual void Hidden(); void DataNodeHasBeenRemoved(const mitk::DataNode* node); signals: /*! \brief Signal that informs about that the fixed image should be reinitialized in the multi-widget. */ void reinitFixed(const mitk::Geometry3D *); /*! \brief Signal that informs about that the moving image should be reinitialized in the multi-widget. */ void reinitMoving(const mitk::Geometry3D *); /*! \brief Signal that informs about that the BSpline registration should be performed. */ void calculateBSplineRegistration(); protected slots: /*! * sets the fixed Image according to TreeNodeSelector widget */ void FixedSelected(mitk::DataNode::Pointer fixedImage); /*! * sets the moving Image according to TreeNodeSelector widget */ void MovingSelected(mitk::DataNode::Pointer movingImage); /*! * checks if registration is possible */ bool CheckCalculate(); /*! * stores whether the image will be shown in grayvalues or in red for fixed image and green for moving image * @param show if true, then images will be shown in red and green */ void ShowRedGreen(bool show); /*! * set the selected opacity for moving image * @param opacity the selected opacity */ void OpacityUpdate(float opacity); /*! \brief Sets the selected opacity for moving image @param opacity the selected opacity */ void OpacityUpdate(int opacity); /*! * sets the images to grayvalues or fixed image to red and moving image to green * @param redGreen if true, then images will be shown in red and green */ void SetImageColor(bool redGreen); /*! \brief Checks whether the registration can be performed. */ void CheckCalculateEnabled(); /*! \brief Performs the registration. */ void Calculate(); /*! * Prints the values of the deformationfield */ void ApplyDeformationField(); void SetImagesVisible(berry::ISelection::ConstPointer selection); void TabChanged(int index); void SwitchImages(); protected: berry::ISelectionListener::Pointer m_SelListener; berry::IStructuredSelection::ConstPointer m_CurrentSelection; /*! * default main widget containing 4 windows showing 3 * orthogonal slices of the volume and a 3d render window */ QmitkStdMultiWidget * m_MultiWidget; /*! * control widget to make all changes for Deformable registration */ Ui::QmitkDeformableRegistrationViewControls m_Controls; mitk::DataNode::Pointer m_MovingNode; mitk::DataNode::Pointer m_FixedNode; bool m_ShowRedGreen; float m_Opacity; float m_OriginalOpacity; mitk::Color m_FixedColor; mitk::Color m_MovingColor; bool m_Deactivated; }; #endif //QMITKDEFORMABLEREGISTRATION_H diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/mitkPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/mitkPluginActivator.cpp new file mode 100644 index 0000000000..06b9dff97b --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/mitkPluginActivator.cpp @@ -0,0 +1,21 @@ +#include "mitkPluginActivator.h" + +#include + +#include "../QmitkDeformableRegistrationView.h" + +namespace mitk { + +void PluginActivator::start(ctkPluginContext* context) +{ + BERRY_REGISTER_EXTENSION_CLASS(QmitkDeformableRegistrationView, context) +} + +void PluginActivator::stop(ctkPluginContext* context) +{ + Q_UNUSED(context) +} + +} + +Q_EXPORT_PLUGIN2(org_mitk_gui_qt_deformableregistration, mitk::PluginActivator) diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/mitkPluginActivator.h b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/mitkPluginActivator.h new file mode 100644 index 0000000000..a34be34be4 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/mitkPluginActivator.h @@ -0,0 +1,23 @@ +#ifndef MITKPLUGINACTIVATOR_H +#define MITKPLUGINACTIVATOR_H + +#include + +namespace mitk { + +class PluginActivator : + public QObject, public ctkPluginActivator +{ + Q_OBJECT + Q_INTERFACES(ctkPluginActivator) + +public: + + void start(ctkPluginContext* context); + void stop(ctkPluginContext* context); + +}; // PluginActivator + +} + +#endif // MITKPLUGINACTIVATOR_H diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/CMakeLists.txt b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/CMakeLists.txt index 2ec78f2773..2d858775ed 100644 --- a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/CMakeLists.txt +++ b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/CMakeLists.txt @@ -1,2 +1,8 @@ +PROJECT(org_mitk_gui_qt_rigidregistration) + +MACRO_CREATE_MITK_CTK_PLUGIN( + EXPORT_DIRECTIVE RIGIDREGISTRATION_EXPORT + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDENCIES QmitkExt MitkRigidRegistration MitkRigidRegistrationUI +) -MACRO_CREATE_MITK_PLUGIN(QmitkExt MitkRigidRegistration MitkRigidRegistrationUI) diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/META-INF/MANIFEST.MF b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/META-INF/MANIFEST.MF deleted file mode 100644 index a1f0bf0d70..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Name: Rigid Registration -Bundle-SymbolicName: org.mitk.gui.qt.rigidregistration -Bundle-Version: 0.1 -Bundle-Vendor: DKFZ, Medical and Biological Informatics -Require-Bundle: org.mitk.gui.qt.common -Bundle-Activator: diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/files.cmake b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/files.cmake index 5cce971cb0..b06c3462c2 100644 --- a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/files.cmake @@ -1,43 +1,46 @@ SET(SRC_CPP_FILES ) SET(INTERNAL_CPP_FILES QmitkRigidRegistrationView.cpp QmitkLoadPresetDialog.cpp QmitkRigidRegistrationSelectorView.cpp + mitkPluginActivator.cpp ) SET(UI_FILES src/internal/QmitkRigidRegistrationViewControls.ui src/internal/QmitkRigidRegistrationSelector.ui ) SET(MOC_H_FILES src/internal/QmitkRigidRegistrationView.h src/internal/QmitkLoadPresetDialog.h src/internal/QmitkRigidRegistrationSelectorView.h + src/internal/mitkPluginActivator.h ) -SET(RESOURCE_FILES +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 resources/RigidRegistration.xpm + plugin.xml ) -SET(RES_FILES +SET(QRC_FILES resources/QmitkRigidRegistrationView.qrc ) -SET(CPP_FILES manifest.cpp) +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/Modules/Bundles/org.mitk.gui.qt.rigidregistration/manifest.cpp b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/manifest.cpp deleted file mode 100644 index 262dc513fe..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/manifest.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision: 16719 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#include - -#include -#include "src/internal/QmitkRigidRegistrationView.h" - - -POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart) - POCO_EXPORT_CLASS(::QmitkRigidRegistrationView) -POCO_END_MANIFEST diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/manifest_headers.cmake b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/manifest_headers.cmake new file mode 100644 index 0000000000..6104af4255 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "Rigid Registration") +set(Plugin-Version "1.0") +set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") +set(Plugin-ContactAddress "http://www.mitk.org") +set(Require-Plugin org.mitk.gui.qt.common) diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/plugin.xml index 8fd0f613d5..a699d3b7bf 100644 --- a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/plugin.xml @@ -1,11 +1,11 @@ diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/RigidregistrationDll.h b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/RigidregistrationDll.h deleted file mode 100644 index ac4904200a..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/RigidregistrationDll.h +++ /dev/null @@ -1,43 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision: 16719 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef _RIGIDREGISTRATION_EXPORT_DLL_H_ -#define _RIGIDREGISTRATION_EXPORT_DLL_H_ - - -// -// The following block is the standard way of creating macros which make exporting -// from a DLL simpler. All files within this DLL are compiled with the org_mitk_gui_qt_rigidregistration_EXPORTS -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see -// org_mitk_gui_qt_rigidregistration_EXPORTS functions as being imported from a DLL, wheras this DLL sees symbols -// defined with this macro as being exported. -// -#if defined(_WIN32) && !defined(MITK_STATIC) - #if defined(org_mitk_gui_qt_rigidregistration_EXPORTS) - #define RIGIDREGISTRATION_EXPORT __declspec(dllexport) - #else - #define RIGIDREGISTRATION_EXPORT __declspec(dllimport) - #endif -#endif - - -#if !defined(RIGIDREGISTRATION_EXPORT) - #define RIGIDREGISTRATION_EXPORT -#endif - -#endif /*_RIGIDREGISTRATION_EXPORT_DLL_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationSelectorView.h b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationSelectorView.h index 51339cb39a..8ea01d9f96 100644 --- a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationSelectorView.h +++ b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationSelectorView.h @@ -1,111 +1,111 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 1.12 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QmitkRigidRegistrationSelectorViewWidgetHIncluded #define QmitkRigidRegistrationSelectorViewWidgetHIncluded #include "mitkDataNode.h" #include "mitkDataStorage.h" #include "ui_QmitkRigidRegistrationSelector.h" #include "qobject.h" -#include "../RigidregistrationDll.h" +#include #include "QmitkRigidRegistrationTransformsGUIBase.h" #include "QmitkRigidRegistrationMetricsGUIBase.h" #include "QmitkRigidRegistrationOptimizerGUIBase.h" /*! * \brief Widget for rigid registration * * Displays options for rigid registration. */ class RIGIDREGISTRATION_EXPORT QmitkRigidRegistrationSelectorView : public QWidget { Q_OBJECT public: QmitkRigidRegistrationSelectorView( QWidget* parent = 0, Qt::WindowFlags f = 0 ); ~QmitkRigidRegistrationSelectorView(); signals: void TransformChanged(); void OptimizerChanged(double value); void AddNewTransformationToUndoList(); public slots: void SetFixedNode( mitk::DataNode * fixedNode ); void SetFixedMaskNode(mitk::DataNode * fixedMaskNode ); void SetFixedDimension( int dimension ); void SetMovingNode( mitk::DataNode * movingNode ); void SetMovingNodeChildren(mitk::DataStorage::SetOfObjects::ConstPointer children); void SetMovingMaskNode(mitk::DataNode * movingMaskNode ); void SetMovingDimension(int dimension ); int GetSelectedTransform(); void CalculateTransformation(unsigned int timestep = 0); void StopOptimization(bool stopOptimization); protected slots: // this is a callback function that retrieves the current transformation // parameters after every step of progress in the optimizer. // depending on the choosen transformation, we construct a vtktransform // that will be applied to the geometry of the moving image. // the values are delivered by mitkRigidRgistrationObserver.cpp void SetOptimizerValue( const itk::EventObject & ); /// this method is called whenever the combobox with the selectable transforms changes /// responsible for showing the selected transformparameters void TransformSelected( int transform ); /// this method is called whenever the combobox with the selectable metrics changes /// responsible for showing the selected metricparameters void MetricSelected( int metric ); /// this method is called whenever the combobox with the selectable optimizer changes /// responsible for showing the selected optimizerparameters void OptimizerSelected( int optimizer ); void LoadRigidRegistrationParameter(); void SaveRigidRegistrationParameter(); //void LoadRigidRegistrationTestParameter(); //void SaveRigidRegistrationTestParameter(); void DoLoadRigidRegistrationParameter(); void DoLoadRigidRegistrationPreset(std::string presetName); void DoSaveRigidRegistrationParameter(); void AddTransform(QmitkRigidRegistrationTransformsGUIBase* transform); void AddMetric(QmitkRigidRegistrationMetricsGUIBase* metric); void AddOptimizer(QmitkRigidRegistrationOptimizerGUIBase* optimizer); protected: Ui::QmitkRigidRegistrationSelector m_Controls; mitk::DataNode::Pointer m_FixedNode; mitk::DataNode::Pointer m_FixedMaskNode; mitk::DataNode::Pointer m_MovingNode; mitk::DataNode::Pointer m_MovingMaskNode; int m_FixedDimension; int m_MovingDimension; bool m_StopOptimization; mitk::RigidRegistrationPreset* m_Preset; mitk::Geometry3D::TransformType::Pointer m_GeometryItkPhysicalToWorldTransform; mitk::Geometry3D::TransformType::Pointer m_GeometryWorldToItkPhysicalTransform; mitk::Geometry3D* m_MovingGeometry; mitk::AffineGeometryFrame3D::Pointer m_ImageGeometry; mitk::RigidRegistrationObserver::Pointer m_Observer; mitk::DataStorage::SetOfObjects::ConstPointer m_MovingNodeChildren; std::map m_ChildNodes; std::map m_ChildNodes2; }; #endif diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationView.h b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationView.h index e3349962c5..815a8951c3 100644 --- a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationView.h @@ -1,289 +1,298 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QMITKRIGIDREGISTRATION_H #define QMITKRIGIDREGISTRATION_H #include "QmitkFunctionality.h" #include "ui_QmitkRigidRegistrationViewControls.h" #include "berryISelectionListener.h" #include "berryIStructuredSelection.h" -#include "../RigidregistrationDll.h" +#include // Time Slider related #include /*! \brief This functionality allows you to register 2D as well as 3D images in a rigid manner. Register means to align two images, so that they become as similar as possible. Therefore you can select from different transforms, metrics and optimizers. Registration results will directly be applied to the Moving Image. \sa QmitkFunctionality \ingroup Functionalities \ingroup RigidRegistration \author Daniel Stein */ class RIGIDREGISTRATION_EXPORT QmitkRigidRegistrationView : public QmitkFunctionality { friend struct SelListenerRigidRegistration; Q_OBJECT public: static const std::string VIEW_ID; /*! \brief default constructor */ QmitkRigidRegistrationView(QObject *parent=0, const char *name=0); + + QmitkRigidRegistrationView(const QmitkRigidRegistrationView& other) + { + Q_UNUSED(other) + throw std::runtime_error("Copy constructor not implemented"); + } + + + /*! \brief default destructor */ virtual ~QmitkRigidRegistrationView(); /*! \brief method for creating the applications main widget */ virtual void CreateQtPartControl(QWidget *parent); /*! \brief Sets the StdMultiWidget and connects it to the functionality. */ virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); /*! \brief Removes the StdMultiWidget and disconnects it from the functionality. */ virtual void StdMultiWidgetNotAvailable(); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Method which is called when this functionality is selected in MITK */ virtual void Activated(); /*! \brief Method which is called whenever the functionality is deselected in MITK */ virtual void Deactivated(); virtual void Visible(); virtual void Hidden(); void DataNodeHasBeenRemoved(const mitk::DataNode* node); signals: protected slots: /*! * sets the fixed Image according to TreeNodeSelector widget */ void FixedSelected(mitk::DataNode::Pointer fixedImage); /*! * sets the moving Image according to TreeNodeSelector widget */ void MovingSelected(mitk::DataNode::Pointer movingImage); /*! * checks if registration is possible */ bool CheckCalculate(); /*! * \brief Undo the last registration. */ void UndoTransformation(); /*! * \brief Redo the last registration */ void RedoTransformation(); /*! * \brief Adds a new Transformation to the undo list and enables the undo button. */ void AddNewTransformationToUndoList(); /*! * \brief Translates the moving image in x, y and z direction given by translateVector * * @param translateVector Contains the translation in x, y and z direction. */ void Translate(int* translateVector); /*! * \brief Rotates the moving image in x, y and z direction given by rotateVector * * @param rotateVector Contains the rotation around x, y and z axis. */ void Rotate(int* rotateVector); /*! * \brief Scales the moving image in x, y and z direction given by scaleVector * * @param scaleVector Contains the scaling around x, y and z axis. */ void Scale(int* scaleVector); /*! * \brief Automatically aligns the image centers. */ void AlignCenters(); /*! * \brief Stores whether the image will be shown in gray values or in red for fixed image and green for moving image * @param show if true, then images will be shown in red and green */ void ShowRedGreen(bool show); /*! * \brief Changes the visibility of the manual registration methods accordingly to the checkbox "Manual Registration" in GUI * @param show if true, then manual registration methods will be shown */ void ShowManualRegistrationFrame(bool show); /*! * \brief Sets the selected opacity for moving image * @param opacity the selected opacity */ void OpacityUpdate(float opacity); /*! \brief Sets the selected opacity for moving image @param opacity the selected opacity */ void OpacityUpdate(int opacity); /*! * \brief Sets the images to grayvalues or fixed image to red and moving image to green * @param redGreen if true, then images will be shown in red and green */ void SetImageColor(bool redGreen); /*! * \brief Clears the undo and redo lists and sets the undo and redo buttons to disabled. */ void ClearTransformationLists(); void SetUndoEnabled( bool enable ); void SetRedoEnabled( bool enable ); void CheckCalculateEnabled(); void xTrans_valueChanged( int v ); void yTrans_valueChanged( int v ); void zTrans_valueChanged( int v ); void xRot_valueChanged( int v ); void yRot_valueChanged( int v ); void zRot_valueChanged( int v ); void xScale_valueChanged( int v ); void yScale_valueChanged( int v ); void zScale_valueChanged( int v ); void MovingImageChanged(); /*! * \brief Starts the registration process. */ void Calculate(); void SetOptimizerValue( double value ); void StopOptimizationClicked(); void UpdateTimestep(); void SetImagesVisible(berry::ISelection::ConstPointer /*selection*/); void CheckForMaskImages(); void UseFixedMaskImageChecked(bool checked); void UseMovingMaskImageChecked(bool checked); void TabChanged(int index); void SwitchImages(); protected: berry::ISelectionListener::Pointer m_SelListener; berry::IStructuredSelection::ConstPointer m_CurrentSelection; /*! * default main widget containing 4 windows showing 3 * orthogonal slices of the volume and a 3d render window */ QmitkStdMultiWidget * m_MultiWidget; /*! * control widget to make all changes for Deformable registration */ Ui::QmitkRigidRegistrationViewControls m_Controls; mitk::DataNode::Pointer m_MovingNode; mitk::DataNode::Pointer m_MovingMaskNode; mitk::DataNode::Pointer m_FixedNode; mitk::DataNode::Pointer m_FixedMaskNode; std::list m_UndoGeometryList; std::list > m_UndoChildGeometryList; std::list m_RedoGeometryList; std::list > m_RedoChildGeometryList; bool m_ShowRedGreen; float m_Opacity; float m_OriginalOpacity; bool m_Deactivated; int m_FixedDimension; int m_MovingDimension; int * translationParams; int * rotationParams; int * scalingParams; mitk::Color m_FixedColor; mitk::Color m_MovingColor; int m_TranslateSliderPos[3]; int m_RotateSliderPos[3]; int m_ScaleSliderPos[3]; QmitkStepperAdapter* m_TimeStepperAdapter; }; #endif //QMITKRigidREGISTRATION_H diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/mitkPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/mitkPluginActivator.cpp new file mode 100644 index 0000000000..f9f180b856 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/mitkPluginActivator.cpp @@ -0,0 +1,21 @@ +#include "mitkPluginActivator.h" + +#include "QmitkRigidRegistrationView.h" + +#include + +namespace mitk { + +void PluginActivator::start(ctkPluginContext* context) +{ + BERRY_REGISTER_EXTENSION_CLASS(QmitkRigidRegistrationView, context) +} + +void PluginActivator::stop(ctkPluginContext* context) +{ + Q_UNUSED(context) +} + +} + +Q_EXPORT_PLUGIN2(org_mitk_gui_qt_rigidregistration, mitk::PluginActivator) diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/mitkPluginActivator.h b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/mitkPluginActivator.h new file mode 100644 index 0000000000..a34be34be4 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/mitkPluginActivator.h @@ -0,0 +1,23 @@ +#ifndef MITKPLUGINACTIVATOR_H +#define MITKPLUGINACTIVATOR_H + +#include + +namespace mitk { + +class PluginActivator : + public QObject, public ctkPluginActivator +{ + Q_OBJECT + Q_INTERFACES(ctkPluginActivator) + +public: + + void start(ctkPluginContext* context); + void stop(ctkPluginContext* context); + +}; // PluginActivator + +} + +#endif // MITKPLUGINACTIVATOR_H