diff --git a/Modules/DataTypesExt/Resources/Interactions/AffineTranslationConfig.xml b/Modules/DataTypesExt/Resources/Interactions/AffineConfig.xml similarity index 100% rename from Modules/DataTypesExt/Resources/Interactions/AffineTranslationConfig.xml rename to Modules/DataTypesExt/Resources/Interactions/AffineConfig.xml diff --git a/Modules/DataTypesExt/Resources/Interactions/AffineRotationConfig.xml b/Modules/DataTypesExt/Resources/Interactions/AffineRotationConfig.xml deleted file mode 100644 index fb9c6fe6d1..0000000000 --- a/Modules/DataTypesExt/Resources/Interactions/AffineRotationConfig.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/Modules/DataTypesExt/files.cmake b/Modules/DataTypesExt/files.cmake index d84459eb02..8333dbac6f 100644 --- a/Modules/DataTypesExt/files.cmake +++ b/Modules/DataTypesExt/files.cmake @@ -1,44 +1,43 @@ set(CPP_FILES mitkAffineDataInteractor3D.cpp mitkApplyDiffImageOperation.cpp mitkBoundingObject.cpp mitkBoundingObjectGroup.cpp mitkCellOperation.cpp mitkClippingPlaneInteractor3D.cpp mitkColorSequence.cpp mitkColorSequenceCycleH.cpp mitkColorSequenceRainbow.cpp mitkCompressedImageContainer.cpp mitkCone.cpp mitkCuboid.cpp mitkCylinder.cpp mitkDataStorageSelection.cpp mitkEllipsoid.cpp mitkGridRepresentationProperty.cpp mitkGridVolumeMapperProperty.cpp mitkLabeledImageLookupTable.cpp mitkLabeledImageVolumeCalculator.cpp mitkLineOperation.cpp mitkLookupTableSource.cpp mitkMesh.cpp mitkMultiStepper.cpp mitkOrganTypeProperty.cpp mitkPlane.cpp mitkSurfaceDeformationDataInteractor3D.cpp mitkUnstructuredGrid.cpp mitkUnstructuredGridSource.cpp mitkVideoSource.cpp Internal/mitkColorConversions.cpp ) set(RESOURCE_FILES Interactions/AffineInteraction3D.xml - Interactions/AffineTranslationConfig.xml - Interactions/AffineRotationConfig.xml + Interactions/AffineConfig.xml Interactions/ClippingPlaneInteraction3D.xml Interactions/ClippingPlaneTranslationConfig.xml Interactions/ClippingPlaneRotationConfig.xml Interactions/ClippingPlaneDeformationConfig.xml ) diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.cpp b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.cpp index 8ca2d970c6..ee781fb27e 100644 --- a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.cpp +++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.cpp @@ -1,139 +1,138 @@ /*=================================================================== 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 +//Blueberry #include #include -// Qmitk +//Qmitk #include "QmitkGeometryToolsView.h" -// Qt -#include - -//mitk image +//mitk #include #include + +//micro services #include #include const std::string QmitkGeometryToolsView::VIEW_ID = "org.mitk.views.geometrytools"; void QmitkGeometryToolsView::SetFocus() { m_Controls.m_AddInteractor->setFocus(); } void QmitkGeometryToolsView::CreateQtPartControl( QWidget *parent ) { m_Controls.setupUi( parent ); connect( m_Controls.m_AddInteractor, SIGNAL(clicked()), this, SLOT(AddInteractor()) ); connect( m_Controls.m_RemoveInteractor, SIGNAL(clicked()), this, SLOT(RemoveInteractor()) ); connect( m_Controls.m_TranslationStep, SIGNAL(valueChanged(double)), this, SLOT(OnTranslationSpinBoxChanged(double)) ); connect( m_Controls.m_RotationStep, SIGNAL(valueChanged(double)), this, SLOT(OnRotationSpinBoxChanged(double)) ); connect( m_Controls.m_ScaleFactor, SIGNAL(valueChanged(double)), this, SLOT(OnScaleSpinBoxChanged(double)) ); connect( m_Controls.m_UsageInfoCheckBox, SIGNAL(clicked(bool)), this, SLOT(OnUsageInfoBoxChanged(bool)) ); m_Controls.m_UsageInfo->hide(); } void QmitkGeometryToolsView::OnUsageInfoBoxChanged(bool flag) { m_Controls.m_UsageInfo->setVisible(flag); } void QmitkGeometryToolsView::OnSelectionChanged( berry::IWorkbenchPart::Pointer /*source*/, const QList& nodes ) { foreach( mitk::DataNode::Pointer node, nodes ) { if( node.IsNotNull() ) { m_Controls.m_AddInteractor->setEnabled( true ); return; } } m_Controls.m_AddInteractor->setEnabled( false ); } void QmitkGeometryToolsView::AddInteractor() { QList nodes = this->GetDataManagerSelection(); foreach( mitk::DataNode::Pointer node, nodes ) { if( node.IsNotNull() ) { mitk::AffineDataInteractor3D::Pointer affineDataInteractor = mitk::AffineDataInteractor3D::New(); affineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - affineDataInteractor->SetEventConfig("AffineTranslationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); + affineDataInteractor->SetEventConfig("AffineConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); affineDataInteractor->SetDataNode(node); node->SetBoolProperty("pickable", true); node->SetFloatProperty("AffineDataInteractor3D.Translation Step Size", m_Controls.m_TranslationStep->value()); node->SetFloatProperty("AffineDataInteractor3D.Rotation Step Size", m_Controls.m_RotationStep->value()); node->SetFloatProperty("AffineDataInteractor3D.Scale Step Size", m_Controls.m_ScaleFactor->value()); } } } void QmitkGeometryToolsView::RemoveInteractor() { QList nodes = this->GetDataManagerSelection(); foreach( mitk::DataNode::Pointer node, nodes ) { if( (node.IsNotNull()) && (node->GetDataInteractor().IsNotNull()) ) { node->SetDataInteractor(NULL); } } } void QmitkGeometryToolsView::OnTranslationSpinBoxChanged(double step) { QList nodes = this->GetDataManagerSelection(); foreach( mitk::DataNode::Pointer node, nodes ) { if( node.IsNotNull() && (node->GetDataInteractor().IsNotNull()) ) { node->SetFloatProperty("AffineDataInteractor3D.Translation Step Size", step); } } } void QmitkGeometryToolsView::OnRotationSpinBoxChanged(double step) { QList nodes = this->GetDataManagerSelection(); foreach( mitk::DataNode::Pointer node, nodes ) { if( node.IsNotNull() && (node->GetDataInteractor().IsNotNull()) ) { node->SetFloatProperty("AffineDataInteractor3D.Rotation Step Size", step); } } } void QmitkGeometryToolsView::OnScaleSpinBoxChanged(double factor) { QList nodes = this->GetDataManagerSelection(); foreach( mitk::DataNode::Pointer node, nodes ) { if( node.IsNotNull() && (node->GetDataInteractor().IsNotNull()) ) { node->SetFloatProperty("AffineDataInteractor3D.Scale Step Size", factor); } } } diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h index f7adeec255..98bc50632e 100644 --- a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h +++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h @@ -1,69 +1,85 @@ /*=================================================================== 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 QmitkGeometryToolsView_h #define QmitkGeometryToolsView_h #include #include #include #include "ui_QmitkGeometryToolsViewControls.h" - /** - \brief QmitkGeometryToolsView + \brief QmitkGeometryToolsView to modify geometry of mitkBaseData via interaction. + + \warning This is an experimental view to play with the geometry of all mitkBaseDatas. + The current implementation allows to translate, rotate and scale objects with the + keyboard. - \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. + \warning Scaling is not supported for images, yet, and will not happen in coordinate origin. + \warning Surfaces \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class QmitkGeometryToolsView : 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; protected slots: - void RemoveInteractor(); + /** + * @brief Add/remove the affine interactor. + */ void AddInteractor(); + void RemoveInteractor(); + + /** + * @brief Slots to adapt the step size for interaction. + */ void OnRotationSpinBoxChanged(double step); void OnScaleSpinBoxChanged(double factor); void OnTranslationSpinBoxChanged(double step); + + /** + * @brief OnUsageInfoBoxChanged show help. + * @param flag yes/no. + */ void OnUsageInfoBoxChanged(bool flag); protected: virtual void CreateQtPartControl(QWidget *parent); virtual void SetFocus(); /// \brief called by QmitkFunctionality when DataManager's selection has changed virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, const QList& nodes ); Ui::QmitkGeometryToolsViewControls m_Controls; }; #endif // QmitkGeometryToolsView_h diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsViewControls.ui b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsViewControls.ui index eb52a47f73..346390e752 100644 --- a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsViewControls.ui +++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsViewControls.ui @@ -1,401 +1,408 @@ QmitkGeometryToolsViewControls 0 0 372 - 584 + 607 0 0 QmitkTemplate - Keyboard Mode + Keyboard Mode (default) Remove Interactor - Mouse Mode + Mouse Mode (not implemented, yet) Rotation step size (°) 360.000000000000000 1.000000000000000 Scale factor (%) 200.000000000000000 0.100000000000000 0.100000000000000 - Scale in origin + Scale in origin (not implemented, yet) true Show usage information :/org.mitk.gui.qt.geometrytools/resources/key_up.png :/org.mitk.gui.qt.geometrytools/resources/key_shift.png + :/org.mitk.gui.qt.geometrytools/resources/key_up.png + :/org.mitk.gui.qt.geometrytools/resources/key_right.png :/org.mitk.gui.qt.geometrytools/resources/key_left.png :/org.mitk.gui.qt.geometrytools/resources/key_up.png + <html><head/><body><p>Translate <br/>Coronal</p></body></html> :/org.mitk.gui.qt.geometrytools/resources/key_down.png :/org.mitk.gui.qt.geometrytools/resources/key_ctrl.png <html><head/><body><p>Rotate <br/>Coronal</p></body></html> :/org.mitk.gui.qt.geometrytools/resources/key_ctrl.png :/org.mitk.gui.qt.geometrytools/resources/key_down.png <html><head/><body><p>Rotate <br/>Sagittal/Axial</p></body></html> + :/org.mitk.gui.qt.geometrytools/resources/key_down.png :/org.mitk.gui.qt.geometrytools/resources/key_down.png :/org.mitk.gui.qt.geometrytools/resources/key_down.png :/org.mitk.gui.qt.geometrytools/resources/key_shift.png :/org.mitk.gui.qt.geometrytools/resources/key_up.png <html><head/><body><p>Translate <br/>Sagittal/Axial</p></body></html> :/org.mitk.gui.qt.geometrytools/resources/key_left.png - Scale + Scale* :/org.mitk.gui.qt.geometrytools/resources/key_plus.png :/org.mitk.gui.qt.geometrytools/resources/key_dash.png + + + + *currently does not work with images + + + Do image processing Add Interactor Translation step size (mm) 2 1000.000000000000000 1.000000000000000 Qt::Vertical 20 40