diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/files.cmake b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/files.cmake index 5b0726b63c..dbf00eb6df 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/files.cmake +++ b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/files.cmake @@ -1,47 +1,43 @@ set(SRC_CPP_FILES ) set(INTERNAL_CPP_FILES org_mitk_gui_qt_matchpoint_evaluator_Activator.cpp QmitkMatchPointRegistrationEvaluator.cpp - QmitkMatchPointRegistrationEvalGenerator.cpp ) set(UI_FILES src/internal/QmitkMatchPointRegistrationEvaluator.ui - src/internal/QmitkMatchPointRegistrationEvalGenerator.ui ) set(MOC_H_FILES src/internal/org_mitk_gui_qt_matchpoint_evaluator_Activator.h src/internal/QmitkMatchPointRegistrationEvaluator.h - src/internal/QmitkMatchPointRegistrationEvalGenerator.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/evaluator.png - resources/evalgen.png 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/Plugins/org.mitk.gui.qt.matchpoint.evaluator/plugin.xml b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/plugin.xml index cd93496830..d0082ac6c5 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/plugin.xml +++ b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/plugin.xml @@ -1,15 +1,11 @@ - diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/resources/evalgen.png b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/resources/evalgen.png deleted file mode 100644 index 9699ee15dc..0000000000 Binary files a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/resources/evalgen.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvalGenerator.cpp b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvalGenerator.cpp deleted file mode 100644 index 9e9104e918..0000000000 --- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvalGenerator.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/*=================================================================== - -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. - -===================================================================*/ - -// Blueberry -#include -#include - -// Mitk -#include -#include -#include -#include "mitkMAPRegistrationWrapper.h" -#include "mitkMatchPointPropertyTags.h" -#include "mitkRegEvaluationObject.h" -#include "mitkRegistrationHelper.h" -#include "mitkRegEvaluationMapper2D.h" -#include "mitkAlgorithmHelper.h" - -// Qmitk -#include "QmitkMatchPointRegistrationEvalGenerator.h" - -// Qt -#include -#include - -const std::string QmitkMatchPointRegistrationEvalGenerator::VIEW_ID = - "org.mitk.views.matchpoint.registration.evaluation.generator"; - -QmitkMatchPointRegistrationEvalGenerator::QmitkMatchPointRegistrationEvalGenerator() - : m_Parent(NULL) -{ -} - -void QmitkMatchPointRegistrationEvalGenerator::SetFocus() -{ - //m_Controls.buttonPerformImageProcessing->setFocus(); -} - -void QmitkMatchPointRegistrationEvalGenerator::Error(QString msg) -{ - mitk::StatusBar::GetInstance()->DisplayErrorText(msg.toLatin1()); - MITK_ERROR << msg.toStdString().c_str(); -} - -void QmitkMatchPointRegistrationEvalGenerator::CreateQtPartControl(QWidget* parent) -{ - // create GUI widgets from the Qt Designer's .ui file - m_Controls.setupUi(parent); - - m_Parent = parent; - - connect(m_Controls.pbEval, SIGNAL(clicked()), this, SLOT(OnEvalBtnPushed())); - - this->CheckInputs(); - this->ConfigureMappingControls(); -} - -void QmitkMatchPointRegistrationEvalGenerator::CheckInputs() -{ - QList dataNodes = this->GetDataManagerSelection(); - this->m_autoMoving = false; - this->m_autoTarget = false; - this->m_spSelectedMovingNode = NULL; - this->m_spSelectedTargetNode = NULL; - this->m_spSelectedRegNode = NULL; - - if (dataNodes.size() > 0) - { - //test if auto select works - if (mitk::MITKRegistrationHelper::IsRegNode(dataNodes[0])) - { - this->m_spSelectedRegNode = dataNodes[0]; - dataNodes.pop_front(); - - mitk::BaseProperty* uidProp = m_spSelectedRegNode->GetProperty(mitk::nodeProp_RegAlgMovingData); - - if (uidProp) - { - //search for the moving node - mitk::NodePredicateProperty::Pointer predicate = mitk::NodePredicateProperty::New(mitk::nodeProp_UID, - uidProp); - this->m_spSelectedMovingNode = this->GetDataStorage()->GetNode(predicate); - this->m_autoMoving = this->m_spSelectedMovingNode.IsNotNull(); - } - - uidProp = m_spSelectedRegNode->GetProperty(mitk::nodeProp_RegAlgTargetData); - - if (uidProp) - { - //search for the target node - mitk::NodePredicateProperty::Pointer predicate = mitk::NodePredicateProperty::New(mitk::nodeProp_UID, - uidProp); - this->m_spSelectedTargetNode = this->GetDataStorage()->GetNode(predicate); - this->m_autoTarget = this->m_spSelectedTargetNode.IsNotNull(); - } - } - - //if still nodes are selected -> ignore possible auto select - if (!dataNodes.empty()) - { - mitk::Image* inputImage = dynamic_cast(dataNodes[0]->GetData()); - - if (inputImage) - { - this->m_spSelectedMovingNode = dataNodes[0]; - this->m_autoMoving = false; - dataNodes.pop_front(); - } - } - - if (!dataNodes.empty()) - { - mitk::Image* inputImage = dynamic_cast(dataNodes[0]->GetData()); - - if (inputImage) - { - this->m_spSelectedTargetNode = dataNodes[0]; - this->m_autoTarget = false; - dataNodes.pop_front(); - } - } - } - - if (this->m_spSelectedRegNode.IsNull()) - { - if (this->m_spSelectedMovingNode.IsNotNull() && this->m_spSelectedTargetNode.IsNotNull()) - { - m_Controls.lbRegistrationName->setText( - QString("No registration selected! Direct comparison")); - } - else - { - m_Controls.lbRegistrationName->setText( - QString("No registration selected!")); - } - } - else - { - m_Controls.lbRegistrationName->setText(QString::fromStdString( - this->m_spSelectedRegNode->GetName())); - } - - if (this->m_spSelectedMovingNode.IsNull()) - { - m_Controls.lbMovingName->setText(QString("no moving image selected!")); - } - else - { - if (this->m_autoMoving) - { - m_Controls.lbMovingName->setText(QString("") + QString::fromStdString( - this->m_spSelectedMovingNode->GetName()) + QString(" (auto selected)")); - } - else - { - m_Controls.lbMovingName->setText(QString::fromStdString(this->m_spSelectedMovingNode->GetName())); - } - } - - if (this->m_spSelectedTargetNode.IsNull()) - { - m_Controls.lbTargetName->setText(QString("no target image selected!")); - } - else - { - if (this->m_autoTarget) - { - m_Controls.lbTargetName->setText(QString("") + QString::fromStdString( - this->m_spSelectedTargetNode->GetName()) + QString(" (auto selected)")); - } - else - { - m_Controls.lbTargetName->setText(QString::fromStdString(this->m_spSelectedTargetNode->GetName())); - } - } -} - -void QmitkMatchPointRegistrationEvalGenerator::ConfigureMappingControls() -{ - this->m_Controls.pbEval->setEnabled(this->m_spSelectedMovingNode.IsNotNull() - && this->m_spSelectedTargetNode.IsNotNull()); -} - -void QmitkMatchPointRegistrationEvalGenerator::OnSelectionChanged( - berry::IWorkbenchPart::Pointer /*source*/, - const QList& nodes) -{ - this->CheckInputs(); - this->ConfigureMappingControls(); -} - -void QmitkMatchPointRegistrationEvalGenerator::OnEvalBtnPushed() -{ - mitk::RegEvaluationObject::Pointer regEval = mitk::RegEvaluationObject::New(); - - mitk::MAPRegistrationWrapper::Pointer reg; - - if (m_spSelectedRegNode.IsNotNull()) - { - reg = dynamic_cast(this->m_spSelectedRegNode->GetData()); - } - else - { - //generate a dymme reg to use - reg = mitk::GenerateIdentityRegistration3D(); - } - - regEval->SetRegistration(reg); - regEval->SetTargetNode(this->m_spSelectedTargetNode); - regEval->SetMovingNode(this->m_spSelectedMovingNode); - - mitk::DataNode::Pointer regEvalNode = mitk::DataNode::New(); - regEvalNode->SetData(regEval); - regEvalNode->SetName("RegistrationEvaluationHelper"); - - mitk::RegEvaluationMapper2D::SetDefaultProperties(regEvalNode); - - this->GetDataStorage()->Add(regEvalNode); - - this->GetRenderWindowPart()->RequestUpdate(); - - this->CheckInputs(); - this->ConfigureMappingControls(); -} \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvalGenerator.h b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvalGenerator.h deleted file mode 100644 index a20e5b3515..0000000000 --- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvalGenerator.h +++ /dev/null @@ -1,93 +0,0 @@ -/*=================================================================== - -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 __Q_MITK_MATCHPOINT_REGISTRATION_EVAL_GENERATOR_H -#define __Q_MITK_MATCHPOINT_REGISTRATION_EVAL_GENERATOR_H - -#include - -#include "ui_QmitkMatchPointRegistrationEvalGenerator.h" - -/*! - \brief QmitkMatchPointRegistrationEvalGenerator - - Class implements the eval generator view, containing the needed business logic and interaction schemes. - Purpose of the view is to generate registration eval (helper) objects by (auto) selecting appropriate - data nodes from the data manager. - - \sa QmitkFunctionality - \ingroup ${plugin_target}_internal -*/ -class QmitkMatchPointRegistrationEvalGenerator : public QmitkAbstractView -{ - // 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; - - /** - * Creates smartpointer typedefs - */ - berryObjectMacro(QmitkMatchPointRegistrationEvalGenerator) - - QmitkMatchPointRegistrationEvalGenerator(); - - virtual void CreateQtPartControl(QWidget* parent); - -protected slots: - - /// \brief Called when the user clicks the GUI button - void OnEvalBtnPushed(); - -protected: - virtual void SetFocus(); - - /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList& nodes); - - Ui::MatchPointRegistrationEvalGeneratorControls m_Controls; - -private: - QWidget* m_Parent; - - void Error(QString msg); - - /** - * Checks if appropriated nodes are selected in the data manager. If nodes are selected, - * they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode. - * They are also checked for vadility and stored in m_ValidInput,... . - * It also sets the info lables accordingly.*/ - void CheckInputs(); - - /** - * Updates the state of mapping control button regarding to selected - * input, registration and reference.*/ - void ConfigureMappingControls(); - - mitk::DataNode::Pointer m_spSelectedRegNode; - mitk::DataNode::Pointer m_spSelectedMovingNode; - mitk::DataNode::Pointer m_spSelectedTargetNode; - - bool m_autoTarget; - bool m_autoMoving; -}; - -#endif // MatchPoint_h - diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvalGenerator.ui b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvalGenerator.ui deleted file mode 100644 index 30d9de3fb2..0000000000 --- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvalGenerator.ui +++ /dev/null @@ -1,301 +0,0 @@ - - - MatchPointRegistrationEvalGeneratorControls - - - - 0 - 0 - 392 - 581 - - - - - 5 - - - 5 - - - - - Selected registration: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 170 - 0 - - - - - - - - - 0 - 170 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - - 75 - true - - - - Registration that should be used to map the moving image... - - - QFrame::StyledPanel - - - 2 - - - 1 - - - - - - - - - - Selected moving image: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 170 - 0 - - - - - - - - - 0 - 170 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - - 75 - true - - - - Moving image that should be mapped... - - - QFrame::StyledPanel - - - 2 - - - 1 - - - - - - - - - - Selected target image: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 170 - 0 - - - - - - - - - 0 - 170 - 0 - - - - - - - - - 159 - 158 - 158 - - - - - - - - - 75 - true - - - - Reference image that is used to determine the field of view mapped into... - - - QFrame::StyledPanel - - - 2 - - - 1 - - - - - - - - - - <html><head/><body><p>Starts the mapping of the input image with the current settings.</p></body></html> - - - Visualize mapping - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - 5 - - - 5 - - - true - - - true - - - true - - - diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/org_mitk_gui_qt_matchpoint_evaluator_Activator.cpp b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/org_mitk_gui_qt_matchpoint_evaluator_Activator.cpp index c5a0c68e8b..cf7305d1d7 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/org_mitk_gui_qt_matchpoint_evaluator_Activator.cpp +++ b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/org_mitk_gui_qt_matchpoint_evaluator_Activator.cpp @@ -1,45 +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 "org_mitk_gui_qt_matchpoint_evaluator_Activator.h" #include "QmitkMatchPointRegistrationEvaluator.h" -#include "QmitkMatchPointRegistrationEvalGenerator.h" ctkPluginContext* org_mitk_gui_qt_matchpoint_evaluator_Activator::m_Context = 0; void org_mitk_gui_qt_matchpoint_evaluator_Activator::start( ctkPluginContext* context) { BERRY_REGISTER_EXTENSION_CLASS(QmitkMatchPointRegistrationEvaluator, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkMatchPointRegistrationEvalGenerator, context) m_Context = context; } void org_mitk_gui_qt_matchpoint_evaluator_Activator::stop( ctkPluginContext* context) { Q_UNUSED(context) m_Context = 0; } ctkPluginContext* org_mitk_gui_qt_matchpoint_evaluator_Activator::GetContext() { return m_Context; }