| 234 | } |
| 235 | |
| 236 | bool 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 | |
| 266 | mitk::Point3D mitk::BaseGeometry::GetCenter() const |
| 267 | { |