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

Method Is2DConvertable

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

Source from the content-addressed store, hash-verified

234}
235
236bool mitk::BaseGeometry::Is2DConvertable()
237{
238 bool isConvertableWithoutLoss = true;
239 do
240 {
241 if (this->GetSpacing()[2] != 1)
242 {
243 isConvertableWithoutLoss = false;
244 break;
245 }
246 if (this->GetOrigin()[2] != 0)
247 {
248 isConvertableWithoutLoss = false;
249 break;
250 }
251 mitk::Vector3D col0, col1, col2;
252 col0.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(0).as_ref());
253 col1.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(1).as_ref());
254 col2.SetVnlVector(this->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix().get_column(2).as_ref());
255
256 if ((col0[2] != 0) || (col1[2] != 0) || (col2[0] != 0) || (col2[1] != 0) || (col2[2] != 1))
257 {
258 isConvertableWithoutLoss = false;
259 break;
260 }
261 } while (false);
262
263 return isConvertableWithoutLoss;
264}
265
266mitk::Point3D mitk::BaseGeometry::GetCenter() const
267{

Callers 3

TestIs2DConvertableMethod · 0.80

Calls 5

GetSpacingMethod · 0.95
GetOriginMethod · 0.95
GetVnlMatrixMethod · 0.80
GetMatrixMethod · 0.80

Tested by 1

TestIs2DConvertableMethod · 0.64