diff --git a/Documentation/Doxygen/2-UserManual/MITKPluginManualsList.dox b/Documentation/Doxygen/2-UserManual/MITKPluginManualsList.dox index 215faaecb1..49d79a5712 100644 --- a/Documentation/Doxygen/2-UserManual/MITKPluginManualsList.dox +++ b/Documentation/Doxygen/2-UserManual/MITKPluginManualsList.dox @@ -1,73 +1,72 @@ /** \page PluginListPage MITK Plugin Manuals The plugins and bundles provide much of the extended functionality of MITK. Each encapsulates a solution to a problem and associated features. This way one can easily assemble the necessary capabilites for a workflow without adding a lot of bloat, by combining plugins as needed. */ diff --git a/Plugins/PluginList.cmake b/Plugins/PluginList.cmake index 0736feb325..1efe75d395 100644 --- a/Plugins/PluginList.cmake +++ b/Plugins/PluginList.cmake @@ -1,82 +1,81 @@ # Plug-ins must be ordered according to their dependencies set(MITK_PLUGINS org.blueberry.core.runtime:ON org.blueberry.core.expressions:OFF org.blueberry.core.commands:OFF org.blueberry.core.jobs:OFF org.blueberry.ui.qt:OFF org.blueberry.ui.qt.help:ON org.blueberry.ui.qt.log:ON org.blueberry.ui.qt.objectinspector:OFF org.mitk.core.services:ON org.mitk.gui.common:ON org.mitk.core.jobs:OFF org.mitk.gui.qt.application:ON org.mitk.gui.qt.ext:OFF org.mitk.gui.qt.extapplication:OFF org.mitk.gui.qt.mitkworkbench.intro:OFF org.mitk.gui.qt.common:ON org.mitk.gui.qt.stdmultiwidgeteditor:ON org.mitk.gui.qt.mxnmultiwidgeteditor:OFF org.mitk.gui.qt.chartExample:OFF org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.datamanagerlight:OFF org.mitk.gui.qt.datastorageviewertest:OFF org.mitk.gui.qt.properties:ON org.mitk.gui.qt.basicimageprocessing:OFF org.mitk.gui.qt.dicombrowser:OFF org.mitk.gui.qt.dicominspector:OFF org.mitk.gui.qt.dosevisualization:OFF org.mitk.gui.qt.geometrytools:OFF org.mitk.gui.qt.igtexamples:OFF org.mitk.gui.qt.igttracking:OFF org.mitk.gui.qt.openigtlink:OFF org.mitk.gui.qt.imagecropper:OFF org.mitk.gui.qt.imagenavigator:ON org.mitk.gui.qt.viewnavigator:OFF org.mitk.gui.qt.materialeditor:OFF org.mitk.gui.qt.measurementtoolbox:OFF org.mitk.gui.qt.moviemaker:OFF org.mitk.gui.qt.pointsetinteraction:OFF org.mitk.gui.qt.pointsetinteractionmultispectrum:OFF org.mitk.gui.qt.python:OFF org.mitk.gui.qt.remeshing:OFF org.mitk.gui.qt.segmentation:OFF - org.mitk.gui.qt.deformableclippingplane:OFF org.mitk.gui.qt.aicpregistration:OFF org.mitk.gui.qt.renderwindowmanager:OFF org.mitk.gui.qt.toftutorial:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.ugvisualization:OFF org.mitk.gui.qt.ultrasound:OFF org.mitk.gui.qt.volumevisualization:OFF org.mitk.gui.qt.eventrecorder:OFF org.mitk.gui.qt.xnat:OFF org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation:OFF org.mitk.gui.qt.overlaymanager:OFF org.mitk.gui.qt.igt.app.hummelprotocolmeasurements:OFF org.mitk.matchpoint.core.helper:OFF org.mitk.gui.qt.matchpoint.algorithm.browser:OFF org.mitk.gui.qt.matchpoint.algorithm.control:OFF org.mitk.gui.qt.matchpoint.mapper:OFF org.mitk.gui.qt.matchpoint.framereg:OFF org.mitk.gui.qt.matchpoint.visualizer:OFF org.mitk.gui.qt.matchpoint.evaluator:OFF org.mitk.gui.qt.matchpoint.manipulator:OFF org.mitk.gui.qt.preprocessing.resampling:OFF org.mitk.gui.qt.cest:OFF org.mitk.gui.qt.fit.demo:OFF org.mitk.gui.qt.fit.inspector:OFF org.mitk.gui.qt.fit.genericfitting:OFF org.mitk.gui.qt.pharmacokinetics.concentration.mri:OFF org.mitk.gui.qt.pharmacokinetics.curvedescriptor:OFF org.mitk.gui.qt.pharmacokinetics.mri:OFF org.mitk.gui.qt.pharmacokinetics.pet:OFF org.mitk.gui.qt.pharmacokinetics.simulation:OFF org.mitk.gui.qt.flowapplication:OFF org.mitk.gui.qt.flow.segmentation:OFF org.mitk.gui.qt.pixelvalue:ON ) diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/CMakeLists.txt b/Plugins/org.mitk.gui.qt.deformableclippingplane/CMakeLists.txt deleted file mode 100644 index 8dd1c33292..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -project(org_mitk_gui_qt_deformableclippingplane) - -mitk_create_plugin( - EXPORT_DIRECTIVE DEFORMABLECLIPPINGPLANE_EXPORT - EXPORTED_INCLUDE_SUFFIXES src -) diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane.dox b/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane.dox deleted file mode 100644 index e4eb5ea593..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane.dox +++ /dev/null @@ -1,73 +0,0 @@ -/** -\page org_mitk_views_deformableclippingplane The Clipping Plane View - -\imageMacro{QmitkClippingPlane_Icon.png,"Icon of the Clipping Plane Plugin",5.00} - - -\imageMacro{QmitkClippingPlane_Overview2.png,"Clipping Plane view",16.00} - -\tableofcontents - -\section org_mitk_views_clippingPlaneManualOverview Overview - -The Clipping Plane view allows you to create clipping planes and calculate the volumina of the divided parts. - - -\section org_mitk_views_clippingPlaneTechnicalIssue Technical Issue - -To use the Update Volumina function your image should be binary. - -\section org_mitk_views_clippingPlaneManualImageSelection Image Selection - -The Clipping Plane view makes use of the Data Manager view to give you an overview of all images, segmentations and clipping planes. - -\imageMacro{QmitkClippingPlane_DataManager.png,"Data Manager is used for selecting the current clipping plane. The reference plane is selected in the drop down box of the control area.",8.00} - -To select the reference plane use the drop down box in the control area of the Clipping Plane view or the Data Manager. The clipping plane selected in the Data Manager is displayed below the drop down box. If no clipping plane exists or none is selected create a new clipping plane by using the "Create new clipping plane" button. -Some items of the graphical user interface might be disabled when no plane is selected. -In any case, the application will give you hints if a selection is needed. - -\section org_mitk_views_clippingPlaneCreating Creating New Clipping Plane - -If you want to create a new clipping plane select an image from the Data Manager and press the button "Create new clipping plane". Optionally you can enable the "...with surface model" option. - -\section org_mitk_views_clippingPlaneInteraction Interaction with the planes -\imageMacro{QmitkClippingPlane_Interaction.png,"The interaction buttons",5.00} - -You have different options to interact with the clipping planes: - -\subsection org_mitk_views_clippingPlaneTranslation Translation - -In Translation mode you can change the position of the clipping plane. - - Click the Translation Button - - Move mouse over the selected clipping plane (the plane changes its color from blue to green) - - Hold mouse-left button and move the mouse orthogonally to the plane - -\subsection org_mitk_views_clippingPlaneRotation Rotation - -In Rotation mode you can change the angle of the clipping plane. - - Click the Rotation Button - - Move mouse over the selected clipping plane (the plane changes its color from blue to green) - - Hold mouse-left button and move the mouse in the direction it should be rotated - -\subsection org_mitk_views_clippingPlaneDeformation Deformation - -In Deformation mode you can change the surface of the clipping plane. - - Click the Deformation Button - - Move mouse over the selected clipping plane (the plane changes its color from blue to green). The deformation area is highlighted in red and yellow. - - On mouse-scrolling you can change the size of the deformation area (Scroll-Down = smaller / Scroll-Up = bigger). - - Hold mouse-left button and move the mouse orthogonally to the plane to deformate the plane - -\section org_mitk_views_clippingPlaneUpdateVolumina Update Volumina - -\imageMacro{QmitkClippingPlane_UpdateVolumina.png,"The 'Update Volumina' button",5.00} - -Calculating the volumina of the segmentation parts, which are divided by the clipping plane(s). - - Create a segmentation (see Segmentation-Manual) - - Create one or more clipping plane(s) - - Use the interaction buttons (Translation, Rotation, Deformation) to adjust the clipping plane for intersecting the segmentation - - (You can decide which planes shouldn't be included for the calculation by changing their visibility to invisible) - - Click button "Update Volumina" button - - The intersected parts are displayed in different colors and their volumina are shown beneath the "Update Volumina" button - -**/ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_DataManager.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_DataManager.png deleted file mode 100644 index d786549d26..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_DataManager.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Icon.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Icon.png deleted file mode 100644 index c8e3ab8953..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Icon.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Interaction.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Interaction.png deleted file mode 100644 index 0ed78e487f..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Interaction.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Overview.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Overview.png deleted file mode 100644 index 3e1de5fb08..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Overview.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Overview2.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Overview2.png deleted file mode 100644 index c261f169b4..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_Overview2.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_UpdateVolumina.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_UpdateVolumina.png deleted file mode 100644 index 11baa0631c..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/documentation/UserManual/QmitkClippingPlane_UpdateVolumina.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/files.cmake b/Plugins/org.mitk.gui.qt.deformableclippingplane/files.cmake deleted file mode 100644 index d6fb308c8c..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/files.cmake +++ /dev/null @@ -1,21 +0,0 @@ -set(CPP_FILES - src/internal/QmitkDeformableClippingPlaneView.cpp - src/internal/mitkPluginActivator.cpp -) - -set(MOC_H_FILES - src/internal/mitkPluginActivator.h - src/internal/QmitkDeformableClippingPlaneView.h -) - -set(UI_FILES - src/internal/QmitkDeformableClippingPlaneViewControls.ui -) - -set(CACHED_RESOURCE_FILES - resources/deformablePlane.png - resources/clipping_plane_translate_48x48.png - resources/clipping_plane_rotate48x48.png - resources/clipping_plane_deform48x48.png - plugin.xml -) diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.deformableclippingplane/manifest_headers.cmake deleted file mode 100644 index b64619ac32..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/manifest_headers.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(Plugin-Name "Clipping Plane") -set(Plugin-Version "1.0.0") -set(Plugin-Vendor "German Cancer Research Center (DKFZ)") -set(Plugin-ContactAddress "https://www.mitk.org") -set(Require-Plugin org.mitk.gui.qt.common org.mitk.gui.qt.datamanager) diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/plugin.xml b/Plugins/org.mitk.gui.qt.deformableclippingplane/plugin.xml deleted file mode 100644 index 09a9fd4c0c..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/plugin.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Allow the clipping of a volume using a deformable plane. - - - - - - - - - - - diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_deform48x48.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_deform48x48.png deleted file mode 100644 index 74af5fa6eb..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_deform48x48.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_rotate48x48.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_rotate48x48.png deleted file mode 100644 index 19018f23fc..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_rotate48x48.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_translate_48x48.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_translate_48x48.png deleted file mode 100644 index 01fe80f023..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_translate_48x48.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/deformablePlane.png b/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/deformablePlane.png deleted file mode 100644 index c8e3ab8953..0000000000 Binary files a/Plugins/org.mitk.gui.qt.deformableclippingplane/resources/deformablePlane.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.cpp b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.cpp deleted file mode 100644 index 6f72a2c5df..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.cpp +++ /dev/null @@ -1,584 +0,0 @@ -/*============================================================================ - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center (DKFZ) -All rights reserved. - -Use of this source code is governed by a 3-clause BSD license that can be -found in the LICENSE file. - -============================================================================*/ - -#include "QmitkDeformableClippingPlaneView.h" - -#include - -// mitk core -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include - -const std::string QmitkDeformableClippingPlaneView::VIEW_ID = "org.mitk.views.deformableclippingplane"; - -QmitkDeformableClippingPlaneView::QmitkDeformableClippingPlaneView() - : QmitkAbstractView() - , m_Controls(new Ui::QmitkDeformableClippingPlaneViewControls) - , m_WorkingNode(nullptr) -{ - auto isImage = mitk::TNodePredicateDataType::New(); - auto isNotHelperObject = mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object", mitk::BoolProperty::New(true))); - - m_IsImagePredicate = mitk::NodePredicateAnd::New(isImage, isNotHelperObject); - - m_IsClippingPlanePredicate = mitk::NodePredicateProperty::New("clippingPlane", mitk::BoolProperty::New(true)); -} - -QmitkDeformableClippingPlaneView::~QmitkDeformableClippingPlaneView() -{ - if (m_WorkingNode.IsNotNull()) - m_WorkingNode->SetDataInteractor(nullptr); -} - -void QmitkDeformableClippingPlaneView::SetFocus() -{ - m_Controls->createNewPlanePushButton->setFocus(); -} - -void QmitkDeformableClippingPlaneView::CreateQtPartControl(QWidget *parent) -{ - m_Controls->setupUi(parent); - - m_Controls->imageSelectionWidget->SetDataStorage(GetDataStorage()); - m_Controls->imageSelectionWidget->SetNodePredicate(m_IsImagePredicate); - m_Controls->imageSelectionWidget->SetSelectionIsOptional(false); - m_Controls->imageSelectionWidget->SetInvalidInfo("Select an image or segmentation."); - m_Controls->imageSelectionWidget->SetPopUpTitel("Select an image or segmentation."); - - m_Controls->clippingPlaneSelector->SetDataStorage(this->GetDataStorage()); - m_Controls->clippingPlaneSelector->SetPredicate(m_IsClippingPlanePredicate); - - m_Controls->volumeGroupBox->setEnabled(false); - m_Controls->interactionSelectionBox->setEnabled(false); - m_Controls->planesWarningLabel->hide(); - - this->CreateConnections(); - - m_Controls->imageSelectionWidget->SetAutoSelectNewNodes(true); -} - -void QmitkDeformableClippingPlaneView::OnCurrentSelectionChanged(const QList& /*nodes*/) -{ - this->UpdateView(); -} - -void QmitkDeformableClippingPlaneView::OnComboBoxSelectionChanged(const mitk::DataNode* node) -{ - this->DeactivateInteractionButtons(); - - auto selectedNode = const_cast(node); - if(nullptr != selectedNode) - { - if(m_WorkingNode.IsNotNull()) - selectedNode->SetDataInteractor(m_WorkingNode->GetDataInteractor()); - - m_WorkingNode = selectedNode; - } - - this->UpdateView(); -} - -void QmitkDeformableClippingPlaneView::OnCreateNewClippingPlane() -{ - this->DeactivateInteractionButtons(); - - auto plane = mitk::Surface::New(); - auto planeSource = vtkSmartPointer::New(); - - planeSource->SetOrigin(-32.0, -32.0, 0.0); - planeSource->SetPoint1(32.0, -32.0, 0.0); - planeSource->SetPoint2(-32.0, 32.0, 0.0); - planeSource->SetResolution(128, 128); - planeSource->Update(); - - plane->SetVtkPolyData(planeSource->GetOutput()); - - mitk::ScalarType imageDiagonal = 200.0; - - auto selectedNode = m_Controls->imageSelectionWidget->GetSelectedNode(); - if (selectedNode.IsNotNull()) - { - auto selectedImage = dynamic_cast(selectedNode->GetData()); - if (nullptr != selectedImage) - { - // 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; - auto isSurface = mitk::NodePredicateDataType::New("Surface"); - auto childNodes = GetDataStorage()->GetDerivations(selectedNode, isSurface, true); - - for (mitk::DataStorage::SetOfObjects::ConstIterator it = childNodes->Begin(); - it != childNodes->End(); it++) - { - if (it.Value().IsNotNull() && it->Value()->GetName() == selectedNode->GetName()) - { - createSurfaceFromImage = false; - it.Value()->SetVisibility(true); - } - } - - if (createSurfaceFromImage) - { - //Lsg 2: Surface for the 3D-perspective - auto surfaceFilter = mitk::ImageToSurfaceFilter::New(); - surfaceFilter->SetInput(selectedImage); - surfaceFilter->SetThreshold(1); - surfaceFilter->SetSmooth(true); - //Downsampling - surfaceFilter->SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro); - - auto surfaceNode = mitk::DataNode::New(); - surfaceNode->SetData(surfaceFilter->GetOutput()); - surfaceNode->SetProperty("color", selectedNode->GetProperty("color")); - surfaceNode->SetOpacity(0.5); - surfaceNode->SetName(selectedNode->GetName()); - this->GetDataStorage()->Add(surfaceNode, selectedNode); - } - } - - //If an image is selected trim the plane to this. - imageDiagonal = selectedImage->GetGeometry()->GetDiagonalLength(); - plane->SetOrigin(selectedImage->GetGeometry()->GetCenter()); - - // Rotate plane - mitk::Vector3D rotationAxis; - mitk::FillVector3D(rotationAxis, 0.0, 1.0, 0.0); - mitk::RotationOperation op(mitk::OpROTATE, selectedImage->GetGeometry()->GetCenter(), rotationAxis, 90.0); - plane->GetGeometry()->ExecuteOperation(&op); - } - } - - // equivalent to the extent and resolution function of the clipping plane - const auto x = imageDiagonal * 0.9; - planeSource->SetOrigin(-x / 2.0, -x / 2.0, 0.0); - planeSource->SetPoint1(x / 2.0, -x / 2.0, 0.0); - planeSource->SetPoint2(-x / 2.0, x / 2.0, 0.0); - planeSource->SetResolution(64, 64); - planeSource->Update(); - - plane->SetVtkPolyData(planeSource->GetOutput()); - - // Set scalars (for colorization of plane) - vtkFloatArray *scalars = vtkFloatArray::New(); - scalars->SetName("Distance"); - scalars->SetNumberOfComponents(1); - - const auto numerOfPoints = plane->GetVtkPolyData(0)->GetNumberOfPoints(); - for (std::remove_const_t i = 0; i < plane->GetVtkPolyData(0)->GetNumberOfPoints(); ++i) - { - scalars->InsertNextValue(-1.0); - } - plane->GetVtkPolyData(0)->GetPointData()->SetScalars(scalars); - plane->GetVtkPolyData(0)->GetPointData()->Update(); - - auto 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 - auto lookupTablevtk = vtkSmartPointer::New(); - lookupTablevtk->SetHueRange(0.6, 0.0); - lookupTablevtk->SetSaturationRange(1.0, 1.0); - lookupTablevtk->SetValueRange(1.0, 1.0); - lookupTablevtk->SetTableRange(-1.0, 1.0); - lookupTablevtk->Build(); - - auto lookupTable = mitk::LookupTable::New(); - lookupTable->SetVtkLookupTable(lookupTablevtk); - - auto prop = mitk::LookupTableProperty::New(lookupTable); - - 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)); - - //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); - - if (auto renderWindowPart = dynamic_cast(this->GetRenderWindowPart())) - { - renderWindowPart->EnableSlicingPlanes(false); - } - - mitk::RenderingManager::GetInstance()->RequestUpdateAll(); -} - -void QmitkDeformableClippingPlaneView::OnCalculateClippingVolume() -{ - auto selectedNode = m_Controls->imageSelectionWidget->GetSelectedNode(); - if (selectedNode.IsNull()) - { - MITK_ERROR << "No segmentation selected! Can't calculate volume"; - return; - } - - bool isSegmentation = false; - selectedNode->GetBoolProperty("binary", isSegmentation); - if (!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); - auto plane = dynamic_cast(itPlanes.Value()->GetData()); - - if (isVisible && nullptr != plane) - clippingPlanes.push_back(plane); - } - - if (clippingPlanes.empty()) - { - MITK_ERROR << "No clipping plane selected! Can't calculate volume"; - return; - } - - // deactivate Tools - this->DeactivateInteractionButtons(); - //Clear the list of volumes, before calculating the new values - m_Controls->volumeList->clear(); - - selectedNode->SetBoolProperty("visible", false); - - //set some properties for clipping the image-->Output: labeled Image - mitk::HeightFieldSurfaceClipImageFilter::Pointer surfaceClipFilter = mitk::HeightFieldSurfaceClipImageFilter::New(); - - surfaceClipFilter->SetInput(dynamic_cast(selectedNode->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 - auto clippedNode = mitk::DataNode::New(); - mitk::Image::Pointer clippedImage = surfaceClipFilter->GetOutput(); - clippedImage->DisconnectPipeline(); - clippedNode->SetData(clippedImage); - 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->SetProperty("reslice interpolation", mitk::VtkResliceInterpolationProperty::New(VTK_RESLICE_NEAREST)); - clippedNode->SetOpacity(0.4); - this->GetDataStorage()->Add(clippedNode); - - auto volumeCalculator = mitk::LabeledImageVolumeCalculator::New(); - volumeCalculator->SetImage(clippedImage); - volumeCalculator->Calculate(); - - auto volumes = volumeCalculator->GetVolumes(); - - auto lookupTable = mitk::LabeledImageLookupTable::New(); - int lablesWithVolume = 0; - const auto numberOfVolumes = volumes.size(); - for (std::remove_const_t i = 1; i < numberOfVolumes; ++i) - { - if (0 != volumes[0]) - { - lablesWithVolume++; - - mitk::Color color(GetLabelColor(lablesWithVolume)); - lookupTable->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) << 0.001 * volumes[i] << " ml"; - stream << " ml"; - - auto item = new QListWidgetItem(); - item->setText(QString::fromStdString(stream.str())); - item->setBackground(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(lookupTable.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(lookupTable->GetLevelWindow())); -} - -void QmitkDeformableClippingPlaneView::OnTranslationMode(bool check) -{ - if (check) - { //uncheck all other buttons - m_Controls->rotationPushButton->setChecked(false); - m_Controls->deformationPushButton->setChecked(false); - - mitk::ClippingPlaneInteractor3D::Pointer affineDataInteractor = mitk::ClippingPlaneInteractor3D::New(); - affineDataInteractor->LoadStateMachine("ClippingPlaneInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - affineDataInteractor->SetEventConfig("ClippingPlaneTranslationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - affineDataInteractor->SetDataNode(m_WorkingNode); - } - else - m_WorkingNode->SetDataInteractor(nullptr); -} - -void QmitkDeformableClippingPlaneView::OnRotationMode(bool check) -{ - if (check) - { //uncheck all other buttons - m_Controls->translationPushButton->setChecked(false); - m_Controls->deformationPushButton->setChecked(false); - - mitk::ClippingPlaneInteractor3D::Pointer affineDataInteractor = mitk::ClippingPlaneInteractor3D::New(); - affineDataInteractor->LoadStateMachine("ClippingPlaneInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - affineDataInteractor->SetEventConfig("ClippingPlaneRotationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - affineDataInteractor->SetDataNode(m_WorkingNode); - } - else - m_WorkingNode->SetDataInteractor(nullptr); -} - -void QmitkDeformableClippingPlaneView::OnDeformationMode(bool check) -{ - if (check) - { //uncheck all other buttons - m_Controls->translationPushButton->setChecked(false); - m_Controls->rotationPushButton->setChecked(false); - - mitk::SurfaceDeformationDataInteractor3D::Pointer surfaceDataInteractor = mitk::SurfaceDeformationDataInteractor3D::New(); - surfaceDataInteractor->LoadStateMachine("ClippingPlaneInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - surfaceDataInteractor->SetEventConfig("ClippingPlaneDeformationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt")); - surfaceDataInteractor->SetDataNode(m_WorkingNode); - } - else - m_WorkingNode->SetDataInteractor(nullptr); -} - -void QmitkDeformableClippingPlaneView::CreateConnections() -{ - connect(m_Controls->imageSelectionWidget, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged, - this, &QmitkDeformableClippingPlaneView::OnCurrentSelectionChanged); - connect(m_Controls->translationPushButton, &QPushButton::toggled, - this, &QmitkDeformableClippingPlaneView::OnTranslationMode); - connect(m_Controls->rotationPushButton, &QPushButton::toggled, - this, &QmitkDeformableClippingPlaneView::OnRotationMode); - connect(m_Controls->deformationPushButton, &QPushButton::toggled, - this, &QmitkDeformableClippingPlaneView::OnDeformationMode); - connect(m_Controls->createNewPlanePushButton, &QPushButton::clicked, - this, &QmitkDeformableClippingPlaneView::OnCreateNewClippingPlane); - connect(m_Controls->updateVolumePushButton, &QPushButton::clicked, - this, &QmitkDeformableClippingPlaneView::OnCalculateClippingVolume); - connect(m_Controls->clippingPlaneSelector, &QmitkDataStorageComboBox::OnSelectionChanged, - this, &QmitkDeformableClippingPlaneView::OnComboBoxSelectionChanged); -} - -void QmitkDeformableClippingPlaneView::NodeRemoved(const mitk::DataNode* node) -{ - if (m_IsClippingPlanePredicate->CheckNode(node)) - { - if (this->GetAllClippingPlanes()->Size() <= 1) - { - m_WorkingNode = nullptr; - this->UpdateView(); - } - } -} - -void::QmitkDeformableClippingPlaneView::NodeChanged(const mitk::DataNode*) -{ - this->UpdateView(); -} - -void QmitkDeformableClippingPlaneView::UpdateView() -{ - auto selectedNode = m_Controls->imageSelectionWidget->GetSelectedNode(); - if (selectedNode.IsNotNull()) - { - m_Controls->selectedReferenceImageLabel->setText(QString::fromUtf8(selectedNode->GetName().c_str())); - if (m_WorkingNode.IsNotNull()) - { - bool isSegmentation = false; - selectedNode->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->selectedClippingPlanesLabel->setText(""); - m_Controls->planesWarningLabel->hide(); - int volumePlanes = 0; - - auto 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->selectedClippingPlanesLabel->setText(m_Controls->selectedClippingPlanesLabel->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->selectedClippingPlanesLabel->setText(""); - m_Controls->volumeList->clear(); - } - } - else - { - m_Controls->volumeGroupBox->setEnabled(false); - m_Controls->selectedReferenceImageLabel->setText(""); - m_Controls->selectedClippingPlanesLabel->setText(""); - m_Controls->planesWarningLabel->hide(); - - m_Controls->interactionSelectionBox->setEnabled(m_WorkingNode.IsNotNull()); - } -} - -mitk::DataStorage::SetOfObjects::ConstPointer QmitkDeformableClippingPlaneView::GetAllClippingPlanes() -{ - auto allPlanes = GetDataStorage()->GetSubset(m_IsClippingPlanePredicate); - return allPlanes; -} - -mitk::Color QmitkDeformableClippingPlaneView::GetLabelColor(int label) -{ - std::array color = { 0.0f, 0.0f, 0.0f }; - - switch (label % 6) - { - case 0: // red - color[0] = 1.0f; - break; - case 1: // green - color[1] = 1.0f; - break; - case 2: // blue - color[2] = 1.0f; - break; - case 3: // yellow - color[0] = 1.0f; - color[1] = 1.0f; - break; - case 4: // magenta - color[0] = 1.0f; - color[2] = 1.0f; - break; - case 5: // cyan - color[1] = 1.0f; - color[2] = 1.0f; - default: // black - break; - } - - int outerCycleNr = label / 6; - int cycleSize = std::min(1, static_cast(std::pow(2.0, std::log(outerCycleNr) / std::log(2.0)))); - int insideCycleCounter = outerCycleNr % cycleSize; - - float factor; - if (0 == outerCycleNr) - { - factor = 255.0f; - } - else - { - factor = 256.0f / (2.0f * cycleSize) + insideCycleCounter * (256.0f / cycleSize); - } - - color = { - std::min(1.0f, color[0] / 256.0f * factor), - std::min(1.0f, color[1] / 256.0f * factor), - std::min(1.0f, color[2] / 256.0f * factor) - }; - - return mitk::Color(color.data()); -} - -void QmitkDeformableClippingPlaneView::DeactivateInteractionButtons() -{ - m_Controls->translationPushButton->setChecked(false); - m_Controls->rotationPushButton->setChecked(false); - m_Controls->deformationPushButton->setChecked(false); -} diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.h b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.h deleted file mode 100644 index 9b2a17dccb..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.h +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================ - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center (DKFZ) -All rights reserved. - -Use of this source code is governed by a 3-clause BSD license that can be -found in the LICENSE file. - -============================================================================*/ - -#ifndef QmitkDeformableClippingPlaneView_h -#define QmitkDeformableClippingPlaneView_h - -#include - -#include -#include -#include -#include - -typedef itk::RGBPixel< float > Color; - -/** - * @brief - */ -class QmitkDeformableClippingPlaneView : public QmitkAbstractView -{ - Q_OBJECT - -public: - - static const std::string VIEW_ID; - - QmitkDeformableClippingPlaneView(); - ~QmitkDeformableClippingPlaneView() override; - - void SetFocus() override; - -private Q_SLOTS: - - void OnCurrentSelectionChanged(const QList& nodes); - void OnComboBoxSelectionChanged(const mitk::DataNode* node); - void OnCreateNewClippingPlane(); - void OnCalculateClippingVolume(); - - void OnTranslationMode(bool check); - void OnRotationMode(bool check); - void OnDeformationMode(bool check); - -private: - - void CreateQtPartControl(QWidget *parent) override; - virtual void CreateConnections(); - - void NodeRemoved(const mitk::DataNode* node) override; - void NodeChanged(const mitk::DataNode* node) override; - - void UpdateView(); - - mitk::DataStorage::SetOfObjects::ConstPointer GetAllClippingPlanes(); - mitk::Color GetLabelColor(int label); - void DeactivateInteractionButtons(); - - Ui::QmitkDeformableClippingPlaneViewControls* m_Controls; - - mitk::NodePredicateAnd::Pointer m_IsImagePredicate; - mitk::NodePredicateProperty::Pointer m_IsClippingPlanePredicate; - - mitk::DataNode::Pointer m_WorkingNode; - -}; - -#endif diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneViewControls.ui b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneViewControls.ui deleted file mode 100644 index f19a2edcc3..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneViewControls.ui +++ /dev/null @@ -1,429 +0,0 @@ - - - QmitkDeformableClippingPlaneViewControls - - - - 0 - 0 - 300 - 600 - - - - - 0 - 0 - - - - Deformable surface - - - - - - - - Selected image - - - - - - - - 0 - 0 - - - - - 0 - 40 - - - - - - - - - - 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 - - - - - 20 - 50 - - - - Translation - - - - - - - :/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_translate_48x48.png:/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_translate_48x48.png - - - - 32 - 32 - - - - true - - - false - - - false - - - - - - - - 0 - 0 - - - - - 20 - 50 - - - - Rotation - - - - - - - :/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_rotate48x48.png:/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_rotate48x48.png - - - - 32 - 32 - - - - true - - - false - - - - - - - - 0 - 0 - - - - - 20 - 50 - - - - Deformation - - - - - - - :/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_deform48x48.png:/org.mitk.gui.qt.deformableclippingplane/resources/clipping_plane_deform48x48.png - - - - 32 - 32 - - - - true - - - false - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - - - - - 0 - 0 - - - - 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 - - - - - - - - - 8 - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - - - Update Volumina - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - true - - - - 0 - 0 - - - - - - - - - - - - - QmitkSingleNodeSelectionWidget - QWidget -
QmitkSingleNodeSelectionWidget.h
-
- - QmitkDataStorageComboBox - QComboBox -
QmitkDataStorageComboBox.h
-
-
- - -
diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.cpp b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.cpp deleted file mode 100644 index 6fdaaa8cdd..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================ - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center (DKFZ) -All rights reserved. - -Use of this source code is governed by a 3-clause BSD license that can be -found in the LICENSE file. - -============================================================================*/ - -#include "mitkPluginActivator.h" -#include "QmitkDeformableClippingPlaneView.h" - -void mitk::PluginActivator::start(ctkPluginContext *context) -{ - BERRY_REGISTER_EXTENSION_CLASS(QmitkDeformableClippingPlaneView, context) -} - -void mitk::PluginActivator::stop(ctkPluginContext *) -{ -} diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.h deleted file mode 100644 index 0adc31438c..0000000000 --- a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.h +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================ - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center (DKFZ) -All rights reserved. - -Use of this source code is governed by a 3-clause BSD license that can be -found in the LICENSE file. - -============================================================================*/ - -#ifndef mitkPluginActivator_h -#define mitkPluginActivator_h - -#include - -namespace mitk -{ - class PluginActivator : public QObject, public ctkPluginActivator - { - Q_OBJECT - Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_deformableclippingplane") - Q_INTERFACES(ctkPluginActivator) - - public: - void start(ctkPluginContext *context) override; - void stop(ctkPluginContext *context) override; - }; -} - -#endif