18 m_ViewDirection(Axial)
35 if (
Equal(direction.GetNorm(), 0.0))
37 MITK_WARN <<
"Ignoring invalid direction of projection: " << direction;
44 this->SetViewDirection(
Oblique);
54 itkExceptionMacro(<<
"Renderer was not properly set");
58 unsigned int numberOfInputs = this->GetNumberOfInputs();
59 if (numberOfInputs == 0)
63 for (
unsigned int i = 0; i < numberOfInputs ; ++i)
77 if (numberOfInputs == 0 || !this->
GetInput()->IsDataValid())
87 transformedTipOffset.SetVnlVector(orientation.rotate(
m_TipOffset.GetVnlVector()));
89 slicePosition += transformedTipOffset;
96 snc->SelectSliceByPoint(slicePosition);
101 snc->SelectSliceByPoint(slicePosition);
106 snc->SelectSliceByPoint(slicePosition);
113 const mitk::PlaneGeometry::TransformType::MatrixType &m =
114 m_Renderer->GetCurrentWorldPlaneGeometry()->GetIndexToWorldTransform()->GetMatrix();
120 slicingPlaneYAxisVector.SetVnlVector(orientation.rotate(
m_ToolTrajectory.GetVnlVector()));
125 slicingPlaneYAxisVector[slicingPlaneXAxis] = 0.0;
131 if ( m(slicingPlaneXAxis,0) == 0.0 ||
133 (slicingPlaneXAxis != 0 && slicingPlaneYAxisVector[0] == 0.0) ||
134 (slicingPlaneXAxis != 1 && slicingPlaneYAxisVector[1] == 0.0) ||
135 (slicingPlaneXAxis != 2 && slicingPlaneYAxisVector[2] == 0.0) )
143 if ( (m(1,1) > 0) != (slicingPlaneYAxisVector[1] > 0) )
145 slicingPlaneYAxisVector *= -1;
149 slicingPlaneXAxisVector.Fill(0.0);
153 slicingPlaneXAxisVector[slicingPlaneXAxis] = m(slicingPlaneXAxis,0) > 0 ? 1.0 : -1.0;
157 snc->ReorientSlices(origin, slicingPlaneXAxisVector, slicingPlaneYAxisVector);
158 snc->SelectSliceByPoint(slicePosition);
163 slicingPlaneNormalVector.SetVnlVector(orientation.rotate(
m_ToolTrajectory.GetVnlVector()));
167 const mitk::PlaneGeometry::TransformType::MatrixType &m =
168 m_Renderer->GetCurrentWorldPlaneGeometry()->GetIndexToWorldTransform()->GetMatrix();
172 if (angle(worldUpVector.GetVnlVector(), currentSlicingPlaneUpVector.GetVnlVector()) > vnl_math::pi_over_2 )
180 slicingPlane->InitializePlane(origin, slicingPlaneNormalVector);
186 if ( slicingPlane->Project(worldUpVector, slicingPlaneUpVector) )
192 itk::Vector<double,3> slicingPlaneUpVector_double;
194 slicingPlaneUpVector[0], slicingPlaneUpVector[1], slicingPlaneUpVector[2]);
195 itk::Vector<double,3> slicingPlaneNormalVector_double;
197 slicingPlaneNormalVector[0], slicingPlaneNormalVector[1], slicingPlaneNormalVector[2]);
198 itk::Vector<double,3> slicingPlaneRightVector_double = itk::CrossProduct(slicingPlaneUpVector_double,
199 slicingPlaneNormalVector_double);
203 slicingPlaneRightVector_double[0], slicingPlaneRightVector_double[1], slicingPlaneRightVector_double[2]);
205 slicingPlaneUpVector_double[0], slicingPlaneUpVector_double[1], slicingPlaneUpVector_double[2]);
207 snc->ReorientSlices(origin, slicingPlaneRightVector, slicingPlaneUpVector);
208 snc->SelectSliceByPoint(slicePosition);
NavigationData * GetOutput(void)
return the output (output with id 0) of the filter
NavigationDataSliceVisualization()
NavigationDataToNavigationDataFilter is the base class of all filters that receive NavigationDatas as...
Vector3D m_ToolTrajectory
void GenerateData() override
DataCollection - Class to facilitate loading/accessing structured data.
virtual void SetToolTrajectory(Vector3D direction)
Set/get the tool trajectory used to define the cutting plane normal direction.
mitk::Quaternion OrientationType
Type that holds the orientation part of the tracking data.
virtual PositionType GetPosition() const
returns position of the NavigationData object
void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
const NavigationData * GetInput(void) const
Get the input of this filter.
ViewDirection m_ViewDirection
Vector3D m_WorldVerticalVector
void Graft(const DataObject *data) override
Graft the data and information from one NavigationData to another.
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
virtual OrientationType GetOrientation() const
returns the orientation of the NavigationData object
virtual bool IsDataValid() const
returns true if the object contains valid data
BaseRenderer::Pointer m_Renderer