diff --git a/Modules/Bundles/CMakeLists.txt b/Modules/Bundles/CMakeLists.txt index cc5d5706ea..524243e6a3 100644 --- a/Modules/Bundles/CMakeLists.txt +++ b/Modules/Bundles/CMakeLists.txt @@ -1,70 +1,71 @@ 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.dtiatlasapp org.mitk.gui.qt.diffusionimagingapp 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.igttrackinglab 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 org.mitk.gui.qt.viewinitialization org.mitk.gui.qt.volumevisualization org.mitk.gui.qt.pointsetinteraction org.mitk.gui.qt.videoplayer org.mitk.gui.qt.python.console ) 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/org.mitk.gui.qt.igttrackinglab/CMakeLists.txt b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/CMakeLists.txt index ba3dc96c99..70b668a391 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/CMakeLists.txt +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/CMakeLists.txt @@ -1,7 +1,7 @@ project(org_mitk_gui_qt_igttrackinglab) MACRO_CREATE_MITK_CTK_PLUGIN( EXPORT_DIRECTIVE IGTTRACKINGLAB_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDENCIES QmitkExt + MODULE_DEPENDENCIES QmitkExt MitkIGT MitkIGTUI ) diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/files.cmake b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/files.cmake index 6a0879962c..f03425dbf4 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/files.cmake @@ -1,43 +1,43 @@ set(SRC_CPP_FILES ) set(INTERNAL_CPP_FILES mitkPluginActivator.cpp - IGTTrackingLab.cpp + IGTTrackingLabView.cpp ) set(UI_FILES - src/internal/IGTTrackingLabControls.ui + src/internal/IGTTrackingLabViewControls.ui ) set(MOC_H_FILES src/internal/mitkPluginActivator.h - src/internal/IGTTrackingLab.h + src/internal/IGTTrackingLabView.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.xpm plugin.xml ) # 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/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/plugin.xml index 2fadf78e9c..b3f429d8bf 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/plugin.xml @@ -1,11 +1,11 @@ diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLab.cpp b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLab.cpp deleted file mode 100644 index beb112f076..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLab.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/*========================================================================= - -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. - -=========================================================================*/ - - -// Blueberry -#include -#include - -// Qmitk -#include "IGTTrackingLab.h" -#include "QmitkStdMultiWidget.h" - -// Qt -#include - - -const std::string IGTTrackingLab::VIEW_ID = "org.mitk.views.igttrackinglab"; - -IGTTrackingLab::IGTTrackingLab() -: QmitkFunctionality() -{ -} - -IGTTrackingLab::~IGTTrackingLab() -{ -} - -void IGTTrackingLab::CreateQtPartControl( QWidget *parent ) -{ - // create GUI widgets from the Qt Designer's .ui file - m_Controls.setupUi( parent ); - connect( m_Controls.buttonPerformImageProcessing, SIGNAL(clicked()), this, SLOT(DoImageProcessing()) ); -} - -void IGTTrackingLab::OnSelectionChanged( std::vector nodes ) -{ - // iterate all selected objects, adjust warning visibility - for( std::vector::iterator it = nodes.begin(); - it != nodes.end(); - ++it ) - { - mitk::DataNode::Pointer node = *it; - - if( node.IsNotNull() && dynamic_cast(node->GetData()) ) - { - m_Controls.labelWarning->setVisible( false ); - m_Controls.buttonPerformImageProcessing->setEnabled( true ); - return; - } - } - - m_Controls.labelWarning->setVisible( true ); - m_Controls.buttonPerformImageProcessing->setEnabled( false ); -} - - -void IGTTrackingLab::DoImageProcessing() -{ - std::vector nodes = this->GetDataManagerSelection(); - if (nodes.empty()) return; - - mitk::DataNode* node = nodes.front(); - - if (!node) - { - // Nothing selected. Inform the user and return - QMessageBox::information( NULL, "Template", "Please load and select an image before starting image processing."); - return; - } - - // here we have a valid mitk::DataNode - - // a node itself is not very useful, we need its data item (the image) - mitk::BaseData* data = node->GetData(); - if (data) - { - // test if this data item is an image or not (could also be a surface or something totally different) - mitk::Image* image = dynamic_cast( data ); - if (image) - { - std::stringstream message; - std::string name; - message << "Performing image processing for image "; - if (node->GetName(name)) - { - // a property called "name" was found for this DataNode - message << "'" << name << "'"; - } - message << "."; - MITK_INFO << message.str(); - - // actually do something here... - - } - } -} diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabView.cpp b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabView.cpp new file mode 100644 index 0000000000..537f37ff05 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabView.cpp @@ -0,0 +1,120 @@ +/*========================================================================= + +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. + +=========================================================================*/ + + +// Blueberry +#include +#include + +// Qmitk +#include "IGTTrackingLabView.h" +#include "QmitkStdMultiWidget.h" + +#include +#include +#include +#include + + +// Qt +#include + + +const std::string IGTTrackingLabView::VIEW_ID = "org.mitk.views.igttrackinglab"; + +IGTTrackingLabView::IGTTrackingLabView() +: QmitkFunctionality() +{ +} + +IGTTrackingLabView::~IGTTrackingLabView() +{ +} + +void IGTTrackingLabView::CreateQtPartControl( QWidget *parent ) +{ + // create GUI widgets from the Qt Designer's .ui file + m_Controls.setupUi( parent ); + + m_ToolBox = new QToolBox(parent); + m_Controls.m_VBoxLayout->addWidget(m_ToolBox); + + + this->CreateBundleWidgets( parent ); + + +} + + +void IGTTrackingLabView::CreateBundleWidgets( QWidget* parent ) +{ + // configuration widget + m_NDIConfigWidget = new QmitkNDIConfigurationWidget(parent); + m_NDIConfigWidget->SetToolTypes(QStringList () << "Instrument" << "Fiducial" << "Skinmarker" << "Unknown" ); + + m_ToolBox->addItem(m_NDIConfigWidget, "Configuration"); + + // registration widget + m_RegistrationWidget = new QmitkFiducialRegistrationWidget(parent); + m_RegistrationWidget->HideStaticRegistrationRadioButton(true); + m_RegistrationWidget->HideContinousRegistrationRadioButton(true); + m_RegistrationWidget->HideUseICPRegistrationCheckbox(true); + m_RegistrationWidget->SetQualityDisplayText("FRE"); + + m_ToolBox->addItem(m_RegistrationWidget, "Registration"); + + + + // tracking status + m_ToolStatusWidget = new QmitkToolTrackingStatusWidget( parent ); + + m_Controls.m_VBoxLayout->addWidget(m_ToolStatusWidget); + + // update timer + m_RenderingTimerWidget = new QmitkUpdateTimerWidget( parent ); + m_RenderingTimerWidget->SetPurposeLabelText(QString("Navigation")); + m_RenderingTimerWidget->SetTimerInterval( 50 ); // set rendering timer at 20Hz (updating every 50msec) + + m_Controls.m_VBoxLayout->addWidget(m_RenderingTimerWidget); + +} + + + + +//void IGTTrackingLabView::OnSelectionChanged( std::vector nodes ) +//{ +// // iterate all selected objects, adjust warning visibility +// for( std::vector::iterator it = nodes.begin(); +// it != nodes.end(); +// ++it ) +// { +// mitk::DataNode::Pointer node = *it; +// +// if( node.IsNotNull() && dynamic_cast(node->GetData()) ) +// { +// m_Controls.labelWarning->setVisible( false ); +// m_Controls.buttonPerformImageProcessing->setEnabled( true ); +// return; +// } +// } +// +// m_Controls.labelWarning->setVisible( true ); +// m_Controls.buttonPerformImageProcessing->setEnabled( false ); +//} + + diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLab.h b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabView.h similarity index 56% rename from Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLab.h rename to Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabView.h index 7e70ad3ace..a94ee64f99 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLab.h +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabView.h @@ -1,67 +1,85 @@ /*========================================================================= 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 IGTTrackingLab_h -#define IGTTrackingLab_h +#ifndef IGTTrackingLabView_h +#define IGTTrackingLabView_h #include #include -#include "ui_IGTTrackingLabControls.h" +#include "ui_IGTTrackingLabViewControls.h" + +#include + +class QmitkNDIConfigurationWidget; +class QmitkFiducialRegistrationWidget; +class QmitkUpdateTimerWidget; +class QmitkToolTrackingStatusWidget; + /*! - \brief IGTTrackingLab + \brief IGTTrackingLabView \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ -class IGTTrackingLab : public QmitkFunctionality +class IGTTrackingLabView : public QmitkFunctionality { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; - IGTTrackingLab(); - virtual ~IGTTrackingLab(); + IGTTrackingLabView(); + virtual ~IGTTrackingLabView(); virtual void CreateQtPartControl(QWidget *parent); protected slots: /// \brief Called when the user clicks the GUI button - void DoImageProcessing(); +// void DoImageProcessing(); protected: /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged( std::vector nodes ); +// virtual void OnSelectionChanged( std::vector nodes ); + + Ui::IGTTrackingLabViewControls m_Controls; + void CreateBundleWidgets( QWidget* parent ); + + +private: - Ui::IGTTrackingLabControls m_Controls; + QToolBox* m_ToolBox; + QmitkNDIConfigurationWidget* m_NDIConfigWidget; // tracking device configuration widget + QmitkFiducialRegistrationWidget* m_RegistrationWidget; // landmark registration widget + QmitkUpdateTimerWidget* m_RenderingTimerWidget; // update timer widget for rendering and updating + QmitkToolTrackingStatusWidget* m_ToolStatusWidget; // tracking status visualizer widget }; -#endif // IGTTrackingLab_h +#endif // IGTTrackingLabView_h diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabControls.ui b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabViewControls.ui similarity index 59% rename from Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabControls.ui rename to Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabViewControls.ui index 0e574489fc..d39cbbc12d 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabControls.ui +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/IGTTrackingLabViewControls.ui @@ -1,64 +1,47 @@ - IGTTrackingLabControls - + IGTTrackingLabViewControls + 0 0 222 161 0 0 QmitkTemplate - - - QLabel { color: rgb(255, 0, 0) } - - - Please select an image! - - - - - - - Do image processing - - - Do Something - - + Qt::Vertical QSizePolicy::Expanding 20 220 diff --git a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/mitkPluginActivator.cpp b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/mitkPluginActivator.cpp index 17a8797c65..e45c3f652f 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/mitkPluginActivator.cpp +++ b/Modules/Bundles/org.mitk.gui.qt.igttrackinglab/src/internal/mitkPluginActivator.cpp @@ -1,39 +1,39 @@ /*========================================================================= 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. =========================================================================*/ #include "mitkPluginActivator.h" #include -#include "IGTTrackingLab.h" +#include "IGTTrackingLabView.h" namespace mitk { void PluginActivator::start(ctkPluginContext* context) { - BERRY_REGISTER_EXTENSION_CLASS(IGTTrackingLab, context) + BERRY_REGISTER_EXTENSION_CLASS(IGTTrackingLabView, context) } void PluginActivator::stop(ctkPluginContext* context) { Q_UNUSED(context) } } Q_EXPORT_PLUGIN2(org_mitk_gui_qt_igttrackinglab, mitk::PluginActivator)