26 , m_SagittalStepper(0)
39 this->m_NavigatorAxial = item;
44 this->m_NavigatorSagittal = item;
49 this->m_NavigatorCoronal = item;
54 this->m_NavigatorTime = item;
59 return this->m_NavigatorAxial;
64 return this->m_NavigatorSagittal;
69 return this->m_NavigatorCoronal;
74 return this->m_NavigatorTime;
79 this->m_WorldCoordinateX = coordinate;
85 this->m_WorldCoordinateY = coordinate;
91 this->m_WorldCoordinateZ = coordinate;
97 this->m_WorldCoordinateXMin = coordinate;
102 this->m_WorldCoordinateYMin = coordinate;
107 this->m_WorldCoordinateZMin = coordinate;
112 this->m_WorldCoordinateXMax = coordinate;
117 this->m_WorldCoordinateYMax = coordinate;
122 this->m_WorldCoordinateZMax = coordinate;
127 return this->m_WorldCoordinateX;
132 return this->m_WorldCoordinateY;
137 return this->m_WorldCoordinateZ;
142 return this->m_WorldCoordinateXMin;
147 return this->m_WorldCoordinateYMin;
152 return this->m_WorldCoordinateZMin;
157 return this->m_WorldCoordinateXMax;
162 return this->m_WorldCoordinateYMax;
167 return this->m_WorldCoordinateZMax;
182 "sliceNavigatorAxialFromSimpleExample");
188 this->m_NavigatorAxial->setEnabled(
false);
197 "sliceNavigatorSagittalFromSimpleExample");
202 this->m_NavigatorSagittal->setEnabled(
false);
211 "sliceNavigatorFrontalFromSimpleExample");
216 this->m_NavigatorCoronal->setEnabled(
false);
225 "sliceNavigatorTimeFromSimpleExample");
229 this->m_NavigatorTime->setEnabled(
false);
240 double absCosThetaWithAxis[3];
242 for (
int i = 0; i < 3; i++)
244 absCosThetaWithAxis[i] = fabs(normal[i]);
246 int largestIndex = 0;
247 double largestValue = absCosThetaWithAxis[0];
248 for (
int i = 1; i < 3; i++)
250 if (absCosThetaWithAxis[i] > largestValue)
252 largestValue = absCosThetaWithAxis[i];
270 if (geometry.IsNotNull())
278 geometry->WorldToIndex(crossPositionInMillimetres, crossPositionInIndexCoordinates);
280 crossPositionInIndexCoordinatesPlus1 = crossPositionInIndexCoordinates;
281 crossPositionInIndexCoordinatesPlus1[axis] += 1;
283 geometry->IndexToWorld(crossPositionInIndexCoordinatesPlus1, crossPositionInMillimetresPlus1);
285 transformedAxisDirection = crossPositionInMillimetresPlus1 - crossPositionInMillimetres;
288 double stepSize = transformedAxisDirection.GetNorm();
289 this->
SetStepSize(closestAxisInMillimetreSpace, stepSize);
314 if (geometry.IsNotNull())
317 positionInWorldCoordinates[0] = this->m_WorldCoordinateX;
318 positionInWorldCoordinates[1] = this->m_WorldCoordinateY;
319 positionInWorldCoordinates[2] = this->m_WorldCoordinateZ;
331 if (geometry.IsNull() && timeGeometry.IsNotNull())
334 geometry = timeGeometry->GetGeometryForTimeStep(timeStep);
337 if (geometry.IsNotNull())
342 cornerPoint1InIndexCoordinates[0] = bounds[0];
343 cornerPoint1InIndexCoordinates[1] = bounds[2];
344 cornerPoint1InIndexCoordinates[2] = bounds[4];
347 cornerPoint2InIndexCoordinates[0] = bounds[1];
348 cornerPoint2InIndexCoordinates[1] = bounds[3];
349 cornerPoint2InIndexCoordinates[2] = bounds[5];
351 if (!geometry->GetImageGeometry())
353 cornerPoint1InIndexCoordinates[0] += 0.5;
354 cornerPoint1InIndexCoordinates[1] += 0.5;
355 cornerPoint1InIndexCoordinates[2] += 0.5;
356 cornerPoint2InIndexCoordinates[0] -= 0.5;
357 cornerPoint2InIndexCoordinates[1] -= 0.5;
358 cornerPoint2InIndexCoordinates[2] -= 0.5;
366 geometry->IndexToWorld(cornerPoint1InIndexCoordinates, cornerPoint1InWorldCoordinates);
367 geometry->IndexToWorld(cornerPoint2InIndexCoordinates, cornerPoint2InWorldCoordinates);
369 this->m_WorldCoordinateXMin =
std::min(cornerPoint1InWorldCoordinates[0], cornerPoint2InWorldCoordinates[0]);
370 this->m_WorldCoordinateYMin =
std::min(cornerPoint1InWorldCoordinates[1], cornerPoint2InWorldCoordinates[1]);
371 this->m_WorldCoordinateZMin =
std::min(cornerPoint1InWorldCoordinates[2], cornerPoint2InWorldCoordinates[2]);
373 this->m_WorldCoordinateXMax =
std::max(cornerPoint1InWorldCoordinates[0], cornerPoint2InWorldCoordinates[0]);
374 this->m_WorldCoordinateYMax =
std::max(cornerPoint1InWorldCoordinates[1], cornerPoint2InWorldCoordinates[1]);
375 this->m_WorldCoordinateZMax =
std::max(cornerPoint1InWorldCoordinates[2], cornerPoint2InWorldCoordinates[2]);
377 this->m_WorldCoordinateX = crossPositionInWorldCoordinates[0];
378 this->m_WorldCoordinateY = crossPositionInWorldCoordinates[1];
379 this->m_WorldCoordinateZ = crossPositionInWorldCoordinates[2];
389 qmlRegisterType<QmlMitkImageNavigator>(
"Mitk.Views", 1, 0,
"ImageNavigator");
390 QQmlComponent component(&engine, QUrl(
"qrc:/MitkImageNavigator.qml"));
QmlMitkRenderWindowItem * getViewerAxial()
mitk::Stepper * GetSlice()
Get the Stepper through the slices.
void setWorldCoordinateY(double coordinate)
QmitkStepperAdapter * m_AxialStepper
const SliceNavigationController * GetTimeNavigationController() const
void setWorldCoordinateZMax(double coordinate)
double getWorldCoordinateXMin()
static QmlMitkImageNavigator * instance
double getWorldCoordinateZ()
QmlMitkRenderWindowItem * getViewerSagittal()
void OnMillimetreCoordinateValueChanged()
void setWorldCoordinateZ(double coordinate)
void setWorldCoordinateZMin(double coordinate)
double getWorldCoordinateXMax()
Controls the selection of the slice the associated BaseRenderer will display.
QmlMitkSliderNavigatorItem * getNavigatorCoronal()
QmitkStepperAdapter * m_FrontalStepper
void moveCrossToPosition(const mitk::Point3D &newPosition)
void setNavigatorCoronal(QmlMitkSliderNavigatorItem *item)
double getWorldCoordinateY()
const mitk::Point3D getCrossPosition() const
QmlMitkRenderWindowItem * getViewerCoronal()
Helper class to connect Qt-based navigators to instances of Stepper.
int GetClosestAxisIndex(mitk::Vector3D normal)
void setWorldCoordinateX(double coordinate)
void setWorldCoordinateXMax(double coordinate)
void sync()
GetDecorationColorOfGeometry helper method to get the color of a helper geometry node.
static RenderingManager * GetInstance()
double getWorldCoordinateYMin()
QmitkStepperAdapter * m_TimeStepper
QmlMitkSliderNavigatorItem * getNavigatorTime()
virtual unsigned int GetPos() const
std::vcl_size_t TimeStepType
void setNavigatorTime(QmlMitkSliderNavigatorItem *item)
static QmlMitkStdMultiItem * instance
double getWorldCoordinateX()
void setWorldCoordinateYMin(double coordinate)
double getWorldCoordinateYMax()
void setWorldCoordinateYMax(double coordinate)
void SetStepSize(int axis)
Provides a means to scan quickly through a dataset via Axial, Coronal and Sagittal sliders...
double getWorldCoordinateZMax()
QmlMitkSliderNavigatorItem * getNavigatorSagittal()
virtual const mitk::BaseGeometry * GetInputWorldGeometry3D()
virtual mitk::SliceNavigationController * GetSliceNavigationController()
mitk::Stepper * GetTime()
Get the Stepper through the time.
QmlMitkSliderNavigatorItem * getNavigatorAxial()
static void create(QQmlEngine &engine)
void setWorldCoordinateXMin(double coordinate)
void setNavigatorSagittal(QmlMitkSliderNavigatorItem *item)
QmitkStepperAdapter * m_SagittalStepper
void setNavigatorAxial(QmlMitkSliderNavigatorItem *item)
BoundingBoxType::BoundsArrayType BoundsArrayType
virtual const mitk::TimeGeometry * GetInputWorldTimeGeometry()
double getWorldCoordinateZMin()