Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F368
NoNaNCheckGeometry3D.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
schwarzt
Nov 9 2009, 9:52 PM
2009-11-09 21:52:23 (UTC+1)
Size
1 KB
Referenced Files
None
Subscribers
None
NoNaNCheckGeometry3D.patch
View Options
Index: mitkGeometry3D.cpp
===================================================================
--- mitkGeometry3D.cpp (revision 19977)
+++ mitkGeometry3D.cpp (working copy)
@@ -337,43 +337,30 @@
temp[j] = in[j] - offset[j];
}
- // in GetInverseMatrix geht was schief
+ // use GetInverse() instead of GetInverseMatrix() because of internal ITK error
TransformType::Pointer invertedTransform = TransformType::New();
if (!m_IndexToWorldTransform->GetInverse( invertedTransform.GetPointer() ))
{
- itkExceptionMacro( "Internal ITK matrix inversion error, cannot proceed." );
+ itkExceptionMacro( "Internal ITK matrix inversion error, cannot proceed." );
}
-
const TransformType::MatrixType& inverse = invertedTransform->GetMatrix();
- unsigned int nans(0);
- for (i = 0; i < 3; i++)
+
+ for (i = 0; i < 3; ++i)
{
out[i] = 0.0;
- for (j = 0; j < 3; j++)
+ for (j = 0; j < 3; ++j)
{
out[i] += inverse[i][j]*temp[j];
}
-
- if (inverse[i][j] != inverse[i][j] ) // this is only true for NaN
- {
- ++nans;
- }
}
if(m_ImageGeometry)
{
- for (i = 0; i < 3; i++)
+ for (i = 0; i < 3; ++i)
{
out[i] += 0.5;
}
}
-
- if (nans > 0)
- {
- itkExceptionMacro( "Internal ITK matrix inversion error, cannot proceed. Matrix was: " << std::endl
- << m_IndexToWorldTransform << "Suggested inverted matrix is:" << std::endl
- << inverse );
- }
}
void mitk::Geometry3D::BackTransform(const mitk::Point3D &/*at*/, const mitk::Vector3D &in, mitk::Vector3D& out) const
File Metadata
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
352
Default Alt Text
NoNaNCheckGeometry3D.patch (1 KB)
Attached To
Mode
T2883: Check for NaN's in mitk::Geometry3D still necessary? Speed considerations.
Attached
Detach File
Event Timeline
•
schwarzt
added a comment.
Nov 9 2009, 9:52 PM
2009-11-09 21:52:23 (UTC+1)
Comment Actions
Patch for possible removal of NaN check in inner loop
Log In to Comment