diff --git a/Modules/ExampleModule/CMakeLists.txt b/Modules/ExampleModule/CMakeLists.txt index 2beaf48..53de37d 100644 --- a/Modules/ExampleModule/CMakeLists.txt +++ b/Modules/ExampleModule/CMakeLists.txt @@ -1,6 +1,6 @@ mitk_create_module(ExampleModule - DEPENDS PUBLIC MitkSegmentation + DEPENDS PUBLIC MitkSegmentationUI PACKAGE_DEPENDS PRIVATE GuidelinesSupportLibrary ) add_subdirectory(cmdapps) diff --git a/Modules/ExampleModule/files.cmake b/Modules/ExampleModule/files.cmake index 374810f..ee1e7c0 100644 --- a/Modules/ExampleModule/files.cmake +++ b/Modules/ExampleModule/files.cmake @@ -1,12 +1,21 @@ set(CPP_FILES ExampleImageFilter.cpp ExampleImageInteractor.cpp ExampleModule.cpp ExampleSegTool2D.cpp + ExampleSegTool2DGUI.cpp +) + +set(UI_FILES + src/ExampleSegTool2DGUI.ui +) + +set(MOC_H_FILES + include/ExampleSegTool2DGUI.h ) set(RESOURCE_FILES Interactions/Paint.xml Interactions/PaintConfig.xml ExampleIcon.svg ) diff --git a/Modules/ExampleModule/include/ExampleSegTool2D.h b/Modules/ExampleModule/include/ExampleSegTool2D.h index 445dfa5..e69c355 100644 --- a/Modules/ExampleModule/include/ExampleSegTool2D.h +++ b/Modules/ExampleModule/include/ExampleSegTool2D.h @@ -1,47 +1,48 @@ /*=================================================================== 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 ExampleSegTool2D_h #define ExampleSegTool2D_h #include #include namespace us { class ModuleResource; } class MITKEXAMPLEMODULE_EXPORT ExampleSegTool2D : public mitk::SegTool2D { public: mitkClassMacro(ExampleSegTool2D, SegTool2D) itkFactorylessNewMacro(Self) us::ModuleResource GetIconResource() const override; const char *GetName() const override; const char **GetXPM() const override; - virtual void Paint(mitk::StateMachineAction* action, mitk::InteractionEvent* event); - protected: ExampleSegTool2D(); ~ExampleSegTool2D() override; + virtual void Paint(mitk::StateMachineAction* action, mitk::InteractionEvent* event); + +private: void ConnectActionsAndFunctions() override; }; #endif diff --git a/Modules/ExampleModule/include/ExampleSegTool2D.h b/Modules/ExampleModule/include/ExampleSegTool2DGUI.h similarity index 52% copy from Modules/ExampleModule/include/ExampleSegTool2D.h copy to Modules/ExampleModule/include/ExampleSegTool2DGUI.h index 445dfa5..0b90fff 100644 --- a/Modules/ExampleModule/include/ExampleSegTool2D.h +++ b/Modules/ExampleModule/include/ExampleSegTool2DGUI.h @@ -1,47 +1,45 @@ /*=================================================================== 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 ExampleSegTool2D_h -#define ExampleSegTool2D_h +#ifndef ExampleSegTool2DGUI_h +#define ExampleSegTool2DGUI_h -#include +#include +#include #include -namespace us +namespace Ui { - class ModuleResource; + class ExampleSegTool2DGUI; } -class MITKEXAMPLEMODULE_EXPORT ExampleSegTool2D : public mitk::SegTool2D +class MITKEXAMPLEMODULE_EXPORT ExampleSegTool2DGUI : public QmitkToolGUI { + Q_OBJECT + public: - mitkClassMacro(ExampleSegTool2D, SegTool2D) + mitkClassMacro(ExampleSegTool2DGUI, QmitkToolGUI) itkFactorylessNewMacro(Self) - us::ModuleResource GetIconResource() const override; - const char *GetName() const override; - const char **GetXPM() const override; - - virtual void Paint(mitk::StateMachineAction* action, mitk::InteractionEvent* event); - protected: - ExampleSegTool2D(); - ~ExampleSegTool2D() override; + ExampleSegTool2DGUI(); + ~ExampleSegTool2DGUI() override; - void ConnectActionsAndFunctions() override; +private: + QScopedPointer m_Ui; }; #endif diff --git a/Modules/ExampleModule/src/ExampleSegTool2DGUI.cpp b/Modules/ExampleModule/src/ExampleSegTool2DGUI.cpp new file mode 100644 index 0000000..2b9940a --- /dev/null +++ b/Modules/ExampleModule/src/ExampleSegTool2DGUI.cpp @@ -0,0 +1,30 @@ +/*=================================================================== + +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 + +MITK_TOOL_GUI_MACRO(MITKEXAMPLEMODULE_EXPORT, ExampleSegTool2DGUI, "") + +ExampleSegTool2DGUI::ExampleSegTool2DGUI() + : m_Ui(new Ui::ExampleSegTool2DGUI) +{ + m_Ui->setupUi(this); +} + +ExampleSegTool2DGUI::~ExampleSegTool2DGUI() +{ +} diff --git a/Modules/ExampleModule/src/ExampleSegTool2DGUI.ui b/Modules/ExampleModule/src/ExampleSegTool2DGUI.ui new file mode 100644 index 0000000..d592169 --- /dev/null +++ b/Modules/ExampleModule/src/ExampleSegTool2DGUI.ui @@ -0,0 +1,34 @@ + + + ExampleSegTool2DGUI + + + + 0 + 0 + 320 + 240 + + + + + 0 + 0 + + + + + + + CTRL-click in image to produce log output. + + + true + + + + + + + +