diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt index 04af24e273..9843ea9d59 100644 --- a/Modules/CMakeLists.txt +++ b/Modules/CMakeLists.txt @@ -1,78 +1,77 @@ # Modules must be listed according to their dependencies set(module_dirs DataTypesExt AlgorithmsExt MapperExt IOExt Qt4Qt5TestModule SceneSerializationBase PlanarFigure ImageDenoising ImageExtraction ImageStatistics LegacyAdaptors IpPicSupport Ext SceneSerialization GraphAlgorithms ContourModel SurfaceInterpolation Segmentation PlanarFigureSegmentation OpenViewCore QmlItems QtWidgets QtWidgetsExt SegmentationUI DiffusionImaging GPGPU IGTBase IGT CameraCalibration IGTUI RigidRegistration RigidRegistrationUI DeformableRegistration DeformableRegistrationUI OpenCL OpenCVVideoSupport Overlays InputDevices ToFHardware ToFProcessing ToFUI US - ClippingTools USUI DicomUI Simulation Remeshing Python Persistence VtkShaders ) if(MITK_ENABLE_PIC_READER) list(APPEND module_dirs IpPicSupportIO) endif() set(MITK_DEFAULT_SUBPROJECTS MITK-Modules) foreach(module_dir ${module_dirs}) add_subdirectory(${module_dir}) endforeach() if(MITK_PRIVATE_MODULES) file(GLOB all_subdirs RELATIVE ${MITK_PRIVATE_MODULES} ${MITK_PRIVATE_MODULES}/*) foreach(subdir ${all_subdirs}) string(FIND ${subdir} "." _result) if(_result EQUAL -1) if(EXISTS ${MITK_PRIVATE_MODULES}/${subdir}/CMakeLists.txt) message(STATUS "Found private module ${subdir}") add_subdirectory(${MITK_PRIVATE_MODULES}/${subdir} private_modules/${subdir}) endif() endif() endforeach() endif(MITK_PRIVATE_MODULES) diff --git a/Modules/ClippingTools/CMakeLists.txt b/Modules/ClippingTools/CMakeLists.txt deleted file mode 100644 index 533c0d4627..0000000000 --- a/Modules/ClippingTools/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -MITK_CREATE_MODULE( - DEPENDS MitkSegmentation - WARNINGS_AS_ERRORS -) diff --git a/Modules/ClippingTools/files.cmake b/Modules/ClippingTools/files.cmake deleted file mode 100644 index 456348b3d6..0000000000 --- a/Modules/ClippingTools/files.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(CPP_FILES - mitkClippingPlaneTranslationTool.cpp - mitkClippingPlaneRotationTool.cpp - mitkClippingPlaneDeformationTool.cpp -) diff --git a/Modules/ClippingTools/mitkClippingPlaneDeformationTool.cpp b/Modules/ClippingTools/mitkClippingPlaneDeformationTool.cpp deleted file mode 100644 index f59db97b5d..0000000000 --- a/Modules/ClippingTools/mitkClippingPlaneDeformationTool.cpp +++ /dev/null @@ -1,79 +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. - -===================================================================*/ -#include "mitkClippingPlaneDeformationTool.h" -#include "mitkClippingPlaneDeformationTool.xpm" - -#include "mitkBaseRenderer.h" -#include "usModule.h" -#include "usModuleContext.h" -#include "usGetModuleContext.h" -#include "usModuleRegistry.h" -#include "mitkGlobalInteraction.h" -#include "mitkRenderingManager.h" -#include "mitkToolManager.h" - -namespace mitk{ - MITK_TOOL_MACRO(MitkClippingTools_EXPORT, ClippingPlaneDeformationTool, "Clipping Tool Deformation"); -} - -mitk::ClippingPlaneDeformationTool::ClippingPlaneDeformationTool() -: Tool( "" ) -{ - m_SurfaceInteractor = mitk::SurfaceDeformationDataInteractor3D::New(); -} - -mitk::ClippingPlaneDeformationTool::~ClippingPlaneDeformationTool() -{ -} - -const char** mitk::ClippingPlaneDeformationTool::GetXPM() const -{ - return mitkClippingPlaneDeformationTool_xpm; -} - -const char* mitk::ClippingPlaneDeformationTool::GetName() const -{ - return "Deformation"; -} - -const char* mitk::ClippingPlaneDeformationTool::GetGroup() const -{ - return "ClippingTool"; -} - -void mitk::ClippingPlaneDeformationTool::Activated() -{ - Superclass::Activated(); - - //check if the Clipping plane is changed. - if(m_ClippingPlaneNode != m_ToolManager->GetWorkingData(0)) - { - m_ClippingPlaneNode = m_ToolManager->GetWorkingData(0); - m_ClippingPlaneNode->SetDataInteractor(NULL); - } - - m_SurfaceInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - m_SurfaceInteractor->SetEventConfig("AffineDeformationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - m_SurfaceInteractor->SetDataNode(m_ClippingPlaneNode); - -} - -void mitk::ClippingPlaneDeformationTool::Deactivated() -{ - Superclass::Deactivated(); - - m_SurfaceInteractor->SetDataNode(NULL); -} diff --git a/Modules/ClippingTools/mitkClippingPlaneDeformationTool.h b/Modules/ClippingTools/mitkClippingPlaneDeformationTool.h deleted file mode 100644 index d6d8fbfd9f..0000000000 --- a/Modules/ClippingTools/mitkClippingPlaneDeformationTool.h +++ /dev/null @@ -1,61 +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 mitkClippingPlaneDeformationTool_h_Included -#define mitkClippingPlaneDeformationTool_h_Included - -#include - -#include "mitkCommon.h" -#include "mitkDataNode.h" -#include "mitkSurfaceDeformationDataInteractor3D.h" -#include "mitkTool.h" - -namespace mitk -{ - /** - \brief A tool with whom you can deform planes. - */ - class MitkClippingTools_EXPORT ClippingPlaneDeformationTool : public Tool - { - public: - - mitkClassMacro(ClippingPlaneDeformationTool, Tool); - itkFactorylessNewMacro(Self) - itkCloneMacro(Self) - - virtual const char** GetXPM() const; - virtual const char* GetName() const; - virtual const char* GetGroup() const; - - - protected: - - ClippingPlaneDeformationTool(); // purposely hidden - virtual ~ClippingPlaneDeformationTool(); - - virtual void Activated(); - virtual void Deactivated(); - - mitk::DataNode::Pointer m_ClippingPlaneNode; - mitk::SurfaceDeformationDataInteractor3D::Pointer m_SurfaceInteractor; - }; - -} //end namespace mitk - -#endif - - diff --git a/Modules/ClippingTools/mitkClippingPlaneDeformationTool.xpm b/Modules/ClippingTools/mitkClippingPlaneDeformationTool.xpm deleted file mode 100644 index e5a2804943..0000000000 --- a/Modules/ClippingTools/mitkClippingPlaneDeformationTool.xpm +++ /dev/null @@ -1,30 +0,0 @@ -/* XPM */ -static const char * mitkClippingPlaneDeformationTool_xpm[] = { -"22 25 2 1", -" c None", -". c #000000", -" ", -" ", -" ", -" ", -" ........... ", -" ............. ", -" .............. ", -" ..... ...... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ..... ...... ", -" .............. ", -" ............. ", -" ........... ", -" ", -" ", -" "}; diff --git a/Modules/ClippingTools/mitkClippingPlaneRotationTool.cpp b/Modules/ClippingTools/mitkClippingPlaneRotationTool.cpp deleted file mode 100644 index 41a6e8def6..0000000000 --- a/Modules/ClippingTools/mitkClippingPlaneRotationTool.cpp +++ /dev/null @@ -1,78 +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. - -===================================================================*/ -#include "mitkClippingPlaneRotationTool.h" -#include "mitkClippingPlaneRotationTool.xpm" - -#include "mitkBaseRenderer.h" -#include "usModule.h" -#include "usModuleContext.h" -#include "usGetModuleContext.h" -#include "usModuleRegistry.h" -#include "mitkRenderingManager.h" -#include "mitkToolManager.h" - - -namespace mitk -{ - MITK_TOOL_MACRO(MitkClippingTools_EXPORT, ClippingPlaneRotationTool, "Clipping Tool Rotation"); -} - -mitk::ClippingPlaneRotationTool::ClippingPlaneRotationTool() -: Tool( "" ) -{ - m_AffineDataInteractor = mitk::AffineDataInteractor3D::New(); -} - -mitk::ClippingPlaneRotationTool::~ClippingPlaneRotationTool() -{ -} - -const char** mitk::ClippingPlaneRotationTool::GetXPM() const -{ - return mitkClippingPlaneRotationTool_xpm; -} - -const char* mitk::ClippingPlaneRotationTool::GetName() const -{ - return "Rotation"; -} - -const char* mitk::ClippingPlaneRotationTool::GetGroup() const -{ - return "ClippingTool"; -} - -void mitk::ClippingPlaneRotationTool::Activated() -{ - Superclass::Activated(); - - //check if the Clipping plane is changed. - if(m_ClippingPlaneNode != m_ToolManager->GetWorkingData(0)) - { - m_ClippingPlaneNode = m_ToolManager->GetWorkingData(0); - m_ClippingPlaneNode->SetDataInteractor(NULL); - } - - m_AffineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - m_AffineDataInteractor->SetEventConfig("AffineRotationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - m_AffineDataInteractor->SetDataNode(m_ClippingPlaneNode); -} - -void mitk::ClippingPlaneRotationTool::Deactivated() -{ - Superclass::Deactivated(); - m_AffineDataInteractor->SetDataNode(NULL); -} diff --git a/Modules/ClippingTools/mitkClippingPlaneRotationTool.h b/Modules/ClippingTools/mitkClippingPlaneRotationTool.h deleted file mode 100644 index af25154630..0000000000 --- a/Modules/ClippingTools/mitkClippingPlaneRotationTool.h +++ /dev/null @@ -1,66 +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 mitkClippingPlaneRotationTool_h_Included -#define mitkClippingPlaneRotationTool_h_Included - -#include - -#include "mitkAffineDataInteractor3D.h" -#include "mitkCommon.h" -#include "mitkDataNode.h" -#include "mitkTool.h" - -namespace mitk -{ - - /** - \brief A tool which allows you to rotate planes. - */ - class MitkClippingTools_EXPORT ClippingPlaneRotationTool : public Tool - { - public: - - mitkClassMacro(ClippingPlaneRotationTool, Tool); - itkFactorylessNewMacro(Self) - itkCloneMacro(Self) - - virtual const char** GetXPM() const; - virtual const char* GetName() const; - virtual const char* GetGroup() const; - - - protected: - - ClippingPlaneRotationTool(); // purposely hidden - virtual ~ClippingPlaneRotationTool(); - - virtual void Activated(); - virtual void Deactivated(); - - mitk::DataNode::Pointer m_ClippingPlaneNode; - mitk::AffineDataInteractor3D::Pointer m_AffineDataInteractor; - - private: - - void ClippingPlaneChanged(); - }; - -} //end namespace mitk - -#endif - - diff --git a/Modules/ClippingTools/mitkClippingPlaneRotationTool.xpm b/Modules/ClippingTools/mitkClippingPlaneRotationTool.xpm deleted file mode 100644 index b3a8a9a979..0000000000 --- a/Modules/ClippingTools/mitkClippingPlaneRotationTool.xpm +++ /dev/null @@ -1,30 +0,0 @@ -/* XPM */ -static const char * mitkClippingPlaneRotationTool_xpm[] = { -"22 25 2 1", -" c None", -". c #000000", -" ", -" ", -" ", -" ", -" ............ ", -" .............. ", -" .............. ", -" ..... ...... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ..... ..... ", -" ............. ", -" ............ ", -" ............ ", -" ..... ...... ", -" ..... ...... ", -" ..... ...... ", -" ..... ...... ", -" ..... ...... ", -" ..... ...... ", -" ..... ....... ", -" ", -" ", -" "}; diff --git a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.cpp b/Modules/ClippingTools/mitkClippingPlaneTranslationTool.cpp deleted file mode 100644 index 772ab5cfce..0000000000 --- a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.cpp +++ /dev/null @@ -1,79 +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. - -===================================================================*/ -#include "mitkClippingPlaneTranslationTool.h" -#include "mitkClippingPlaneTranslationTool.xpm" - -#include "mitkBaseRenderer.h" -#include "mitkRenderingManager.h" -#include "mitkToolManager.h" - -// us -#include "usModule.h" -#include "usModuleContext.h" -#include "usGetModuleContext.h" -#include "usModuleRegistry.h" - -namespace mitk -{ - MITK_TOOL_MACRO(MitkClippingTools_EXPORT, ClippingPlaneTranslationTool, "Clipping Tool Translation"); -} - -mitk::ClippingPlaneTranslationTool::ClippingPlaneTranslationTool() -: Tool( "" ) -{ - m_AffineDataInteractor = mitk::AffineDataInteractor3D::New(); -} - -mitk::ClippingPlaneTranslationTool::~ClippingPlaneTranslationTool() -{ -} - -const char** mitk::ClippingPlaneTranslationTool::GetXPM() const -{ - return mitkClippingPlaneTranslationTool_xpm; -} - -const char* mitk::ClippingPlaneTranslationTool::GetName() const -{ - return "Translation"; -} - -const char* mitk::ClippingPlaneTranslationTool::GetGroup() const -{ - return "ClippingTool"; -} - -void mitk::ClippingPlaneTranslationTool::Activated() -{ - Superclass::Activated(); - - //check if the Clipping plane is changed. - if(m_ClippingPlaneNode != m_ToolManager->GetWorkingData(0)) - { - m_ClippingPlaneNode = m_ToolManager->GetWorkingData(0); - m_ClippingPlaneNode->SetDataInteractor(NULL); - } - - m_AffineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - m_AffineDataInteractor->SetEventConfig("AffineTranslationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - m_AffineDataInteractor->SetDataNode(m_ClippingPlaneNode); -} - -void mitk::ClippingPlaneTranslationTool::Deactivated() -{ - Superclass::Deactivated(); - m_AffineDataInteractor->SetDataNode(NULL); -} diff --git a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.h b/Modules/ClippingTools/mitkClippingPlaneTranslationTool.h deleted file mode 100644 index bbc5bb97ff..0000000000 --- a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.h +++ /dev/null @@ -1,69 +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 mitkClippingPlaneTranslationTool_h_Included -#define mitkClippingPlaneTranslationTool_h_Included - -#include - -#include "mitkAffineDataInteractor3D.h" -#include "mitkCommon.h" -#include "mitkDataNode.h" -#include "mitkTool.h" - - -namespace us { - class Module; -} - - -namespace mitk -{ - - /** - \brief A tool which allows you to move planes. - */ - class MitkClippingTools_EXPORT ClippingPlaneTranslationTool : public Tool - { - public: - - mitkClassMacro(ClippingPlaneTranslationTool, Tool); - itkFactorylessNewMacro(Self) - itkCloneMacro(Self) - - virtual const char** GetXPM() const; - virtual const char* GetName() const; - virtual const char* GetGroup() const; - - - protected: - - ClippingPlaneTranslationTool(); // purposely hidden - virtual ~ClippingPlaneTranslationTool(); - - virtual void Activated(); - virtual void Deactivated(); - - mitk::DataNode::Pointer m_ClippingPlaneNode; - mitk::AffineDataInteractor3D::Pointer m_AffineDataInteractor; - - }; - -} //end namespace mitk - -#endif - - diff --git a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.xpm b/Modules/ClippingTools/mitkClippingPlaneTranslationTool.xpm deleted file mode 100644 index 5f47707d35..0000000000 --- a/Modules/ClippingTools/mitkClippingPlaneTranslationTool.xpm +++ /dev/null @@ -1,30 +0,0 @@ -/* XPM */ -static const char * mitkClippingPlaneTranslationTool_xpm[] = { -"22 25 2 1", -" c None", -". c #000000", -" ", -" ", -" ", -" ", -" ............... ", -" ............... ", -" ............... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ..... ", -" ", -" ", -" "}; diff --git a/Plugins/org.mitk.gui.qt.segmentation/CMakeLists.txt b/Plugins/org.mitk.gui.qt.segmentation/CMakeLists.txt index b136c3959b..93cb1256d8 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.segmentation/CMakeLists.txt @@ -1,9 +1,9 @@ project(org_mitk_gui_qt_segmentation) include_directories(${CTK_INCLUDE_DIRS}) MACRO_CREATE_MITK_CTK_PLUGIN( EXPORT_DIRECTIVE MITK_QT_SEGMENTATION EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkClippingTools MitkSegmentationUI + MODULE_DEPENDS MitkQtWidgetsExt MitkSegmentationUI ) diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.cpp b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.cpp index 742f7a4f7d..5bfc026303 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.cpp +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.cpp @@ -1,555 +1,591 @@ /*=================================================================== 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 "QmitkDeformableClippingPlaneView.h" -#include "mitkClippingPlaneDeformationTool.h" -#include "mitkClippingPlaneRotationTool.h" -#include "mitkClippingPlaneTranslationTool.h" +#include "mitkAffineDataInteractor3D.h" #include "mitkHeightFieldSurfaceClipImageFilter.h" #include "mitkImageToSurfaceFilter.h" #include "mitkInteractionConst.h" #include "mitkLabeledImageLookupTable.h" #include "mitkLabeledImageVolumeCalculator.h" #include "mitkLevelWindowProperty.h" #include "mitkLookupTableProperty.h" +#include "mitkNodePredicateProperty.h" +#include "mitkNodePredicateDataType.h" #include "mitkPlane.h" #include "mitkRenderingModeProperty.h" #include "mitkRotationOperation.h" +#include "mitkSurfaceDeformationDataInteractor3D.h" #include "mitkSurfaceVtkMapper3D.h" #include "mitkVtkRepresentationProperty.h" +#include "usModuleRegistry.h" #include "vtkFloatArray.h" #include "vtkPointData.h" #include "vtkProperty.h" const std::string QmitkDeformableClippingPlaneView::VIEW_ID = "org.mitk.views.deformableclippingplane"; QmitkDeformableClippingPlaneView::QmitkDeformableClippingPlaneView() : QmitkFunctionality() , m_MultiWidget(NULL) - , m_ToolManager(NULL) + , m_ReferenceNode(NULL) + , m_WorkingNode(NULL) { - //Current fix for bug 10707. Waiting for a solution of bug 10834. - itk::LightObject::Pointer o; - o = mitk::ClippingPlaneRotationTool::New(); - o = mitk::ClippingPlaneDeformationTool::New(); - o = mitk::ClippingPlaneTranslationTool::New(); } QmitkDeformableClippingPlaneView::~QmitkDeformableClippingPlaneView() { } void QmitkDeformableClippingPlaneView::CreateQtPartControl(QWidget *parent) { // create GUI widgets m_Controls.setupUi(parent); this->CreateConnections(); } void QmitkDeformableClippingPlaneView::StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget) { m_MultiWidget = &stdMultiWidget; } void QmitkDeformableClippingPlaneView::StdMultiWidgetNotAvailable() { m_MultiWidget = NULL; } void QmitkDeformableClippingPlaneView::CreateConnections() { - m_ToolManager = mitk::ToolManager::New(this->GetDefaultDataStorage()); - m_Controls.interactionToolSelectionBox->SetToolManager(*m_ToolManager); - assert(m_ToolManager); - - - - mitk::NodePredicateProperty::Pointer clipPredicate = mitk::NodePredicateProperty::New("clippingPlane",mitk::BoolProperty::New(true)); //set only clipping planes in the list of the selector m_Controls.clippingPlaneSelector->SetDataStorage(this->GetDefaultDataStorage()); m_Controls.clippingPlaneSelector->SetPredicate(clipPredicate); - //Shows and set the tool buttons - m_Controls.interactionToolSelectionBox->SetGenerateAccelerators(true); - m_Controls.interactionToolSelectionBox->SetDisplayedToolGroups("ClippingTool"); - m_Controls.interactionToolSelectionBox->SetLayoutColumns(3); - m_Controls.interactionToolSelectionBox->SetEnabledMode(QmitkToolSelectionBox::EnabledWithWorkingData); //No working data set, yet m_Controls.volumeGroupBox->setEnabled(false); + m_Controls.interactionSelectionBox->setEnabled(false); m_Controls.noSelectedImageLabel->show(); m_Controls.planesWarningLabel->hide(); + connect (m_Controls.translationPushButton, SIGNAL(toggled(bool)), this, SLOT(OnTranslationMode(bool))); + connect (m_Controls.rotationPushButton, SIGNAL(toggled(bool)), this, SLOT(OnRotationMode(bool))); + connect (m_Controls.deformationPushButton, SIGNAL(toggled(bool)), this, SLOT(OnDeformationMode(bool))); connect (m_Controls.createNewPlanePushButton, SIGNAL(clicked()), this, SLOT(OnCreateNewClippingPlane())); connect (m_Controls.updateVolumePushButton, SIGNAL(clicked()), this, SLOT(OnCalculateClippingVolume())); connect (m_Controls.clippingPlaneSelector, SIGNAL(OnSelectionChanged(const mitk::DataNode*)), this, SLOT(OnComboBoxSelectionChanged(const mitk::DataNode*))); } void QmitkDeformableClippingPlaneView::Activated() { QmitkFunctionality::Activated(); } void QmitkDeformableClippingPlaneView::Deactivated() { QmitkFunctionality::Deactivated(); } void QmitkDeformableClippingPlaneView::OnComboBoxSelectionChanged( const mitk::DataNode* node ) { mitk::DataNode* selectedNode = const_cast(node); if( selectedNode != NULL ) { - //remember the active tool - int toolID = m_ToolManager->GetActiveToolID(); + if(m_WorkingNode.IsNotNull()) + selectedNode->SetDataInteractor(m_WorkingNode->GetDataInteractor()); - m_ToolManager->SetWorkingData(selectedNode); - - //reset Tool - m_ToolManager->ActivateTool(-1); - //set tool again with new working data (calls activated() in Tool) - m_ToolManager->ActivateTool(toolID); + m_WorkingNode = selectedNode; } this->UpdateView(); } void QmitkDeformableClippingPlaneView::OnSelectionChanged(mitk::DataNode* node) { std::vector nodes; nodes.push_back(node); this->OnSelectionChanged(nodes); } void QmitkDeformableClippingPlaneView::OnSelectionChanged(std::vector nodes) { bool isClippingPlane(false); for(unsigned int i = 0; i < nodes.size(); ++i) { if(nodes.at(i)->GetBoolProperty("clippingPlane", isClippingPlane)) m_Controls.clippingPlaneSelector->setCurrentIndex( m_Controls.clippingPlaneSelector->Find(nodes.at(i)) ); else { if(dynamic_cast (nodes.at(i)->GetData())&& nodes.at(i)) { - if(m_ToolManager->GetReferenceData(0)!= NULL && nodes.at(i)->GetData()==m_ToolManager->GetReferenceData(0)->GetData()) + if(m_ReferenceNode.IsNotNull() && nodes.at(i)->GetData() == m_ReferenceNode->GetData()) return; - m_ToolManager->SetReferenceData(nodes.at(i)); + m_ReferenceNode =nodes.at(i); } } } this->UpdateView(); } void::QmitkDeformableClippingPlaneView::NodeChanged(const mitk::DataNode* /*node*/) { this->UpdateView(); } void QmitkDeformableClippingPlaneView::NodeRemoved(const mitk::DataNode* node) { bool isClippingPlane(false); if (node->GetBoolProperty("clippingPlane", isClippingPlane)) { if(this->GetAllClippingPlanes()->Size()<=1) { - m_ToolManager->SetWorkingData(NULL); + m_WorkingNode = NULL; this->UpdateView(); } else { if (GetAllClippingPlanes()->front()!= node) this->OnSelectionChanged(GetAllClippingPlanes()->front()); else this->OnSelectionChanged(GetAllClippingPlanes()->ElementAt(1)); } } else { - if(m_ToolManager->GetReferenceData(0)!= NULL) + if(m_ReferenceNode.IsNotNull()) { - if(node->GetData() == m_ToolManager->GetReferenceData(0)->GetData()) + if(node->GetData() == m_ReferenceNode->GetData()) { - m_ToolManager->SetReferenceData(NULL); + m_ReferenceNode = NULL; m_Controls.volumeList->clear(); } this->UpdateView(); } } } void QmitkDeformableClippingPlaneView::UpdateView() { - if (m_ToolManager->GetReferenceData(0)!= NULL) + if (m_ReferenceNode.IsNotNull()) { m_Controls.noSelectedImageLabel->hide(); - m_Controls.selectedImageLabel->setText(QString::fromUtf8(m_ToolManager->GetReferenceData(0)->GetName().c_str())); - if (m_ToolManager->GetWorkingData(0)!= NULL) + m_Controls.selectedImageLabel->setText(QString::fromUtf8(m_ReferenceNode->GetName().c_str())); + + if (m_WorkingNode.IsNotNull()) { bool isSegmentation(false); - m_ToolManager->GetReferenceData(0)->GetBoolProperty("binary", isSegmentation); + m_ReferenceNode->GetBoolProperty("binary", isSegmentation); + m_Controls.interactionSelectionBox->setEnabled(true); + m_Controls.volumeGroupBox->setEnabled(isSegmentation); //clear list --> than search for all shown clipping plans (max 7 planes) m_Controls.selectedVolumePlanesLabel->setText(""); m_Controls.planesWarningLabel->hide(); int volumePlanes=0; mitk::DataStorage::SetOfObjects::ConstPointer allClippingPlanes = this->GetAllClippingPlanes(); for (mitk::DataStorage::SetOfObjects::ConstIterator itPlanes = allClippingPlanes->Begin(); itPlanes != allClippingPlanes->End(); itPlanes++) { bool isVisible(false); itPlanes.Value()->GetBoolProperty("visible",isVisible); if (isVisible) { if (volumePlanes<7) { volumePlanes ++; m_Controls.selectedVolumePlanesLabel->setText(m_Controls.selectedVolumePlanesLabel->text().append(QString::fromStdString(itPlanes.Value()->GetName()+"\n"))); } else { m_Controls.planesWarningLabel->show(); return; } } } } else { m_Controls.volumeGroupBox->setEnabled(false); + m_Controls.interactionSelectionBox->setEnabled(false); m_Controls.selectedVolumePlanesLabel->setText(""); m_Controls.volumeList->clear(); } } else { m_Controls.volumeGroupBox->setEnabled(false); m_Controls.noSelectedImageLabel->show(); m_Controls.selectedImageLabel->setText(""); m_Controls.selectedVolumePlanesLabel->setText(""); m_Controls.planesWarningLabel->hide(); + if(m_WorkingNode.IsNull()) + m_Controls.interactionSelectionBox->setEnabled(false); + else + m_Controls.interactionSelectionBox->setEnabled(true); } } void QmitkDeformableClippingPlaneView::OnCreateNewClippingPlane() { - mitk::DataNode* referenceNode = m_ToolManager->GetReferenceData(0); + mitk::Image::Pointer referenceImage = mitk::Image::New(); //the new clipping plane mitk::Plane::Pointer plane = mitk::Plane::New(); double imageDiagonal = 200; - if (referenceNode != NULL) + if (m_ReferenceNode.IsNotNull()) { - referenceImage = dynamic_cast (referenceNode->GetData()); + referenceImage = dynamic_cast (m_ReferenceNode->GetData()); if (referenceImage.IsNotNull()) { // check if user wants a surface model if(m_Controls.surfaceModelCheckBox->isChecked()) { //Check if there is a surface node from the image. If not, create one bool createSurfaceFromImage(true); - - mitk::TNodePredicateDataType::Pointer isSurface = mitk::TNodePredicateDataType::New(); - mitk::DataStorage::SetOfObjects::ConstPointer childNodes = m_ToolManager->GetDataStorage()->GetDerivations(referenceNode,isSurface, true); + mitk::NodePredicateDataType::Pointer isDwi = mitk::NodePredicateDataType::New("DiffusionImage"); + mitk::NodePredicateDataType::Pointer isSurface = mitk::NodePredicateDataType::New("Surface"); + mitk::DataStorage::SetOfObjects::ConstPointer childNodes = GetDataStorage()->GetDerivations(m_ReferenceNode,isSurface, true); for (mitk::DataStorage::SetOfObjects::ConstIterator itChildNodes = childNodes->Begin(); itChildNodes != childNodes->End(); itChildNodes++) { if (itChildNodes.Value().IsNotNull()) createSurfaceFromImage=false; } if(createSurfaceFromImage) { //Lsg 2: Surface for the 3D-perspective mitk::ImageToSurfaceFilter::Pointer surfaceFilter = mitk::ImageToSurfaceFilter::New(); surfaceFilter->SetInput(referenceImage); surfaceFilter->SetThreshold(1); surfaceFilter->SetSmooth(true); //Downsampling surfaceFilter->SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro); mitk::DataNode::Pointer surfaceNode = mitk::DataNode::New(); surfaceNode->SetData(surfaceFilter->GetOutput()); - surfaceNode->SetProperty("color", referenceNode->GetProperty("color")); + surfaceNode->SetProperty("color", m_ReferenceNode->GetProperty("color")); surfaceNode->SetOpacity(0.5); - surfaceNode->SetName(referenceNode->GetName()); - m_ToolManager->GetDataStorage()->Add(surfaceNode, referenceNode); + surfaceNode->SetName(m_ReferenceNode->GetName()); + GetDataStorage()->Add(surfaceNode, m_ReferenceNode); } } //If an image is selected trim the plane to this. imageDiagonal = referenceImage->GetGeometry()->GetDiagonalLength(); plane->SetOrigin( referenceImage->GetGeometry()->GetCenter()); // Rotate plane mitk::Vector3D rotationAxis; mitk::FillVector3D(rotationAxis, 0.0, 1.0, 0.0); mitk::RotationOperation op(mitk::OpROTATE, referenceImage->GetGeometry()->GetCenter(), rotationAxis, 90.0); plane->GetGeometry()->ExecuteOperation(&op); } } //set some properties for the clipping plane plane->SetExtent(imageDiagonal * 0.9, imageDiagonal * 0.9); plane->SetResolution(64, 64); // Set scalars (for colorization of plane) vtkFloatArray *scalars = vtkFloatArray::New(); scalars->SetName("Distance"); scalars->SetNumberOfComponents(1); for ( unsigned int i = 0; i < plane->GetVtkPolyData(0)->GetNumberOfPoints(); ++i) { scalars->InsertNextValue(-1.0); } plane->GetVtkPolyData(0)->GetPointData()->SetScalars(scalars); plane->GetVtkPolyData(0)->GetPointData()->Update(); mitk::DataNode::Pointer planeNode = mitk::DataNode::New(); planeNode->SetData(plane); std::stringstream planeName; planeName << "ClippingPlane "; planeName << this->GetAllClippingPlanes()->Size() + 1; planeNode->SetName(planeName.str()); planeNode->AddProperty("clippingPlane",mitk::BoolProperty::New(true)); // Make plane pickable planeNode->SetBoolProperty("pickable", true); mitk::SurfaceVtkMapper3D::SetDefaultProperties(planeNode); // Don't include plane in bounding box! planeNode->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false)); // Set lookup table for plane surface visualization vtkSmartPointer lookupTable = vtkSmartPointer::New(); lookupTable->SetHueRange(0.6, 0.0); lookupTable->SetSaturationRange(1.0, 1.0); lookupTable->SetValueRange(1.0, 1.0); lookupTable->SetTableRange(-1.0, 1.0); lookupTable->Build(); mitk::LookupTable::Pointer lut = mitk::LookupTable::New(); lut->SetVtkLookupTable(lookupTable); mitk::LookupTableProperty::Pointer prop = mitk::LookupTableProperty::New(lut); planeNode->SetProperty("LookupTable", prop); planeNode->SetBoolProperty("scalar visibility", true); planeNode->SetBoolProperty("color mode", true); planeNode->SetFloatProperty("ScalarsRangeMinimum", -1.0); planeNode->SetFloatProperty("ScalarsRangeMaximum", 1.0); // Configure material so that only scalar colors are shown planeNode->SetColor(0.0f,0.0f,0.0f); planeNode->SetOpacity(1.0f); planeNode->SetFloatProperty("material.wireframeLineWidth",2.0f); //Set view of plane to wireframe planeNode->SetProperty("material.representation", mitk::VtkRepresentationProperty::New(VTK_WIREFRAME)); //Set the plane as working data for the tools and selected it this->OnSelectionChanged (planeNode); //Add the plane to data storage this->GetDataStorage()->Add(planeNode); //Change the index of the selector to the new generated node m_Controls.clippingPlaneSelector->setCurrentIndex( m_Controls.clippingPlaneSelector->Find(planeNode) ); + m_Controls.interactionSelectionBox->setEnabled(true); + // set crosshair invisible mitk::DataNode* dataNode; dataNode = this->m_MultiWidget->GetWidgetPlane1(); if(dataNode) dataNode->SetVisibility(false); dataNode = this->m_MultiWidget->GetWidgetPlane2(); if(dataNode) dataNode->SetVisibility(false); dataNode = this->m_MultiWidget->GetWidgetPlane3(); if(dataNode) dataNode->SetVisibility(false); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } void QmitkDeformableClippingPlaneView::OnCalculateClippingVolume() { - mitk::DataNode::Pointer imageNode = m_ToolManager->GetReferenceData(0); bool isSegmentation(false); - imageNode->GetBoolProperty("binary", isSegmentation); + m_ReferenceNode->GetBoolProperty("binary", isSegmentation); - if(imageNode.IsNull() || !isSegmentation) + if(m_ReferenceNode.IsNull() || !isSegmentation) { MITK_ERROR << "No segmentation selected! Can't calculate volume"; return; } std::vector clippingPlanes; mitk::DataStorage::SetOfObjects::ConstPointer allClippingPlanes = this->GetAllClippingPlanes(); for (mitk::DataStorage::SetOfObjects::ConstIterator itPlanes = allClippingPlanes->Begin(); itPlanes != allClippingPlanes->End(); itPlanes++) { bool isVisible(false); itPlanes.Value()->GetBoolProperty("visible",isVisible); mitk::Surface* plane = dynamic_cast(itPlanes.Value()->GetData()); if (isVisible && plane) clippingPlanes.push_back(plane); } if (clippingPlanes.empty()) { MITK_ERROR << "No clipping plane selected! Can't calculate volume"; return; } - //deactivate Tools - m_ToolManager->ActivateTool(-1); + // deactivate Tools + m_Controls.translationPushButton->setChecked(false); + m_Controls.rotationPushButton->setChecked(false); + m_Controls.deformationPushButton->setChecked(false); + //Clear the list of volumes, before calculating the new values m_Controls.volumeList->clear(); - imageNode->SetBoolProperty("visible", false); + m_ReferenceNode->SetBoolProperty("visible", false); //set some properties for clipping the image-->Output: labled Image mitk::HeightFieldSurfaceClipImageFilter::Pointer surfaceClipFilter = mitk::HeightFieldSurfaceClipImageFilter::New(); - surfaceClipFilter->SetInput(dynamic_cast (imageNode->GetData())); + surfaceClipFilter->SetInput(dynamic_cast (m_ReferenceNode->GetData())); surfaceClipFilter->SetClippingModeToMultiPlaneValue(); surfaceClipFilter->SetClippingSurfaces(clippingPlanes); surfaceClipFilter->Update(); //delete the old clipped image node mitk::DataStorage::SetOfObjects::ConstPointer oldClippedNode = this->GetDataStorage()->GetSubset(mitk::NodePredicateProperty::New("name", mitk::StringProperty::New("Clipped Image"))); if (oldClippedNode.IsNotNull()) this->GetDataStorage()->Remove(oldClippedNode); //add the new clipped image node mitk::DataNode::Pointer clippedNode = mitk::DataNode::New(); mitk::Image::Pointer clippedImage = surfaceClipFilter->GetOutput(); clippedImage->DisconnectPipeline(); clippedNode->SetData(clippedImage); //clippedNode->SetProperty("helper object", mitk::BoolProperty::New(true)); clippedNode->SetName("Clipped Image"); clippedNode->SetColor(1.0,1.0,1.0); // color property will not be used, labeled image lookuptable will be used instead clippedNode->SetProperty ("use color", mitk::BoolProperty::New(false)); clippedNode->SetOpacity(0.4); this->GetDataStorage()->Add(clippedNode); mitk::LabeledImageVolumeCalculator::Pointer volumeCalculator = mitk::LabeledImageVolumeCalculator::New(); volumeCalculator->SetImage(clippedImage); volumeCalculator->Calculate(); std::vector volumes = volumeCalculator->GetVolumes(); mitk::LabeledImageLookupTable::Pointer lut = mitk::LabeledImageLookupTable::New(); int lablesWithVolume=0; for(unsigned int i = 1; i < volumes.size(); ++i) { if(volumes.at(i)!=0) { lablesWithVolume++; mitk::Color color (GetLabelColor(lablesWithVolume)); lut->SetColorForLabel(i,color.GetRed(), color.GetGreen(), color.GetBlue(), 1.0); QColor qcolor; qcolor.setRgbF(color.GetRed(), color.GetGreen(), color.GetBlue(), 0.7); //output volume as string "x.xx ml" std::stringstream stream; stream<< std::fixed << std::setprecision(2)<setText(QString::fromStdString(stream.str())); item->setBackgroundColor(qcolor); m_Controls.volumeList->addItem(item); } } //set the rendering mode to use the lookup table and level window clippedNode->SetProperty("Image Rendering.Mode", mitk::RenderingModeProperty::New(mitk::RenderingModeProperty::LOOKUPTABLE_LEVELWINDOW_COLOR)); mitk::LookupTableProperty::Pointer lutProp = mitk::LookupTableProperty::New(lut.GetPointer()); clippedNode->SetProperty("LookupTable", lutProp); // it is absolutely important, to use the LevelWindow settings provided by // the LUT generator, otherwise, it is not guaranteed, that colors show // up correctly. clippedNode->SetProperty("levelwindow", mitk::LevelWindowProperty::New(lut->GetLevelWindow())); } mitk::DataStorage::SetOfObjects::ConstPointer QmitkDeformableClippingPlaneView::GetAllClippingPlanes() { mitk::NodePredicateProperty::Pointer clipPredicate= mitk::NodePredicateProperty::New("clippingPlane",mitk::BoolProperty::New(true)); - mitk::DataStorage::SetOfObjects::ConstPointer allPlanes = m_ToolManager->GetDataStorage()->GetSubset(clipPredicate); + mitk::DataStorage::SetOfObjects::ConstPointer allPlanes = GetDataStorage()->GetSubset(clipPredicate); return allPlanes; } mitk::Color QmitkDeformableClippingPlaneView::GetLabelColor(int label) { float red, green, blue; switch ( label % 6 ) { case 0: {red = 1.0; green = 0.0; blue = 0.0; break;} case 1: {red = 0.0; green = 1.0; blue = 0.0; break;} case 2: {red = 0.0; green = 0.0; blue = 1.0;break;} case 3: {red = 1.0; green = 1.0; blue = 0.0;break;} case 4: {red = 1.0; green = 0.0; blue = 1.0;break;} case 5: {red = 0.0; green = 1.0; blue = 1.0;break;} default: {red = 0.0; green = 0.0; blue = 0.0;} } float tmp[3] = { red, green, blue }; double factor; int outerCycleNr = label / 6; int cycleSize = pow(2.0,(int)(log((double)(outerCycleNr))/log( 2.0 ))); if (cycleSize==0) cycleSize = 1; int insideCycleCounter = outerCycleNr % cycleSize; if ( outerCycleNr == 0) factor = 255; else factor = ( 256 / ( 2 * cycleSize ) ) + ( insideCycleCounter * ( 256 / cycleSize ) ); tmp[0]= tmp[0]/256*factor; tmp[1]= tmp[1]/256*factor; tmp[2]= tmp[2]/256*factor; return mitk::Color(tmp); } + +void QmitkDeformableClippingPlaneView::OnTranslationMode(bool check) +{ + if(check) + { + mitk::AffineDataInteractor3D::Pointer affineDataInteractor = mitk::AffineDataInteractor3D::New(); + affineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); + affineDataInteractor->SetEventConfig("AffineTranslationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); + affineDataInteractor->SetDataNode(m_WorkingNode); + } + else + m_WorkingNode->SetDataInteractor(NULL); +} + +void QmitkDeformableClippingPlaneView::OnRotationMode(bool check) +{ + if(check) + { + mitk::AffineDataInteractor3D::Pointer affineDataInteractor = mitk::AffineDataInteractor3D::New(); + affineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); + affineDataInteractor->SetEventConfig("AffineRotationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); + affineDataInteractor->SetDataNode(m_WorkingNode); + } + else + m_WorkingNode->SetDataInteractor(NULL); +} + +void QmitkDeformableClippingPlaneView::OnDeformationMode(bool check) +{ + if(check) + { + mitk::SurfaceDeformationDataInteractor3D::Pointer surfaceDataInteractor = mitk::SurfaceDeformationDataInteractor3D::New(); + surfaceDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); + surfaceDataInteractor->SetEventConfig("AffineDeformationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); + surfaceDataInteractor->SetDataNode(m_WorkingNode); + } + else + m_WorkingNode->SetDataInteractor(NULL); +} diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.h index 16e3b3f8c6..ed2d17e349 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.h @@ -1,96 +1,101 @@ /*=================================================================== 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 _QMITKDEFORMABLECLIPPINGPLANEVIEW_H_INCLUDED #define _QMITKDEFORMABLECLIPPINGPLANEVIEW_H_INCLUDED #include "ui_QmitkDeformableClippingPlaneViewControls.h" #include #include "mitkImage.h" -#include "mitkToolManager.h" typedef itk::RGBPixel< float > Color; /*! * \ingroup org_mitk_gui_qt_deformableSurface * * \brief QmitkDeformableClippingPlaneView * * Document your class here. * * \sa QmitkFunctionality */ class QmitkDeformableClippingPlaneView : public QmitkFunctionality { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: static const std::string VIEW_ID; QmitkDeformableClippingPlaneView(); virtual ~QmitkDeformableClippingPlaneView(); virtual void CreateQtPartControl(QWidget *parent); /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); /// \brief Called when the functionality is activated virtual void Activated(); /// \brief Called when the functionality is deactivated virtual void Deactivated(); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected slots: /// \brief Called when the user clicks the GUI button/makes a selection void OnComboBoxSelectionChanged(const mitk::DataNode* node); void OnCreateNewClippingPlane(); void OnCalculateClippingVolume(); + void OnTranslationMode(bool check); + void OnRotationMode(bool check); + void OnDeformationMode(bool check); + protected: /*! \brief Invoked when the DataManager selection changed */ virtual void OnSelectionChanged(mitk::DataNode* node); virtual void OnSelectionChanged(std::vector nodes); virtual void NodeRemoved(const mitk::DataNode* node); virtual void NodeChanged(const mitk::DataNode* node); void UpdateView(); QmitkStdMultiWidget* m_MultiWidget; Ui::QmitkDeformableClippingPlaneViewControls m_Controls; - mitk::ToolManager::Pointer m_ToolManager; private: mitk::DataStorage::SetOfObjects::ConstPointer GetAllClippingPlanes(); mitk::Color GetLabelColor(int label); + + mitk::DataNode::Pointer m_ReferenceNode; + mitk::DataNode::Pointer m_WorkingNode; }; #endif // _QMITKDEFORMABLECLIPPINGPLANEVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneViewControls.ui b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneViewControls.ui index 53c6b730b9..68899ad83d 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneViewControls.ui +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneViewControls.ui @@ -1,486 +1,564 @@ QmitkDeformableClippingPlaneViewControls 0 0 601 - 677 + 837 0 0 QmitkDeformableSurface 0 0 197 0 0 191 0 0 189 0 0 197 0 0 191 0 0 189 0 0 120 120 120 120 120 120 120 120 120 Please select an image! false false 0 0 Create new clipping plane Qt::RightToLeft ...with surface model true 0 0 0 0 16777215 16777215 Plane 0 0 QComboBox::AdjustToMinimumContentsLength - + + + true + 50 false + + + + + + 0 + 0 + + + + + 0 + 50 + + + + Translation + + + true + + + false + + + true + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + Rotation + + + true + + + true + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + Deformation + + + true + + + true + + + + Qt::Vertical QSizePolicy::Preferred 20 20 0 0 197 0 0 191 0 0 189 0 0 197 0 0 191 0 0 189 0 0 120 120 120 120 120 120 120 120 120 Please select less or equal 6 clipping planes! 0 0 0 0 Referenced image 0 0 Clipping planes Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop true 0 0 MS Shell Dlg 2 8 50 false 8 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop Update Volumina Qt::Vertical QSizePolicy::Preferred 20 20 true QmitkDataStorageComboBox QComboBox
QmitkDataStorageComboBox.h
- - QmitkToolSelectionBox - QWidget -
QmitkToolSelectionBox.h
-