diff --git a/Modules/SurfaceRegistration/CMakeLists.txt b/Modules/SurfaceRegistration/CMakeLists.txt index ae81db85cd..cfef402527 100644 --- a/Modules/SurfaceRegistration/CMakeLists.txt +++ b/Modules/SurfaceRegistration/CMakeLists.txt @@ -1,4 +1,4 @@ mitk_create_module( SurfaceRegistration INCLUDE_DIRS PRIVATE src/DataManagement src/Interactions src/IO src/Rendering - DEPENDS PUBLIC MitkCore + DEPENDS MitkAnnotation ) diff --git a/Modules/SurfaceRegistration/include/MitkShapeComparisonManager.h b/Modules/SurfaceRegistration/include/MitkShapeComparisonManager.h index a7e12b20b2..8d5b6e3a3a 100644 --- a/Modules/SurfaceRegistration/include/MitkShapeComparisonManager.h +++ b/Modules/SurfaceRegistration/include/MitkShapeComparisonManager.h @@ -1,52 +1,69 @@ /*=================================================================== 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 MitkShapeComparisonManager_h -#define MitkShapeComparisonManager_h +#ifndef ShapeComparisonManager_h +#define ShapeComparisonManager_h #include "mitkSurface.h" #include #include "mitkDataNode.h" +#include +#include +#include + //#include "mitkSurfaceRegistrationICP.h" #include namespace mitk { class MITKSURFACEREGISTRATION_EXPORT ShapeComparisonManager { public: - ShapeComparisonManager(); + ShapeComparisonManager(mitk::Surface::Pointer moving, mitk::Surface::Pointer target); ~ShapeComparisonManager(); - void setMovingSurface(mitk::Surface::Pointer moving); - void setTargetSurface(mitk::Surface::Pointer target); - mitk::DataNode::Pointer manageICPCalculation(); - void manageCalculateDistances(); + mitk::Surface::Pointer getRegisteredSurface(); + void execute(); + vtkSmartPointer getTable(); + private: + void manageICPCalculation(); + void manageCalculateDistances(); + + void createLookUpTable(); + + void printPoints();//for test purposes + mitk::Surface::Pointer m_MovingSurface; mitk::Surface::Pointer m_TargetSurface; + mitk::Surface::Pointer m_registeredSurface; + vtkSmartPointer m_distances; + + vtkSmartPointer m_LookupTable; + + }; } #endif diff --git a/Modules/SurfaceRegistration/include/mitkShortestDistanceCalculator.h b/Modules/SurfaceRegistration/include/mitkShortestDistanceCalculator.h index 10935e4433..7ffea9dea3 100644 --- a/Modules/SurfaceRegistration/include/mitkShortestDistanceCalculator.h +++ b/Modules/SurfaceRegistration/include/mitkShortestDistanceCalculator.h @@ -1,36 +1,36 @@ /*=================================================================== 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 mitkShortestDistanceCalculator_h #define mitkShortestDistanceCalculator_h #include #include namespace mitk{ class ShortestDistanceCalculator { public: ShortestDistanceCalculator(); ~ShortestDistanceCalculator(); - void calculateShortestDistance(vtkSmartPointer moving, vtkSmartPointer target); + vtkSmartPointer calculateShortestDistance(vtkSmartPointer moving, vtkSmartPointer target); private: }; }; #endif \ No newline at end of file diff --git a/Modules/SurfaceRegistration/src/DataManagement/MitkShortestDistanceCalculator.cpp b/Modules/SurfaceRegistration/src/DataManagement/MitkShortestDistanceCalculator.cpp index c3d6b7f613..daade90ded 100644 --- a/Modules/SurfaceRegistration/src/DataManagement/MitkShortestDistanceCalculator.cpp +++ b/Modules/SurfaceRegistration/src/DataManagement/MitkShortestDistanceCalculator.cpp @@ -1,58 +1,59 @@ /*=================================================================== 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 "mitkShortestDistanceCalculator.h" #include "vtkCellLocator.h" #include "vtkPointData.h" #include "vtkImplicitPolyDataDistance.h" -#include "vtkFloatArray.h" +#include "vtkDoubleArray.h" #include // std::abs + mitk::ShortestDistanceCalculator::ShortestDistanceCalculator() { } mitk::ShortestDistanceCalculator::~ShortestDistanceCalculator() { } -void mitk::ShortestDistanceCalculator::calculateShortestDistance(vtkSmartPointer moving, vtkSmartPointer target) +vtkSmartPointer mitk::ShortestDistanceCalculator::calculateShortestDistance(vtkSmartPointer moving, vtkSmartPointer target) { - // was passiert wenn der andere pointset groesser ist MITK_INFO << "calculate shortest distance ..."; - std::vector *distances = new std::vector(); + vtkSmartPointer distances = vtkSmartPointer::New(); double fromPoint[3] = { 0, 0, 0 }; int pointNumber = moving->GetPoints()->GetNumberOfPoints(); vtkSmartPointer implicitPolyDataDistance = vtkSmartPointer::New(); implicitPolyDataDistance->SetInput(target); //test double mean = 0; for (int i = 0; i < pointNumber; ++i) { moving->GetPoints()->GetPoint(i, fromPoint); double distance = implicitPolyDataDistance->FunctionValue(fromPoint[0], fromPoint[1], fromPoint[2]); // MITK_INFO << distance; - distances->push_back(distance); + distances->InsertNextValue(distance); mean += std::abs(distance); } mean = mean / pointNumber; MITK_INFO << "The mean is: " << mean; + return distances; } \ No newline at end of file diff --git a/Modules/SurfaceRegistration/src/mitkShapeComparisonManager.cpp b/Modules/SurfaceRegistration/src/mitkShapeComparisonManager.cpp index 5f8ae27404..024d527c90 100644 --- a/Modules/SurfaceRegistration/src/mitkShapeComparisonManager.cpp +++ b/Modules/SurfaceRegistration/src/mitkShapeComparisonManager.cpp @@ -1,58 +1,135 @@ /*=================================================================== 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 #include -mitk::ShapeComparisonManager::ShapeComparisonManager() +#include +#include + + +#include +#include + +mitk::ShapeComparisonManager::ShapeComparisonManager(mitk::Surface::Pointer moving, mitk::Surface::Pointer target) { + this->m_MovingSurface = moving; + this->m_TargetSurface = target; } mitk::ShapeComparisonManager::~ShapeComparisonManager() { m_MovingSurface->Delete(); m_TargetSurface->Delete(); + createLookUpTable(); + } -void mitk::ShapeComparisonManager::setMovingSurface(mitk::Surface::Pointer moving) +mitk::Surface::Pointer mitk::ShapeComparisonManager::getRegisteredSurface() { - this->m_MovingSurface = moving; + return m_registeredSurface; } -void mitk::ShapeComparisonManager::setTargetSurface(mitk::Surface::Pointer target) +void mitk::ShapeComparisonManager::execute() { - this->m_TargetSurface = target; + // printPoints(); + manageICPCalculation(); + manageCalculateDistances(); +} + +vtkSmartPointer mitk::ShapeComparisonManager::getTable() +{ + return m_LookupTable; } -mitk::DataNode::Pointer mitk::ShapeComparisonManager::manageICPCalculation() +void mitk::ShapeComparisonManager::manageICPCalculation() { m_registeredSurface = mitk::Surface::New(); - mitk::DataNode::Pointer registeredNode = mitk::DataNode::New(); + mitk::SurfaceRegistrationICP *registrationHelper = new SurfaceRegistrationICP(); m_registeredSurface = registrationHelper->CalculateICP(m_MovingSurface, m_TargetSurface); - registeredNode->SetData(m_registeredSurface); - - manageCalculateDistances(); - return registeredNode; } void mitk::ShapeComparisonManager::manageCalculateDistances() { mitk::ShortestDistanceCalculator *distanceCalculator = new ShortestDistanceCalculator(); - distanceCalculator->calculateShortestDistance(m_registeredSurface->GetVtkPolyData(), m_TargetSurface->GetVtkPolyData()); + m_distances = distanceCalculator->calculateShortestDistance(m_registeredSurface->GetVtkPolyData(), m_TargetSurface->GetVtkPolyData()); + //TODO + // m_TargetSurface->GetVtkPolyData()->GetCellData()->setScalars(m_distances); + //data + //aPlane->Update(); // Force an update so we can set cell data + //aPlane->GetOutput()->GetCellData()->SetScalars(cellData); -} \ No newline at end of file + + + //// Setup actor and mapper + //vtkSmartPointer mapper = + // vtkSmartPointer::New(); + //mapper->SetInputConnection(aPlane->GetOutputPort()); + //mapper->SetScalarRange(0, tableSize - 1); + //mapper->SetLookupTable(lut); + + //vtkSmartPointer actor = + // vtkSmartPointer::New(); + //actor->SetMapper(mapper) +} + +void mitk::ShapeComparisonManager::createLookUpTable() +{ + m_LookupTable = vtkSmartPointer::New(); + int tableSize = 10; + m_LookupTable->SetNumberOfTableValues(tableSize); + m_LookupTable->Build(); + + // Fill in a few known colors, the rest will be generated if needed + m_LookupTable->SetTableValue(0, 0, 0, 0, 1); //Black + m_LookupTable->SetTableValue(1, 0.8900, 0.8100, 0.3400, 1); // Banana + m_LookupTable->SetTableValue(2, 1.0000, 0.3882, 0.2784, 1); // Tomato + m_LookupTable->SetTableValue(3, 0.9608, 0.8706, 0.7020, 1); // Wheat + m_LookupTable->SetTableValue(4, 0.9020, 0.9020, 0.9804, 1); // Lavender + m_LookupTable->SetTableValue(5, 1.0000, 0.4900, 0.2500, 1); // Flesh + m_LookupTable->SetTableValue(6, 0.5300, 0.1500, 0.3400, 1); // Raspberry + m_LookupTable->SetTableValue(7, 0.9804, 0.5020, 0.4471, 1); // Salmon + m_LookupTable->SetTableValue(8, 0.7400, 0.9900, 0.7900, 1); // Mint + m_LookupTable->SetTableValue(9, 0.2000, 0.6300, 0.7900, 1); // Peacock +} + +void mitk::ShapeComparisonManager::printPoints() +{ + MITK_INFO << "printing"; + std::ofstream OutputFileMoving; + OutputFileMoving.open("movingPoints.txt"); + int pointNumber = m_MovingSurface->GetVtkPolyData()->GetPoints()->GetNumberOfPoints(); + double printPoint[3] = { 0,0,0 }; + for (int i = 0; i < pointNumber; ++i) + { + m_MovingSurface->GetVtkPolyData()->GetPoints()->GetPoint(i, printPoint); + OutputFileMoving << printPoint[0]<<" " << printPoint[1] << " " << printPoint[2] <GetVtkPolyData()->GetPoints()->GetNumberOfPoints(); + double printPoint2[3] = { 0,0,0 }; + for (int i = 0; i < pointNumber2; ++i) + { + m_TargetSurface->GetVtkPolyData()->GetPoints()->GetPoint(i, printPoint2); + OutputFileTarget << printPoint2[0] << " " << printPoint2[1] << " " << printPoint2[2] << std::endl; + } + OutputFileTarget.close(); +} diff --git a/Plugins/org.mitk.gui.qt.surfaceregistration/src/internal/QmitkSurfaceRegistration.cpp b/Plugins/org.mitk.gui.qt.surfaceregistration/src/internal/QmitkSurfaceRegistration.cpp index 74ef26c4bb..9caebb2798 100644 --- a/Plugins/org.mitk.gui.qt.surfaceregistration/src/internal/QmitkSurfaceRegistration.cpp +++ b/Plugins/org.mitk.gui.qt.surfaceregistration/src/internal/QmitkSurfaceRegistration.cpp @@ -1,208 +1,270 @@ /*========================================================================= 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 "QmitkSurfaceRegistration.h" #include #include #include #include #include #include #include // Includes for image casting between ITK and MITK: added after using Plugin Generator #include // added for surface dynamic cast #include #include #include #include #include #include #include #include #include #include #include +#include +#include +#include +#include + const std::string QmitkSurfaceRegistration::VIEW_ID = "org.mitk.views.qmitksurfaceregistration"; QmitkSurfaceRegistration::QmitkSurfaceRegistration(QObject *parent) : m_ParentWidget(0), m_movingSurfaceNode(nullptr), m_targetSurfaceNode(nullptr) { } QmitkSurfaceRegistration::~QmitkSurfaceRegistration() { // delete pointer objects m_movingSurfaceNode = nullptr; m_targetSurfaceNode = nullptr; } // void QmitkSurfaceRegistration::SetFocus(){ m_Controls.groupBoxMoving->setFocus(); } + +QWidget * QmitkSurfaceRegistration::GetControls() +{ + return nullptr; +} + void QmitkSurfaceRegistration::CreateQtPartControl(QWidget *parent) { // create GUI widgets from the Qt Designer's .ui file m_Controls.setupUi(parent); connect(m_Controls.pushButtonExecute, SIGNAL(clicked()), this, SLOT(doExecute())); mitk::RenderingManager::GetInstance()->SetDataStorage(this->GetDataStorageReference()->GetDataStorage()); mitk::RenderingManager::GetInstance()->InitializeViews(); m_ParentWidget = parent; } void QmitkSurfaceRegistration::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*part*/, const QList &nodes) { MITK_INFO << "On Selection Changed"; bool rotationEnabled = false; if (nodes.empty()) { MITK_INFO << "Nothing selected yet"; m_Controls.labelSelectMovingSurface->setStyleSheet(" QLabel { color: rgb(255, 0, 0) }"); m_Controls.labelSelectTargetSurface->setStyleSheet(" QLabel { color: rgb(255, 0, 0) }"); m_Controls.labelMovingSurfaceName->setText(QString::fromStdString("No moving surface selected")); m_Controls.labelTargetSurfaceName->setText(QString::fromStdString("No target surface selected")); m_Controls.groupBoxMoving->setEnabled(true); m_Controls.groupBoxMappedData->setEnabled(false); if (m_useTestConfig) { m_Controls.pushButtonExecute->setEnabled(true); } else{ m_Controls.pushButtonExecute->setEnabled(false); } m_Controls.radioButtonMirroring->setEnabled(false); return; } else { if (nodes.size() == 1) { if (nodes[0].IsNotNull() && dynamic_cast(nodes[0]->GetData())) { MITK_INFO << "There is exactly one image selected"; m_movingSurfaceNode = nodes[0]; m_Controls.labelSelectMovingSurface->setText("Selected moving surface:"); m_Controls.labelSelectMovingSurface->setStyleSheet(" QLabel { color: rgb(0, 0, 0) }"); m_Controls.labelMovingSurfaceName->setText( QString::fromStdString("File name: " + m_movingSurfaceNode->GetName())); m_Controls.radioButtonMirroring->setEnabled(true); m_Controls.groupBoxTarget->setEnabled(true); m_Controls.groupBoxMappedData->setEnabled(true); m_Controls.groupBoxTarget->setEnabled(true); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } else { QMessageBox::information(nullptr, "Warning", "Are you sure? - I dont think this is a Surface! Try again!"); } } else if (nodes.size() == 2) { if (nodes[1].IsNotNull() && dynamic_cast(nodes[1]->GetData())) { MITK_INFO << "There are two images selected"; m_targetSurfaceNode = nodes[1]; m_Controls.labelSelectTargetSurface->setText("Selected target surface:"); m_Controls.labelSelectTargetSurface->setStyleSheet(" QLabel { color: rgb(0, 0, 0) }"); m_Controls.labelTargetSurfaceName->setText( QString::fromStdString("File name: " + m_targetSurfaceNode->GetName())); m_Controls.textMappedDataName->setEnabled(true); m_Controls.pushButtonExecute->setEnabled(true); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); m_useTestConfig = false; } else { QMessageBox::information(nullptr, "Warning", "Are you sure? - I dont think this is a Surface!"); } } else { QMessageBox::information(nullptr, "Warning", "You do know that it only works with two surfaces, right? If you continue to click execute, this might crash one day!"); //wie kann ich die Auswahl zurueck setzen? } } } void QmitkSurfaceRegistration::doExecute() { if (m_useTestConfig) { setUpTestConfig(); } MITK_INFO << "pushButtonExecute clicked"; performICPRegistration(); + showLookUpTable(); } void QmitkSurfaceRegistration::setUpTestConfig() { mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New(); mitk::IOUtil::Load("//ad/fs/E130-Projekte/BGLU/Fibula/Python/DataGAN/Registered/Surface/Tibia/tibia01_q0.stl", *ds); mitk::IOUtil::Load("//ad/fs/E130-Projekte/BGLU/Fibula/Python/DataGAN/Registered/Surface/Tibia/tibia02_q0.stl", *ds); m_movingSurfaceNode = ds->GetAll()->at(0); m_targetSurfaceNode = ds->GetAll()->at(1); this->GetDataStorageReference()->GetDataStorage()->Add(mitk::DataNode::Pointer(ds->GetAll()->at(0))); this->GetDataStorageReference()->GetDataStorage()->Add(mitk::DataNode::Pointer(ds->GetAll()->at(1))); this->GetDataStorageReference()->GetDataStorage()->Modified(); mitk::RenderingManager::GetInstance()->SetDataStorage(this->GetDataStorageReference()->GetDataStorage()); mitk::RenderingManager::GetInstance()->InitializeViews(); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); m_Controls.pushButtonExecute->setEnabled(true); m_Controls.labelMovingSurfaceName->setText("tibia01_q0"); m_Controls.labelTargetSurfaceName->setText("tibia02_q0"); m_Controls.labelSelectMovingSurface->setText("Selected moving surface:"); m_Controls.labelSelectMovingSurface->setStyleSheet(" QLabel { color: rgb(0, 0, 0) }"); m_Controls.labelSelectTargetSurface->setText("Selected target surface:"); m_Controls.labelSelectTargetSurface->setStyleSheet(" QLabel { color: rgb(0, 0, 0) }"); this->GetDataStorageReference()->GetDataStorage()->Modified(); mitk::RenderingManager::GetInstance()->InitializeViews(); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } + void QmitkSurfaceRegistration::performICPRegistration() { mitk::Surface::Pointer movingSurface = dynamic_cast (m_movingSurfaceNode->GetData()); mitk::Surface::Pointer targetSurface = dynamic_cast (m_targetSurfaceNode->GetData()); + mitk::ShapeComparisonManager *manager = new mitk::ShapeComparisonManager(movingSurface, targetSurface); + manager->execute(); mitk::DataNode::Pointer registeredNode = mitk::DataNode::New(); - - mitk::ShapeComparisonManager *manager = new mitk::ShapeComparisonManager(); - manager->setMovingSurface(movingSurface); - manager->setTargetSurface(targetSurface); - registeredNode = manager->manageICPCalculation(); + registeredNode->SetData(manager->getRegisteredSurface()); this->GetDataStorageReference()->GetDataStorage()->Add(registeredNode, m_movingSurfaceNode); registeredNode->SetName("defaultMappedDataName"); this->GetDataStorageReference()->GetDataStorage()->Modified(); mitk::RenderingManager::GetInstance()->InitializeViews(); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); MITK_INFO << "registration done"; -} \ No newline at end of file +} + +void QmitkSurfaceRegistration::showLookUpTable() +{ + //// Create a ColorBarAnnotation + //mitk::ColorBarAnnotation::Pointer colorbar = mitk::ColorBarAnnotation::New(); + + //colorbar->SetDrawAnnotations(true); + //colorbar->SetOrientationToHorizontal(); + //vtkSmartPointer table = vtkSmartPointer::New(); + //table->SetTableRange(0.0, 10.0); + //// If you don't want to use the whole color range, you can use + //// SetValueRange, SetHueRange, and SetSaturationRange + //table->Build(); + //colorbar->SetLookupTable(table); + + //std::string rendererID = "axial"; + + //mitk::LayoutAnnotationRenderer::AddAnnotation( + // colorbar, rendererID); + + // Create a textAnnotation2D + + QString renderWindowName; + QHash renderWindows = this->GetRenderWindowPart()->GetQmitkRenderWindows(); + Q_FOREACH(QString renderWindow, renderWindows.keys()) + { + MITK_INFO << "BLABLABLA " << renderWindow; + renderWindowName = renderWindow; + } + + //http://docs.mitk.org/nightly/AnnotationModulePage.html + + mitk::TextAnnotation2D::Pointer textAnnotation = mitk::TextAnnotation2D::New(); + textAnnotation->SetText("Test!"); // set UTF-8 encoded text to render + textAnnotation->SetFontSize(40); + textAnnotation->SetColor(1, 0, 0); // Set text color to red + textAnnotation->SetOpacity(1); + // The position of the Annotation can be set to a fixed coordinate on the display. + mitk::Point2D pos; + pos[0] = 10; + pos[1] = 20; + textAnnotation->SetPosition2D(pos); + std::string rendererID = renderWindowName.toStdString(); + // The LayoutAnnotationRenderer can place the TextAnnotation2D at some defined corner positions + mitk::LayoutAnnotationRenderer::AddAnnotation( + textAnnotation, rendererID, mitk::LayoutAnnotationRenderer::TopLeft, 5, 5, 1); + + + MITK_INFO << "is there a lookuptable?"; + +} diff --git a/Plugins/org.mitk.gui.qt.surfaceregistration/src/internal/QmitkSurfaceRegistration.h b/Plugins/org.mitk.gui.qt.surfaceregistration/src/internal/QmitkSurfaceRegistration.h index 3b0cb1b242..5272c7dc6e 100644 --- a/Plugins/org.mitk.gui.qt.surfaceregistration/src/internal/QmitkSurfaceRegistration.h +++ b/Plugins/org.mitk.gui.qt.surfaceregistration/src/internal/QmitkSurfaceRegistration.h @@ -1,105 +1,112 @@ /*========================================================================= 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 QmitkSurfaceRegistration_h #define QmitkSurfaceRegistration_h #include #ifdef WIN32 #pragma warning( disable : 4250 ) #endif #include "QVTKWidget.h" #include "QmitkRegisterClasses.h" #include #include "ui_SurfaceRegistrationControls.h" #include "usServiceRegistration.h" +#include "mitkAnnotation.h" /*! @brief QmitkSurfaceRegistrationView \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 QmitkSurfaceRegistration : 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) private: Q_OBJECT public: /*! @brief Constructor. Called by SampleApp (or other apps that use functionalities) */ QmitkSurfaceRegistration(QObject *parent = 0); virtual ~QmitkSurfaceRegistration(); static const std::string VIEW_ID; virtual void CreateQtPartControl(QWidget *parent); virtual void SetFocus() override; + ///*! //@brief Creates the Qt connections needed //*/ QWidget* GetControls(); /// @brief Called when the user clicks the GUI button protected slots: void doExecute(); protected: // /*! //@brief called by QmitkFunctionality when DataManager's selection has changed // */ void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; + private: /*! * The parent QWidget */ QWidget* m_ParentWidget; + mitk::BaseRenderer *m_Renderer; + /*! * @brief A pointer to the node of the moving surface. */ mitk::DataNode::Pointer m_movingSurfaceNode; /*! * @brief A pointer to the node of the target surface. */ mitk::DataNode::Pointer m_targetSurfaceNode; Ui::SurfaceRegistrationControls m_Controls; bool m_useTestConfig = true; void performICPRegistration(); void setUpTestConfig(); + + void showLookUpTable(); }; #endif // QmitkSurfaceRegistration_h \ No newline at end of file