diff --git a/CMake/BuildConfigurations/Default.cmake b/CMake/BuildConfigurations/Default.cmake index 4faffa7f12..700e7efd48 100644 --- a/CMake/BuildConfigurations/Default.cmake +++ b/CMake/BuildConfigurations/Default.cmake @@ -1,23 +1,24 @@ set(MITK_CONFIG_PACKAGES ACVD Qt5 BLUEBERRY ) set(MITK_CONFIG_PLUGINS org.mitk.gui.qt.mitkworkbench.intro org.mitk.gui.qt.datamanager org.mitk.gui.qt.stdmultiwidgeteditor org.mitk.gui.qt.dicombrowser org.mitk.gui.qt.imagenavigator org.mitk.gui.qt.measurementtoolbox org.mitk.gui.qt.properties org.mitk.gui.qt.segmentation org.mitk.gui.qt.volumevisualization org.mitk.planarfigure org.mitk.gui.qt.moviemaker org.mitk.gui.qt.pointsetinteraction org.mitk.gui.qt.remeshing org.mitk.gui.qt.viewnavigator org.mitk.gui.qt.imagecropper + org.mitk.gui.qt.pixelvalue ) diff --git a/Modules/ContourModel/Algorithms/mitkContourModelUtils.h b/Modules/ContourModel/Algorithms/mitkContourModelUtils.h index 50272c7dd5..e97d315291 100644 --- a/Modules/ContourModel/Algorithms/mitkContourModelUtils.h +++ b/Modules/ContourModel/Algorithms/mitkContourModelUtils.h @@ -1,152 +1,155 @@ /*============================================================================ 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 mitkContourModelUtils_h #define mitkContourModelUtils_h #include #include #include #include namespace mitk { /** * \brief Helpful methods for working with contours and images * * */ class MITKCONTOURMODEL_EXPORT ContourModelUtils : public itk::Object { public: mitkClassMacroItkParent(ContourModelUtils, itk::Object); /** \brief Projects a contour onto an image point by point. Converts from world to index coordinates. \param slice \param contourIn3D */ static ContourModel::Pointer ProjectContourTo2DSlice(const Image *slice, const ContourModel *contourIn3D); /** \brief Projects a slice index coordinates of a contour back into world coordinates. \param sliceGeometry \param contourIn2D */ static ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry, const ContourModel *contourIn2D); /** \brief Fill a contour in a 2D slice with a specified pixel value. This version always uses the contour of time step 0 and fills the image. \deprecated Ths function is deprecated. Use FillContourInSlice2() (in conjunction e.g. with TransferLabelContent()) instead. \pre sliceImage points to a valid instance \pre projectedContour points to a valid instance */ [[deprecated]] static void FillContourInSlice(const ContourModel *projectedContour, Image *sliceImage, const Image* workingImage, int paintingPixelValue = 1); /** \brief Fill a contour in a 2D slice with a specified pixel value. This overloaded version uses the contour at the passed contourTimeStep to fill the passed image slice. \deprecated Ths function is deprecated. Use FillContourInSlice2() (in conjunction e.g. with TransferLabelContent()) instead. \pre sliceImage points to a valid instance \pre projectedContour points to a valid instance */ [[deprecated]] static void FillContourInSlice(const ContourModel *projectedContour, TimeStepType contourTimeStep, Image *sliceImage, const Image* workingImage, int paintingPixelValue = 1); /** \brief Fill a contour in a 2D slice with a specified pixel value. This version always uses the contour of time step 0 and fills the image. \param projectedContour Pointer to the contour that should be projected. \param sliceImage Pointer to the image which content should be altered by adding the contour with the specified paintingPixelValue. + \param paintingPixelValue \pre sliceImage points to a valid instance \pre projectedContour points to a valid instance */ static void FillContourInSlice2(const ContourModel* projectedContour, Image* sliceImage, int paintingPixelValue = 1); /** \brief Fill a contour in a 2D slice with a specified pixel value. This overloaded version uses the contour at the passed contourTimeStep to fill the passed image slice. \param projectedContour Pointer to the contour that should be projected. + \param contourTimeStep \param sliceImage Pointer to the image which content should be altered by + \param paintingPixelValue adding the contour with the specified paintingPixelValue. \pre sliceImage points to a valid instance \pre projectedContour points to a valid instance */ static void FillContourInSlice2(const ContourModel* projectedContour, TimeStepType contourTimeStep, Image* sliceImage, int paintingPixelValue = 1); /** \brief Fills the paintingPixelValue into every pixel of resultImage as indicated by filledImage. If a LableSet image is specified it also by incorporating the rules of LabelSet images when filling the content. \param filledImage Pointer to the image content that should be checked to decied of a pixel in resultImage should be filled with paintingPixelValue or not. \param resultImage Pointer to the image content that should be overwritten guided by the content of filledImage. \param image Pointer to an mitk image that allows to define the LabelSet image which states steer the filling process. If an LabelSet instance is passed its states (e.g. locked labels etc...) will be used. If nullptr or an normal image is passed, then simply any pixel position indicated by filledImage will be overwritten. \param paintingPixelValue the pixelvalue/label that should be used in the result image when filling. \param fillForegroundThreshold The threshold value that decides if a pixel in the filled image counts as foreground (>=fillForegroundThreshold) or not. \deprecated Ths function is deprecated. Use TransferLabelContent() instead. */ [[deprecated]] static void FillSliceInSlice(vtkSmartPointer filledImage, vtkSmartPointer resultImage, const Image* image, int paintingPixelValue, double fillForegroundThreshold = 1.0); /** \brief Move the contour in time step 0 to to a new contour model at the given time step. */ static ContourModel::Pointer MoveZerothContourTimeStep(const ContourModel *contour, TimeStepType timeStep); /** \brief Retrieves the active pixel value of a (labelset) image. If the image is basic image, the pixel value 1 (one) will be returned. If the image is actually a labelset image, the pixel value of the active label of the active layer will be returned. \param workingImage The (labelset) image to retrieve the active pixel value of. */ static int GetActivePixelValue(const Image* workingImage); protected: ContourModelUtils(); ~ContourModelUtils() override; }; } #endif diff --git a/Plugins/PluginList.cmake b/Plugins/PluginList.cmake index 53935ebd4f..8b336a0d7e 100644 --- a/Plugins/PluginList.cmake +++ b/Plugins/PluginList.cmake @@ -1,88 +1,89 @@ # 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.planarfigure:ON org.mitk.core.ext:OFF 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.cmdlinemodules: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.semanticrelations:OFF org.mitk.gui.qt.toftutorial:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.tubegraph: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.classificationsegmentation: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.radiomics: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.mri:OFF org.mitk.gui.qt.pharmacokinetics.pet:OFF org.mitk.gui.qt.pharmacokinetics.simulation:OFF org.mitk.gui.qt.pharmacokinetics.curvedescriptor:OFF org.mitk.gui.qt.pharmacokinetics.concentration.mri: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.extapplication/src/internal/perspectives/QmitkExtDefaultPerspective.cpp b/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkExtDefaultPerspective.cpp index 0420ddfccc..6e8222469f 100644 --- a/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkExtDefaultPerspective.cpp +++ b/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkExtDefaultPerspective.cpp @@ -1,39 +1,41 @@ /*============================================================================ 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 "QmitkExtDefaultPerspective.h" #include "berryIViewLayout.h" QmitkExtDefaultPerspective::QmitkExtDefaultPerspective() { } void QmitkExtDefaultPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout) { QString editorArea = layout->GetEditorArea(); layout->AddView("org.mitk.views.datamanager", berry::IPageLayout::LEFT, 0.21f, editorArea); berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.datamanager"); lo->SetCloseable(false); - layout->AddView("org.mitk.views.imagenavigator", berry::IPageLayout::BOTTOM, 0.5f, "org.mitk.views.datamanager"); + auto folder = layout->CreateFolder("bottomleft", berry::IPageLayout::BOTTOM, 0.72f, "org.mitk.views.datamanager"); + folder->AddView("org.mitk.views.imagenavigator"); + folder->AddView("org.mitk.views.pixelvalue"); layout->AddView("org.mitk.views.viewnavigator", berry::IPageLayout::RIGHT, 0.7f, editorArea); berry::IPlaceholderFolderLayout::Pointer bottomFolder = layout->CreatePlaceholderFolder("bottom", berry::IPageLayout::BOTTOM, 0.7f, editorArea); bottomFolder->AddPlaceholder("org.blueberry.views.logview"); bottomFolder->AddPlaceholder("org.mitk.views.modules"); layout->AddPerspectiveShortcut("org.mitk.mitkworkbench.perspectives.editor"); layout->AddPerspectiveShortcut("org.mitk.mitkworkbench.perspectives.visualization"); } diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/CMakeLists.txt b/Plugins/org.mitk.gui.qt.pixelvalue/CMakeLists.txt new file mode 100644 index 0000000000..02482dcdf5 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/CMakeLists.txt @@ -0,0 +1,7 @@ +project(org_mitk_gui_qt_pixelvalue) + +mitk_create_plugin( + EXPORT_DIRECTIVE MITK_QT_PIXELVALUE + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDS MitkQtWidgets +) diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/documentation/UserManual/PixelValueIcon.png b/Plugins/org.mitk.gui.qt.pixelvalue/documentation/UserManual/PixelValueIcon.png new file mode 100644 index 0000000000..563f128049 Binary files /dev/null and b/Plugins/org.mitk.gui.qt.pixelvalue/documentation/UserManual/PixelValueIcon.png differ diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/documentation/UserManual/QmitkPixelValue.dox b/Plugins/org.mitk.gui.qt.pixelvalue/documentation/UserManual/QmitkPixelValue.dox new file mode 100644 index 0000000000..df1a050900 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/documentation/UserManual/QmitkPixelValue.dox @@ -0,0 +1,7 @@ +/** +\page org_mitk_views_pixelvalue The Pixel Value View + +\imageMacro{PixelValueIcon.png,"Icon of the Pixel Value Plugin.",2.00} + +This is the pixel value plugin. It shows the value of the selected pixel in images. +*/ diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/files.cmake b/Plugins/org.mitk.gui.qt.pixelvalue/files.cmake new file mode 100644 index 0000000000..6e6ccf65c4 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/files.cmake @@ -0,0 +1,31 @@ +set(INTERNAL_CPP_FILES + mitkPluginActivator.cpp + QmitkPixelValueView.cpp +) + +set(UI_FILES + src/internal/QmitkPixelValueView.ui +) + +set(MOC_H_FILES + src/internal/mitkPluginActivator.h + src/internal/QmitkPixelValueView.h +) + +set(CACHED_RESOURCE_FILES + resources/PixelValueIcon.svg + plugin.xml +) + +set(QRC_FILES +) + +set(CPP_FILES) + +foreach(file ${SRC_CPP_FILES}) + set(CPP_FILES ${CPP_FILES} src/${file}) +endforeach(file ${SRC_CPP_FILES}) + +foreach(file ${INTERNAL_CPP_FILES}) + set(CPP_FILES ${CPP_FILES} src/internal/${file}) +endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.pixelvalue/manifest_headers.cmake new file mode 100644 index 0000000000..77bcd70869 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "MITK Pixel Value") +set(Plugin-Version "0.1") +set(Plugin-Vendor "German Cancer Research Center (DKFZ)") +set(Plugin-ContactAddress "https://www.mitk.org") +set(Require-Plugin org.mitk.gui.qt.common) diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/plugin.xml b/Plugins/org.mitk.gui.qt.pixelvalue/plugin.xml new file mode 100644 index 0000000000..71019f28df --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/plugin.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/resources/PixelValueIcon.svg b/Plugins/org.mitk.gui.qt.pixelvalue/resources/PixelValueIcon.svg new file mode 100644 index 0000000000..a7def0a8f9 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/resources/PixelValueIcon.svg @@ -0,0 +1 @@ + diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.cpp b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.cpp new file mode 100644 index 0000000000..be39b1f658 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.cpp @@ -0,0 +1,187 @@ +/*============================================================================ + +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 "QmitkPixelValueView.h" + +#include +#include +#include +#include +#include + +#include + +const std::string QmitkPixelValueView::VIEW_ID = "org.mitk.views.pixelvalue"; + +QmitkPixelValueView::QmitkPixelValueView(QObject*) + : m_Ui(new Ui::QmitkPixelValueView) +{ +} + +QmitkPixelValueView::~QmitkPixelValueView() +{ +} + +void QmitkPixelValueView::CreateQtPartControl(QWidget* parent) +{ + m_Ui->setupUi(parent); + + this->m_SliceNavigationListener.RenderWindowPartActivated(this->GetRenderWindowPart()); + connect(&m_SliceNavigationListener, &QmitkSliceNavigationListener::SelectedPositionChanged, this, &QmitkPixelValueView::OnSelectedPositionChanged); + connect(&m_SliceNavigationListener, &QmitkSliceNavigationListener::SelectedTimePointChanged, this, &QmitkPixelValueView::OnSelectedTimePointChanged); + + this->Update(); +} + +void QmitkPixelValueView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) +{ + this->m_SliceNavigationListener.RenderWindowPartActivated(renderWindowPart); +} + +void QmitkPixelValueView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) +{ + this->m_SliceNavigationListener.RenderWindowPartDeactivated(renderWindowPart); +} + +void QmitkPixelValueView::OnSelectedPositionChanged(const mitk::Point3D&) +{ + this->Update(); +} + +void QmitkPixelValueView::OnSelectedTimePointChanged(const mitk::TimePointType&) +{ + this->Update(); +} + +void QmitkPixelValueView::NodeChanged(const mitk::DataNode*) +{ + this->Update(); +} + +void QmitkPixelValueView::Update() +{ + const auto position = m_SliceNavigationListener.GetCurrentSelectedPosition(); + const auto timePoint = m_SliceNavigationListener.GetCurrentSelectedTimePoint(); + + auto isImageData = mitk::TNodePredicateDataType::New(); + auto nodes = GetDataStorage()->GetSubset(isImageData); + + if (nodes.IsNull()) + { + this->Clear(); + return; + } + + mitk::Image::Pointer image; + mitk::DataNode::Pointer topParentNode; + + int component = 0; + + auto node = mitk::FindTopmostVisibleNode(nodes, position, timePoint, nullptr); + + if (node.IsNull()) + { + this->Clear(); + return; + } + + bool isBinary = false; + node->GetBoolProperty("binary", isBinary); + + if (isBinary) + { + auto parentNodes = GetDataStorage()->GetSources(node, nullptr, true); + + if (!parentNodes->empty()) + topParentNode = FindTopmostVisibleNode(nodes, position, timePoint, nullptr); + + if (topParentNode.IsNotNull()) + { + image = dynamic_cast(topParentNode->GetData()); + topParentNode->GetIntProperty("Image.Displayed Component", component); + } + else + { + image = dynamic_cast(node->GetData()); + node->GetIntProperty("Image.Displayed Component", component); + } + } + else + { + image = dynamic_cast(node->GetData()); + node->GetIntProperty("Image.Displayed Component", component); + } + + if (image.IsNotNull()) + { + m_Ui->imageNameLineEdit->setText(QString::fromStdString(node->GetName())); + + itk::Index<3> index; + image->GetGeometry()->WorldToIndex(position, index); + + auto pixelType = image->GetChannelDescriptor().GetPixelType().GetPixelType(); + + if (pixelType == itk::IOPixelEnum::RGB || pixelType == itk::IOPixelEnum::RGBA) + { + m_Ui->pixelValueLineEdit->setText(QString::fromStdString(mitk::ConvertCompositePixelValueToString(image, index))); + return; + } + + if (pixelType == itk::IOPixelEnum::DIFFUSIONTENSOR3D || pixelType == itk::IOPixelEnum::SYMMETRICSECONDRANKTENSOR) + { + m_Ui->pixelValueLineEdit->setText(QStringLiteral("See ODF Details view.")); + return; + } + + mitk::ScalarType pixelValue = 0.0; + + mitkPixelTypeMultiplex5( + mitk::FastSinglePixelAccess, + image->GetChannelDescriptor().GetPixelType(), + image, + image->GetVolumeData(image->GetTimeGeometry()->TimePointToTimeStep(timePoint)), + index, + pixelValue, + component); + + std::ostringstream stream; + stream.imbue(std::locale::classic()); + stream.precision(2); + + if (fabs(pixelValue) > 1000000 || fabs(pixelValue) < 0.01) + { + stream << std::scientific; + } + else + { + stream << std::fixed; + } + + stream << pixelValue; + + m_Ui->pixelValueLineEdit->setText(QString::fromStdString(stream.str())); + } + else + { + this->Clear(); + } +} + +void QmitkPixelValueView::Clear() +{ + m_Ui->imageNameLineEdit->clear(); + m_Ui->pixelValueLineEdit->clear(); +} + +void QmitkPixelValueView::SetFocus() +{ +} diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.h b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.h new file mode 100644 index 0000000000..0066df315e --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.h @@ -0,0 +1,56 @@ +/*============================================================================ + +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 QmitkPixelValueView_h +#define QmitkPixelValueView_h + +#include +#include +#include + +namespace Ui +{ + class QmitkPixelValueView; +} + +class QmitkPixelValueView : public QmitkAbstractView, public mitk::IRenderWindowPartListener +{ + Q_OBJECT + +public: + static const std::string VIEW_ID; + + QmitkPixelValueView(QObject* parent = nullptr); + + ~QmitkPixelValueView() override; + + void CreateQtPartControl(QWidget* parent) override; + + void SetFocus() override; + +private: + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; + + void OnSelectedPositionChanged(const mitk::Point3D& position); + void OnSelectedTimePointChanged(const mitk::TimePointType& timePoint); + + void NodeChanged(const mitk::DataNode* node) override; + + void Clear(); + void Update(); + + QmitkSliceNavigationListener m_SliceNavigationListener; + Ui::QmitkPixelValueView* m_Ui; +}; + +#endif diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.ui b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.ui new file mode 100644 index 0000000000..eb3ab2723a --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/QmitkPixelValueView.ui @@ -0,0 +1,59 @@ + + + QmitkPixelValueView + + + + 0 + 0 + 400 + 300 + + + + Pixel Value + + + + + + + + Image name + + + Qt::PlainText + + + + + + + true + + + + + + + Pixel value + + + Qt::PlainText + + + + + + + true + + + + + + + + + + diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.cpp b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.cpp new file mode 100644 index 0000000000..e1ff080825 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.cpp @@ -0,0 +1,23 @@ +/*============================================================================ + +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 "QmitkPixelValueView.h" + +void mitk::mitkPluginActivator::start(ctkPluginContext* context) +{ + BERRY_REGISTER_EXTENSION_CLASS(QmitkPixelValueView, context) +} + +void mitk::mitkPluginActivator::stop(ctkPluginContext*) +{ +} diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.h new file mode 100644 index 0000000000..1eaae47868 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.h @@ -0,0 +1,32 @@ +/*============================================================================ + +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 org_mitk_gui_qt_voxelvalue_Activator_h +#define org_mitk_gui_qt_voxelvalue_Activator_h + +#include + +namespace mitk +{ + class mitkPluginActivator : public QObject, public ctkPluginActivator + { + Q_OBJECT + Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_pixelvalue") + Q_INTERFACES(ctkPluginActivator) + + public: + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; + }; +} + +#endif