21 for (
unsigned int i = 0; i < m_PositionList.size(); ++i)
22 delete m_PositionList[i];
27 for (
unsigned int i = 0; i < m_PositionList.size(); ++i)
29 if (m_PositionList[i] !=
nullptr)
31 bool isSameMatrix(
true);
32 bool isSameOffset(
true);
35 if (!isSameOffset || sliceIndex != m_PositionList[i]->GetPos())
44 AffineTransform3D::Pointer transform = AffineTransform3D::New();
49 transform->SetMatrix(matrix);
56 direction.Normalize();
66 m_PositionList.push_back(newOp);
72 if (m_PositionList.size() >
ID)
74 delete m_PositionList[
ID];
75 m_PositionList.erase(m_PositionList.begin() +
ID);
86 if (ID < m_PositionList.size())
88 return m_PositionList[
ID];
92 MITK_WARN <<
"GetPlanePosition returned nullptr!";
99 return m_PositionList.size();
104 for (
unsigned int i = 0; i < m_PositionList.size(); ++i)
105 delete m_PositionList[i];
107 m_PositionList.clear();
~PlanePositionManagerService()
bool MatrixEqualElementWise(const vnl_matrix_fixed< TCoordRep, NRows, NCols > &matrix1, const vnl_matrix_fixed< TCoordRep, NRows, NCols > &matrix2, mitk::ScalarType epsilon=mitk::eps)
Check for element-wise matrix equality with a user defined accuracy.
ScalarType GetExtent(unsigned int direction) const
Set the time bounds (in ms)
PlanePositionManagerService()
Constants for most interaction classes, due to the generic StateMachines.
mitk::RestorePlanePositionOperation * GetPlanePosition(unsigned int ID)
Getter for a specific plane position with a given ID.
bool RemovePlanePosition(unsigned int ID)
Removes the plane at the position ID from the list.
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.
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
unsigned int GetNumberOfPlanePositions()
Getting the number of all stored planes.
unsigned int AddNewPlanePosition(const mitk::PlaneGeometry *plane, unsigned int sliceIndex=0)
Adds a new plane position to the list. If this geometry is identical to one of the list nothing will ...
Describes a two-dimensional, rectangular plane.
mitk::AffineTransform3D * GetIndexToWorldTransform()
Get the transformation used to convert from index to world coordinates.
void RemoveAllPlanePositions()
Clears the complete positionlist.