MCPcopy Create free account
hub / github.com/MITK/MITK / SetExtentInMM

Method SetExtentInMM

Modules/Core/src/DataManagement/mitkBaseGeometry.cpp:366–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366void mitk::BaseGeometry::SetExtentInMM(int direction, ScalarType extentInMM)
367{
368 mitk::ModifiedLock lock(this);
369
370 ScalarType len = GetExtentInMM(direction);
371 if (fabs(len - extentInMM) >= mitk::eps)
372 {
373 AffineTransform3D::MatrixType::InternalMatrixType vnlmatrix;
374 vnlmatrix = m_GeometryTransform->GetVnlMatrix();
375 if (len > extentInMM)
376 vnlmatrix.set_column(direction, vnlmatrix.get_column(direction) / len * extentInMM);
377 else
378 vnlmatrix.set_column(direction, vnlmatrix.get_column(direction) * extentInMM / len);
379 Matrix3D matrix;
380 matrix = vnlmatrix;
381 m_GeometryTransform->SetMatrix(matrix);
382
383 Modified();
384 }
385}
386
387bool mitk::BaseGeometry::IsInside(const mitk::Point3D &p) const
388{

Callers 4

TestExtentInMMMethod · 0.80
TestSetExtendInMMMethod · 0.80

Calls 3

ModifiedFunction · 0.85
GetVnlMatrixMethod · 0.80
SetMatrixMethod · 0.80

Tested by 4

TestExtentInMMMethod · 0.64
TestSetExtendInMMMethod · 0.64