diff --git a/Modules/Core/resource/Interactions/DisplayInteraction.xml b/Modules/Core/resource/Interactions/DisplayInteraction.xml
index 6fbf1f200e..45009904c6 100644
--- a/Modules/Core/resource/Interactions/DisplayInteraction.xml
+++ b/Modules/Core/resource/Interactions/DisplayInteraction.xml
@@ -1,148 +1,153 @@
+
+
+
+
+
diff --git a/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.cpp b/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.cpp
index c7e6f276d6..da751c4656 100644
--- a/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.cpp
+++ b/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.cpp
@@ -1,425 +1,554 @@
/*===================================================================
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 "QmitkImageNavigatorView.h"
#include
#include
#include
#include
#include
+#include
+#include
+#include
+#include
const std::string QmitkImageNavigatorView::VIEW_ID = "org.mitk.views.imagenavigator";
+static mitk::DataNode::Pointer GetTopLayerNode(const mitk::DataStorage::SetOfObjects::ConstPointer nodes, const mitk::Point3D &position, mitk::BaseRenderer* renderer)
+{
+ mitk::DataNode::Pointer node;
+ int maxlayer = -32768;
+
+ if(nodes.IsNotNull())
+ {
+ // find node with largest layer, that is the node shown on top in the render window
+ for (unsigned int x = 0; x < nodes->size(); x++)
+ {
+ if ( (nodes->at(x)->GetData()->GetGeometry() != NULL) &&
+ nodes->at(x)->GetData()->GetGeometry()->IsInside(position) )
+ {
+ int layer = 0;
+ if(!(nodes->at(x)->GetIntProperty("layer", layer))) continue;
+ if(layer > maxlayer)
+ {
+ if( static_cast(nodes->at(x))->IsVisible(renderer) )
+ {
+ node = nodes->at(x);
+ maxlayer = layer;
+ }
+ }
+ }
+ }
+ }
+
+ return node;
+}
+
QmitkImageNavigatorView::QmitkImageNavigatorView()
: m_AxialStepper(0)
, m_SagittalStepper(0)
, m_FrontalStepper(0)
, m_TimeStepper(0)
, m_Parent(0)
, m_IRenderWindowPart(0)
{
}
QmitkImageNavigatorView::~QmitkImageNavigatorView()
{
}
void QmitkImageNavigatorView::CreateQtPartControl(QWidget *parent)
{
// create GUI widgets
m_Parent = parent;
m_Controls.setupUi(parent);
m_Controls.m_SliceNavigatorAxial->SetInverseDirection(true);
connect(m_Controls.m_XWorldCoordinateSpinBox, SIGNAL(valueChanged(double)), this, SLOT(OnMillimetreCoordinateValueChanged()));
connect(m_Controls.m_YWorldCoordinateSpinBox, SIGNAL(valueChanged(double)), this, SLOT(OnMillimetreCoordinateValueChanged()));
connect(m_Controls.m_ZWorldCoordinateSpinBox, SIGNAL(valueChanged(double)), this, SLOT(OnMillimetreCoordinateValueChanged()));
m_Parent->setEnabled(false);
mitk::IRenderWindowPart* renderPart = this->GetRenderWindowPart();
this->RenderWindowPartActivated(renderPart);
}
void QmitkImageNavigatorView::SetFocus ()
{
m_Controls.m_XWorldCoordinateSpinBox->setFocus();
}
void QmitkImageNavigatorView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
{
if (this->m_IRenderWindowPart != renderWindowPart)
{
this->m_IRenderWindowPart = renderWindowPart;
this->m_Parent->setEnabled(true);
QmitkRenderWindow* renderWindow = renderWindowPart->GetQmitkRenderWindow("axial");
if (renderWindow)
{
if (m_AxialStepper) m_AxialStepper->deleteLater();
m_AxialStepper = new QmitkStepperAdapter(m_Controls.m_SliceNavigatorAxial,
renderWindow->GetSliceNavigationController()->GetSlice(),
"sliceNavigatorAxialFromSimpleExample");
m_Controls.m_SliceNavigatorAxial->setEnabled(true);
m_Controls.m_AxialLabel->setEnabled(true);
m_Controls.m_ZWorldCoordinateSpinBox->setEnabled(true);
connect(m_AxialStepper, SIGNAL(Refetch()), this, SLOT(OnRefetch()));
+ connect(m_AxialStepper, SIGNAL(Refetch()), this, SLOT(UpdateStatusBar()));
}
else
{
m_Controls.m_SliceNavigatorAxial->setEnabled(false);
m_Controls.m_AxialLabel->setEnabled(false);
m_Controls.m_ZWorldCoordinateSpinBox->setEnabled(false);
}
renderWindow = renderWindowPart->GetQmitkRenderWindow("sagittal");
if (renderWindow)
{
if (m_SagittalStepper) m_SagittalStepper->deleteLater();
m_SagittalStepper = new QmitkStepperAdapter(m_Controls.m_SliceNavigatorSagittal,
renderWindow->GetSliceNavigationController()->GetSlice(),
"sliceNavigatorSagittalFromSimpleExample");
m_Controls.m_SliceNavigatorSagittal->setEnabled(true);
m_Controls.m_SagittalLabel->setEnabled(true);
m_Controls.m_YWorldCoordinateSpinBox->setEnabled(true);
connect(m_SagittalStepper, SIGNAL(Refetch()), this, SLOT(OnRefetch()));
+ connect(m_SagittalStepper, SIGNAL(Refetch()), this, SLOT(UpdateStatusBar()));
}
else
{
m_Controls.m_SliceNavigatorSagittal->setEnabled(false);
m_Controls.m_SagittalLabel->setEnabled(false);
m_Controls.m_YWorldCoordinateSpinBox->setEnabled(false);
}
renderWindow = renderWindowPart->GetQmitkRenderWindow("coronal");
if (renderWindow)
{
if (m_FrontalStepper) m_FrontalStepper->deleteLater();
m_FrontalStepper = new QmitkStepperAdapter(m_Controls.m_SliceNavigatorFrontal,
renderWindow->GetSliceNavigationController()->GetSlice(),
"sliceNavigatorFrontalFromSimpleExample");
m_Controls.m_SliceNavigatorFrontal->setEnabled(true);
m_Controls.m_CoronalLabel->setEnabled(true);
m_Controls.m_XWorldCoordinateSpinBox->setEnabled(true);
connect(m_FrontalStepper, SIGNAL(Refetch()), this, SLOT(OnRefetch()));
+ connect(m_FrontalStepper, SIGNAL(Refetch()), this, SLOT(UpdateStatusBar()));
}
else
{
m_Controls.m_SliceNavigatorFrontal->setEnabled(false);
m_Controls.m_CoronalLabel->setEnabled(false);
m_Controls.m_XWorldCoordinateSpinBox->setEnabled(false);
}
mitk::SliceNavigationController* timeController = renderWindowPart->GetTimeNavigationController();
if (timeController)
{
if (m_TimeStepper) m_TimeStepper->deleteLater();
m_TimeStepper = new QmitkStepperAdapter(m_Controls.m_SliceNavigatorTime,
timeController->GetTime(),
"sliceNavigatorTimeFromSimpleExample");
m_Controls.m_SliceNavigatorTime->setEnabled(true);
m_Controls.m_TimeLabel->setEnabled(true);
+ connect(m_TimeStepper, SIGNAL(Refetch()), this, SLOT(UpdateStatusBar()));
}
else
{
m_Controls.m_SliceNavigatorTime->setEnabled(false);
m_Controls.m_TimeLabel->setEnabled(false);
}
}
}
+void QmitkImageNavigatorView::UpdateStatusBar()
+{
+ mitk::Point3D position = m_IRenderWindowPart->GetSelectedPosition();
+ std::string statusText;
+ mitk::BaseRenderer::Pointer renderer = mitk::BaseRenderer::GetInstance(m_IRenderWindowPart->GetActiveQmitkRenderWindow()->GetVtkRenderWindow());
+ mitk::TNodePredicateDataType::Pointer isImageData = mitk::TNodePredicateDataType::New();
+
+ mitk::DataStorage::SetOfObjects::ConstPointer nodes = this->GetDataStorage()->GetSubset(isImageData).GetPointer();
+
+ if (nodes.IsNotNull())
+ {
+ mitk::Image::Pointer image3D;
+ mitk::DataNode::Pointer node;
+ mitk::DataNode::Pointer topSourceNode;
+
+ int component = 0;
+
+ node = GetTopLayerNode(nodes, position, renderer);
+
+ if(node.IsNotNull())
+ {
+ bool isBinary (false);
+ node->GetBoolProperty("binary", isBinary);
+ if(isBinary)
+ {
+ mitk::DataStorage::SetOfObjects::ConstPointer sourcenodes = this->GetDataStorage()->GetSources(node, NULL, true);
+ if(!sourcenodes->empty())
+ {
+ topSourceNode = GetTopLayerNode(sourcenodes, position, renderer);
+ }
+ if(topSourceNode.IsNotNull())
+ {
+ image3D = dynamic_cast(topSourceNode->GetData());
+ topSourceNode->GetIntProperty("Image.Displayed Component", component);
+ }
+ else
+ {
+ image3D = dynamic_cast(node->GetData());
+ node->GetIntProperty("Image.Displayed Component", component);
+ }
+ }
+ else
+ {
+ image3D = dynamic_cast(node->GetData());
+ node->GetIntProperty("Image.Displayed Component", component);
+ }
+ }
+ std::stringstream stream;
+ stream.imbue(std::locale::classic());
+
+ // get the position and gray value from the image and build up status bar text
+ if(image3D.IsNotNull())
+ {
+ itk::Index<3> p;
+ image3D->GetGeometry()->WorldToIndex(position, p);
+ stream.precision(2);
+ stream << "Position: <" << std::fixed << position[0] << ", " << std::fixed << position[1] << ", " << std::fixed << position[2] << "> mm";
+ stream << "; Index: <" << p[0] << ", " << p[1] << ", " << p[2] << "> ";
+
+ mitk::ScalarType pixelValue;
+
+ mitkPixelTypeMultiplex5(
+ mitk::FastSinglePixelAccess,
+ image3D->GetChannelDescriptor().GetPixelType(),
+ image3D,
+ image3D->GetVolumeData(renderer->GetTimeStep()),
+ p,
+ pixelValue,
+ component);
+
+
+
+ if (fabs(pixelValue)>1000000 || fabs(pixelValue) < 0.01)
+ {
+ stream << "; Time: " << renderer->GetTime() << " ms; Pixelvalue: " << std::scientific << pixelValue << " ";
+ }
+ else
+ {
+ stream << "; Time: " << renderer->GetTime() << " ms; Pixelvalue: " << pixelValue << " ";
+ }
+ }
+ else
+ {
+ stream << "No image information at this position!";
+ }
+
+ statusText = stream.str();
+ mitk::StatusBar::GetInstance()->DisplayGreyValueText(statusText.c_str());
+ }
+}
+
void QmitkImageNavigatorView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* /*renderWindowPart*/)
{
m_IRenderWindowPart = 0;
m_Parent->setEnabled(false);
}
int QmitkImageNavigatorView::GetSizeFlags(bool width)
{
if(!width)
{
return berry::Constants::MIN | berry::Constants::MAX | berry::Constants::FILL;
}
else
{
return 0;
}
}
int QmitkImageNavigatorView::ComputePreferredSize(bool width, int /*availableParallel*/, int /*availablePerpendicular*/, int preferredResult)
{
if(width==false)
{
return 200;
}
else
{
return preferredResult;
}
}
int QmitkImageNavigatorView::GetClosestAxisIndex(mitk::Vector3D normal)
{
// cos(theta) = normal . axis
// cos(theta) = (a, b, c) . (d, e, f)
// cos(theta) = (a, b, c) . (1, 0, 0) = a
// cos(theta) = (a, b, c) . (0, 1, 0) = b
// cos(theta) = (a, b, c) . (0, 0, 1) = c
double absCosThetaWithAxis[3];
for (int i = 0; i < 3; i++)
{
absCosThetaWithAxis[i] = fabs(normal[i]);
}
int largestIndex = 0;
double largestValue = absCosThetaWithAxis[0];
for (int i = 1; i < 3; i++)
{
if (absCosThetaWithAxis[i] > largestValue)
{
largestValue = absCosThetaWithAxis[i];
largestIndex = i;
}
}
return largestIndex;
}
void QmitkImageNavigatorView::SetBorderColors()
{
if (m_IRenderWindowPart)
{
QString decoColor;
QmitkRenderWindow* renderWindow = m_IRenderWindowPart->GetQmitkRenderWindow("axial");
if (renderWindow)
{
decoColor = GetDecorationColorOfGeometry(renderWindow);
mitk::PlaneGeometry::ConstPointer geometry = renderWindow->GetSliceNavigationController()->GetCurrentPlaneGeometry();
if (geometry.IsNotNull())
{
mitk::Vector3D normal = geometry->GetNormal();
int axis = this->GetClosestAxisIndex(normal);
this->SetBorderColor(axis, decoColor);
}
}
renderWindow = m_IRenderWindowPart->GetQmitkRenderWindow("sagittal");
if (renderWindow)
{
decoColor = GetDecorationColorOfGeometry(renderWindow);
mitk::PlaneGeometry::ConstPointer geometry = renderWindow->GetSliceNavigationController()->GetCurrentPlaneGeometry();
if (geometry.IsNotNull())
{
mitk::Vector3D normal = geometry->GetNormal();
int axis = this->GetClosestAxisIndex(normal);
this->SetBorderColor(axis, decoColor);
}
}
renderWindow = m_IRenderWindowPart->GetQmitkRenderWindow("coronal");
if (renderWindow)
{
decoColor = GetDecorationColorOfGeometry(renderWindow);
mitk::PlaneGeometry::ConstPointer geometry = renderWindow->GetSliceNavigationController()->GetCurrentPlaneGeometry();
if (geometry.IsNotNull())
{
mitk::Vector3D normal = geometry->GetNormal();
int axis = this->GetClosestAxisIndex(normal);
this->SetBorderColor(axis, decoColor);
}
}
}
}
QString QmitkImageNavigatorView::GetDecorationColorOfGeometry(QmitkRenderWindow* renderWindow)
{
QColor color;
float rgb[3] = {1.0f, 1.0f, 1.0f};
float rgbMax = 255.0f;
mitk::BaseRenderer::GetInstance(renderWindow->GetVtkRenderWindow())->GetCurrentWorldPlaneGeometryNode()->GetColor(rgb);
color.setRed(static_cast(rgb[0]*rgbMax + 0.5));
color.setGreen(static_cast(rgb[1]*rgbMax + 0.5));
color.setBlue(static_cast(rgb[2]*rgbMax + 0.5));
QString colorAsString = QString(color.name());
return colorAsString;
}
void QmitkImageNavigatorView::SetBorderColor(int axis, QString colorAsStyleSheetString)
{
if (axis == 0)
{
this->SetBorderColor(m_Controls.m_XWorldCoordinateSpinBox, colorAsStyleSheetString);
}
else if (axis == 1)
{
this->SetBorderColor(m_Controls.m_YWorldCoordinateSpinBox, colorAsStyleSheetString);
}
else if (axis == 2)
{
this->SetBorderColor(m_Controls.m_ZWorldCoordinateSpinBox, colorAsStyleSheetString);
}
}
void QmitkImageNavigatorView::SetBorderColor(QDoubleSpinBox *spinBox, QString colorAsStyleSheetString)
{
assert(spinBox);
spinBox->setStyleSheet(QString("border: 2px solid ") + colorAsStyleSheetString + ";");
}
void QmitkImageNavigatorView::SetStepSizes()
{
this->SetStepSize(0);
this->SetStepSize(1);
this->SetStepSize(2);
}
void QmitkImageNavigatorView::SetStepSize(int axis)
{
if (m_IRenderWindowPart)
{
mitk::BaseGeometry::ConstPointer geometry = m_IRenderWindowPart->GetActiveQmitkRenderWindow()->GetSliceNavigationController()->GetInputWorldGeometry3D();
if (geometry.IsNotNull())
{
mitk::Point3D crossPositionInIndexCoordinates;
mitk::Point3D crossPositionInIndexCoordinatesPlus1;
mitk::Point3D crossPositionInMillimetresPlus1;
mitk::Vector3D transformedAxisDirection;
mitk::Point3D crossPositionInMillimetres = m_IRenderWindowPart->GetSelectedPosition();
geometry->WorldToIndex(crossPositionInMillimetres, crossPositionInIndexCoordinates);
crossPositionInIndexCoordinatesPlus1 = crossPositionInIndexCoordinates;
crossPositionInIndexCoordinatesPlus1[axis] += 1;
geometry->IndexToWorld(crossPositionInIndexCoordinatesPlus1, crossPositionInMillimetresPlus1);
transformedAxisDirection = crossPositionInMillimetresPlus1 - crossPositionInMillimetres;
int closestAxisInMillimetreSpace = this->GetClosestAxisIndex(transformedAxisDirection);
double stepSize = transformedAxisDirection.GetNorm();
this->SetStepSize(closestAxisInMillimetreSpace, stepSize);
}
}
}
void QmitkImageNavigatorView::SetStepSize(int axis, double stepSize)
{
if (axis == 0)
{
m_Controls.m_XWorldCoordinateSpinBox->setSingleStep(stepSize);
}
else if (axis == 1)
{
m_Controls.m_YWorldCoordinateSpinBox->setSingleStep(stepSize);
}
else if (axis == 2)
{
m_Controls.m_ZWorldCoordinateSpinBox->setSingleStep(stepSize);
}
}
void QmitkImageNavigatorView::OnMillimetreCoordinateValueChanged()
{
if (m_IRenderWindowPart)
{
mitk::TimeGeometry::ConstPointer geometry = m_IRenderWindowPart->GetActiveQmitkRenderWindow()->GetSliceNavigationController()->GetInputWorldTimeGeometry();
if (geometry.IsNotNull())
{
mitk::Point3D positionInWorldCoordinates;
positionInWorldCoordinates[0] = m_Controls.m_XWorldCoordinateSpinBox->value();
positionInWorldCoordinates[1] = m_Controls.m_YWorldCoordinateSpinBox->value();
positionInWorldCoordinates[2] = m_Controls.m_ZWorldCoordinateSpinBox->value();
m_IRenderWindowPart->SetSelectedPosition(positionInWorldCoordinates);
}
}
}
void QmitkImageNavigatorView::OnRefetch()
{
if (m_IRenderWindowPart)
{
mitk::BaseGeometry::ConstPointer geometry = m_IRenderWindowPart->GetActiveQmitkRenderWindow()->GetSliceNavigationController()->GetInputWorldGeometry3D();
mitk::TimeGeometry::ConstPointer timeGeometry = m_IRenderWindowPart->GetActiveQmitkRenderWindow()->GetSliceNavigationController()->GetInputWorldTimeGeometry();
if (geometry.IsNull() && timeGeometry.IsNotNull())
{
mitk::TimeStepType timeStep = m_IRenderWindowPart->GetActiveQmitkRenderWindow()->GetSliceNavigationController()->GetTime()->GetPos();
geometry = timeGeometry->GetGeometryForTimeStep(timeStep);
}
if (geometry.IsNotNull())
{
mitk::BoundingBox::BoundsArrayType bounds = geometry->GetBounds();
mitk::Point3D cornerPoint1InIndexCoordinates;
cornerPoint1InIndexCoordinates[0] = bounds[0];
cornerPoint1InIndexCoordinates[1] = bounds[2];
cornerPoint1InIndexCoordinates[2] = bounds[4];
mitk::Point3D cornerPoint2InIndexCoordinates;
cornerPoint2InIndexCoordinates[0] = bounds[1];
cornerPoint2InIndexCoordinates[1] = bounds[3];
cornerPoint2InIndexCoordinates[2] = bounds[5];
if (!geometry->GetImageGeometry())
{
cornerPoint1InIndexCoordinates[0] += 0.5;
cornerPoint1InIndexCoordinates[1] += 0.5;
cornerPoint1InIndexCoordinates[2] += 0.5;
cornerPoint2InIndexCoordinates[0] -= 0.5;
cornerPoint2InIndexCoordinates[1] -= 0.5;
cornerPoint2InIndexCoordinates[2] -= 0.5;
}
mitk::Point3D crossPositionInWorldCoordinates = m_IRenderWindowPart->GetSelectedPosition();
mitk::Point3D cornerPoint1InWorldCoordinates;
mitk::Point3D cornerPoint2InWorldCoordinates;
geometry->IndexToWorld(cornerPoint1InIndexCoordinates, cornerPoint1InWorldCoordinates);
geometry->IndexToWorld(cornerPoint2InIndexCoordinates, cornerPoint2InWorldCoordinates);
m_Controls.m_XWorldCoordinateSpinBox->blockSignals(true);
m_Controls.m_YWorldCoordinateSpinBox->blockSignals(true);
m_Controls.m_ZWorldCoordinateSpinBox->blockSignals(true);
m_Controls.m_XWorldCoordinateSpinBox->setMinimum(std::min(cornerPoint1InWorldCoordinates[0], cornerPoint2InWorldCoordinates[0]));
m_Controls.m_YWorldCoordinateSpinBox->setMinimum(std::min(cornerPoint1InWorldCoordinates[1], cornerPoint2InWorldCoordinates[1]));
m_Controls.m_ZWorldCoordinateSpinBox->setMinimum(std::min(cornerPoint1InWorldCoordinates[2], cornerPoint2InWorldCoordinates[2]));
m_Controls.m_XWorldCoordinateSpinBox->setMaximum(std::max(cornerPoint1InWorldCoordinates[0], cornerPoint2InWorldCoordinates[0]));
m_Controls.m_YWorldCoordinateSpinBox->setMaximum(std::max(cornerPoint1InWorldCoordinates[1], cornerPoint2InWorldCoordinates[1]));
m_Controls.m_ZWorldCoordinateSpinBox->setMaximum(std::max(cornerPoint1InWorldCoordinates[2], cornerPoint2InWorldCoordinates[2]));
m_Controls.m_XWorldCoordinateSpinBox->setValue(crossPositionInWorldCoordinates[0]);
m_Controls.m_YWorldCoordinateSpinBox->setValue(crossPositionInWorldCoordinates[1]);
m_Controls.m_ZWorldCoordinateSpinBox->setValue(crossPositionInWorldCoordinates[2]);
m_Controls.m_XWorldCoordinateSpinBox->blockSignals(false);
m_Controls.m_YWorldCoordinateSpinBox->blockSignals(false);
m_Controls.m_ZWorldCoordinateSpinBox->blockSignals(false);
}
this->SetBorderColors();
}
}
diff --git a/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h b/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h
index badce30819..ee8a389e0a 100644
--- a/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h
+++ b/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h
@@ -1,102 +1,103 @@
/*===================================================================
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 _QMITKIMAGENAVIGATORVIEW_H_INCLUDED
#define _QMITKIMAGENAVIGATORVIEW_H_INCLUDED
#include
#include
#include
#include "ui_QmitkImageNavigatorViewControls.h"
class QmitkStepperAdapter;
/*!
* \ingroup org_mitk_gui_qt_imagenavigator_internal
*
* \class QmitkImageNavigatorView
*
* \brief Provides a means to scan quickly through a dataset via Axial,
* Coronal and Sagittal sliders, displaying millimetre location and stepper position.
*
* For images, the stepper position corresponds to a voxel index. For other datasets
* such as a surface, it corresponds to a sub-division of the bounding box.
*
* \sa QmitkAbstractView
*/
class QmitkImageNavigatorView :
public QmitkAbstractView, public mitk::IRenderWindowPartListener,
public berry::ISizeProvider
{
// 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;
QmitkImageNavigatorView();
virtual ~QmitkImageNavigatorView();
virtual void CreateQtPartControl(QWidget *parent) override;
virtual int GetSizeFlags(bool width) override;
virtual int ComputePreferredSize(bool width, int /*availableParallel*/, int /*availablePerpendicular*/, int preferredResult) override;
protected slots:
void OnMillimetreCoordinateValueChanged();
void OnRefetch();
+ void UpdateStatusBar();
protected:
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override;
void SetBorderColors();
void SetBorderColor(QDoubleSpinBox *spinBox, QString colorAsStyleSheetString);
void SetBorderColor(int axis, QString colorAsStyleSheetString);
void SetStepSizes();
void SetStepSize(int axis);
void SetStepSize(int axis, double stepSize);
int GetClosestAxisIndex(mitk::Vector3D normal);
Ui::QmitkImageNavigatorViewControls m_Controls;
QmitkStepperAdapter* m_AxialStepper;
QmitkStepperAdapter* m_SagittalStepper;
QmitkStepperAdapter* m_FrontalStepper;
QmitkStepperAdapter* m_TimeStepper;
QWidget* m_Parent;
mitk::IRenderWindowPart* m_IRenderWindowPart;
/**
* @brief GetDecorationColorOfGeometry helper method to get the color of a helper geometry node.
* @param renderWindow The renderwindow of the geometry
* @return the color for decoration in QString format (#RRGGBB).
*/
QString GetDecorationColorOfGeometry(QmitkRenderWindow *renderWindow);
};
#endif // _QMITKIMAGENAVIGATORVIEW_H_INCLUDED