diff --git a/Modules/Bundles/CMakeLists.txt b/Modules/Bundles/CMakeLists.txt index 63153010db..b9d1a403ae 100644 --- a/Modules/Bundles/CMakeLists.txt +++ b/Modules/Bundles/CMakeLists.txt @@ -1,62 +1,63 @@ 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.igttutorial 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.toftutorial org.mitk.gui.qt.imagenavigator org.mitk.gui.qt.moviemaker org.mitk.gui.qt.deformableregistration org.mitk.gui.qt.rigidregistration org.mitk.gui.qt.imagestatistics org.mitk.gui.qt.materialeditor org.mitk.gui.qt.simpleexample org.mitk.gui.qt.ugvisualization org.mitk.gui.qt.measurement org.mitk.gui.qt.simplemeasurement org.mitk.gui.qt.imagecropper + org.mitk.gui.qt.pointbasedregistration ) 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 f7d26759c2..3c691be31a 100644 --- a/Modules/Bundles/PluginList.cmake +++ b/Modules/Bundles/PluginList.cmake @@ -1,33 +1,38 @@ SET(MITK_EXT_PLUGINS org.mitk.core.ext:ON org.mitk.core.jobs:OFF org.mitk.planarfigure:ON org.mitk.diffusionimaging:OFF org.mitk.gui.qt.ext:ON org.mitk.gui.qt.extapplication:ON org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.segmentation:OFF org.mitk.gui.qt.diffusionimaging:OFF org.mitk.gui.qt.igtnavigationtoolmanager:OFF org.mitk.gui.qt.igttoolpairnavigation:OFF org.mitk.gui.qt.igttrackingtoolbox:OFF org.mitk.gui.qt.regiongrowing:OFF org.mitk.gui.qt.navigationdataplayer:OFF org.mitk.gui.qt.basicimageprocessing:OFF org.mitk.gui.qt.igttutorial:OFF org.mitk.gui.qt.colourimageprocessing:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.toftutorial:OFF org.mitk.gui.qt.imagenavigator:OFF org.mitk.gui.qt.moviemaker:OFF org.mitk.gui.qt.deformableregistration:OFF org.mitk.gui.qt.rigidregistration:OFF org.mitk.gui.qt.imagestatistics:OFF org.mitk.gui.qt.volumetry:OFF org.mitk.gui.qt.materialeditor:OFF org.mitk.gui.qt.simpleexample:OFF org.mitk.gui.qt.ugvisualization:OFF org.mitk.gui.qt.measurement:OFF org.mitk.gui.qt.simplemeasurement:OFF org.mitk.gui.qt.imagecropper: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 + org.mitk.gui.qt.pointbasedregistration:ON ) diff --git a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/CMakeLists.txt b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/CMakeLists.txt index fba82a3726..a7244040a5 100644 --- a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/CMakeLists.txt +++ b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/CMakeLists.txt @@ -1,2 +1,10 @@ +# The project name must correspond to the directory name of your plug-in +# and must not contain periods. +PROJECT(org_mitk_gui_qt_pointbasedregistration) + +MACRO_CREATE_MITK_CTK_PLUGIN( + EXPORT_DIRECTIVE POINTBASEDREGISTRATION_EXPORT + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDENCIES QmitkExt +) -MACRO_CREATE_MITK_PLUGIN(QmitkExt) diff --git a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/META-INF/MANIFEST.MF b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/META-INF/MANIFEST.MF deleted file mode 100644 index f89391a2b0..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Name: Point Based Registration -Bundle-SymbolicName: org.mitk.gui.qt.pointbasedregistration -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.pointbasedregistration/files.cmake b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/files.cmake index 5577487a57..af916bdefd 100644 --- a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/files.cmake @@ -1,40 +1,45 @@ SET(SRC_CPP_FILES ) SET(INTERNAL_CPP_FILES QmitkPointBasedRegistrationView.cpp QmitkPointBasedRegistrationTesting.cpp mitkLandmarkWarping.cpp + mitkPluginActivator.cpp ) SET(UI_FILES src/internal/QmitkPointBasedRegistrationViewControls.ui ) SET(MOC_H_FILES src/internal/QmitkPointBasedRegistrationView.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/PointBasedRegistration.xpm + plugin.xml ) -SET(RES_FILES +SET(QRC_FILES resources/QmitkPointBasedRegistrationView.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.pointbasedregistration/manifest.cpp b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/manifest.cpp deleted file mode 100644 index d8c306c9f5..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/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/QmitkPointBasedRegistrationView.h" - - -POCO_BEGIN_NAMED_MANIFEST(berryIViewPart, berry::IViewPart) - POCO_EXPORT_CLASS(::QmitkPointBasedRegistrationView) -POCO_END_MANIFEST diff --git a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/manifest_headers.cmake b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/manifest_headers.cmake new file mode 100644 index 0000000000..d55a35ea63 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "Point Based 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.pointbasedregistration/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/plugin.xml index caf6ed81db..1f5ccddff7 100644 --- a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/plugin.xml @@ -1,11 +1,11 @@ diff --git a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/PointbasedregistrationDll.h b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/PointbasedregistrationDll.h deleted file mode 100644 index ac3f3c5bfd..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/PointbasedregistrationDll.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 _POINTBASEDREGISTRATION_EXPORT_DLL_H_ -#define _POINTBASEDREGISTRATION_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_pointbasedregistration_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_pointbasedregistration_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_pointbasedregistration_EXPORTS) - #define POINTBASEDREGISTRATION_EXPORT __declspec(dllexport) - #else - #define POINTBASEDREGISTRATION_EXPORT __declspec(dllimport) - #endif -#endif - - -#if !defined(POINTBASEDREGISTRATION_EXPORT) - #define POINTBASEDREGISTRATION_EXPORT -#endif - -#endif /*_POINTBASEDREGISTRATION_EXPORT_DLL_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationView.h b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationView.h index a3fb81d40c..42cb945653 100644 --- a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationView.h @@ -1,298 +1,305 @@ /*========================================================================= 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. =========================================================================*/ #if !defined(QMITK_POINTBASEDREGISTRATION_H__INCLUDED) #define QMITK_POINTBASEDREGISTRATION_H__INCLUDED #include "QmitkFunctionality.h" #include "berryISelectionListener.h" #include "berryIStructuredSelection.h" //#include "mitkTestingConfig.h" // IMPORTANT: this defines or undefines BUILD_TESTING ! #include #include #include #include #include #include //#include "QmitkMessageBoxHelper.h" #include "ui_QmitkPointBasedRegistrationViewControls.h" -#include "../PointbasedregistrationDll.h" +#include /*! \brief The PointBasedRegistration functionality is used to perform point based registration. This functionality allows you to register 2D as well as 3D images in a rigid and deformable manner via corresponding PointSets. Register means to align two images, so that they become as similar as possible. Therefore you have to set corresponding points in both images, which will be matched. The movement, which has to be performed on the points to align them will be performed on the moving image as well. The result is shown in the multi-widget. For more informations see: \ref QmitkPointBasedRegistrationUserManual \sa QmitkFunctionality \ingroup Functionalities \ingroup PointBasedRegistration */ class POINTBASEDREGISTRATION_EXPORT QmitkPointBasedRegistrationView : public QmitkFunctionality { friend struct SelListenerPointBasedRegistration; Q_OBJECT public: static const std::string VIEW_ID; /*! \brief Default constructor */ QmitkPointBasedRegistrationView(QObject *parent=0, const char *name=0); + QmitkPointBasedRegistrationView(const QmitkPointBasedRegistrationView& other) + { + Q_UNUSED(other) + throw std::runtime_error("Copy constructor not implemented"); + } + + /*! \brief Default destructor */ virtual ~QmitkPointBasedRegistrationView(); /*! \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(); virtual void Activated(); virtual void Deactivated(); virtual void Visible(); virtual void Hidden(); // // #ifdef BUILD_TESTING // / ** // \brief Testing entry point // * / // virtual int TestYourself(); // // / ** // \brief Helper method for testing // * / // bool TestAllTools(); // // // protected slots: // /** // \brief Helper method for testing // */ // void RegistrationErrorDialogFound( QWidget* widget ); // // /** // \brief Helper method for testing // */ // void ClearPointSetDialogFound( QWidget* widget ); // // private: // bool m_MessageBox; // // // public: // #else // // slot function is needed, because moc ignores our #ifdefs // void RegistrationErrorDialogFound( QWidget* widget ) {} // // slot function is needed, because moc ignores our #ifdefs // void ClearPointSetDialogFound(QWidget* widget){} // #endif void DataNodeHasBeenRemoved(const mitk::DataNode* node); protected slots: /*! \brief Sets the fixed Image according to TreeNodeSelector widget */ void FixedSelected(mitk::DataNode::Pointer fixedImage); /*! \brief Sets the moving Image according to TreeNodeSelector widget */ void MovingSelected(mitk::DataNode::Pointer movingImage); /*! \brief Calculates registration with vtkLandmarkTransform */ void calculateLandmarkbased(); /*! \brief Calculates registration with itkLandmarkWarping */ void calculateLandmarkWarping(); /*! \brief Calculates registration with ICP and vtkLandmarkTransform */ void calculateLandmarkbasedWithICP(); /*! \brief lets the fixed image become invisible and the moving image visible */ void HideMovingImage(bool hide); /*! \brief lets the moving image become invisible and the fixed image visible */ void HideFixedImage(bool hide); /*! \brief Checks if registration is possible */ bool CheckCalculate(); /*! \brief Performs an undo for the last transform. */ void UndoTransformation(); /*! \brief Performs a redo for the last undo transform. */ void RedoTransformation(); /*! \brief 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); /*! \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 Updates the moving landmarks */ void updateMovingLandmarksList(); /*! \brief Updates the fixed landmarks */ void updateFixedLandmarksList(); /*! \brief Sets the images to gray values 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 transformation lists. */ void clearTransformationLists(); /*! \brief Calculates the landmark error for the selected transformation. */ void checkLandmarkError(); /*! \brief Changes the transformation type and calls checkLandmarkError(). */ void transformationChanged(int transform); /*! \brief Checks whether the registration can be performed. */ bool checkCalculateEnabled(); /*! \brief Performs the registration. */ void calculate(); void SetImagesVisible(berry::ISelection::ConstPointer /*selection*/); 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 point based registration */ Ui::QmitkPointBasedRegistrationControls m_Controls; mitk::PointSet::Pointer m_FixedLandmarks; mitk::PointSet::Pointer m_MovingLandmarks; mitk::DataNode::Pointer m_MovingPointSetNode; mitk::DataNode::Pointer m_FixedPointSetNode; mitk::DataNode::Pointer m_MovingNode; mitk::DataNode::Pointer m_FixedNode; std::list m_UndoGeometryList; std::list m_UndoPointsGeometryList; std::list m_RedoGeometryList; std::list m_RedoPointsGeometryList; bool m_ShowRedGreen; float m_Opacity; float m_OriginalOpacity; mitk::Color m_FixedColor; mitk::Color m_MovingColor; int m_Transformation; bool m_HideFixedImage; bool m_HideMovingImage; std::string m_OldFixedLabel; std::string m_OldMovingLabel; bool m_Deactivated; int m_CurrentFixedLandmarksObserverID; int m_CurrentMovingLandmarksObserverID; itk::SimpleMemberCommand::Pointer m_FixedLandmarksChangedCommand; itk::SimpleMemberCommand::Pointer m_MovingLandmarksChangedCommand; }; #endif // !defined(QMITK_POINTBASEDREGISTRATION_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/mitkPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/mitkPluginActivator.cpp new file mode 100644 index 0000000000..7639967bc8 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/mitkPluginActivator.cpp @@ -0,0 +1,22 @@ +#include "mitkPluginActivator.h" + +#include "QmitkPointBasedRegistrationView.h" + +#include + +namespace mitk { + +void PluginActivator::start(ctkPluginContext* context) +{ + BERRY_REGISTER_EXTENSION_CLASS(QmitkPointBasedRegistrationView, context) + Q_UNUSED(context) +} + +void PluginActivator::stop(ctkPluginContext* context) +{ + Q_UNUSED(context) +} + +} + +Q_EXPORT_PLUGIN2(org_mitk_gui_qt_pointbasedregistration, mitk::PluginActivator) diff --git a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/mitkPluginActivator.h b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/mitkPluginActivator.h new file mode 100644 index 0000000000..a34be34be4 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/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