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

Method IsRotated

Modules/Core/src/DataManagement/mitkImage.cpp:1283–1309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1281}
1282
1283bool mitk::Image::IsRotated() const
1284{
1285 const mitk::BaseGeometry *geo = this->GetGeometry();
1286 bool ret = false;
1287
1288 if (geo)
1289 {
1290 const vnl_matrix_fixed<ScalarType, 3, 3> &mx = geo->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix();
1291 mitk::ScalarType ref = 0;
1292 for (short k = 0; k < 3; ++k)
1293 ref += mx[k][k];
1294 ref /= 1000; // Arbitrary value; if a non-diagonal (nd) element is bigger then this, matrix is considered nd.
1295
1296 for (short i = 0; i < 3; ++i)
1297 {
1298 for (short j = 0; j < 3; ++j)
1299 {
1300 if (i != j)
1301 {
1302 if (std::abs(mx[i][j]) > ref) // matrix is nd
1303 ret = true;
1304 }
1305 }
1306 }
1307 }
1308 return ret;
1309}
1310
1311mitk::ImageDimensionVectorType mitk::DetermineImageDimensionsFromTimeGeometry(const TimeGeometry* timeGeometry)
1312{

Callers 3

SetDefaultPropertiesMethod · 0.80
SetDefaultPropertiesMethod · 0.80
SetDefaultPropertiesMethod · 0.80

Calls 4

GetGeometryMethod · 0.80
GetVnlMatrixMethod · 0.80
GetMatrixMethod · 0.80

Tested by

no test coverage detected