Page MenuHomePhabricator

Geometry3D::BackTransform(const Point3D&, Point3D&) slows down 2D mappers
Closed, ResolvedPublic

Description

Probably in all 2D mappers (at least in mitkSurfaceMapper2D and mitkUnstructuredGridMapper2D) the method Geometry2D::Map(...) is called as often as there are points to render (thousands to millions of times).

The method Geometry2D::Map() in turn calls Geometry3D::BackTransform() which fetches the inverse transform each time. Although the inverse is cached in the base class itk::MatrixOffsetTransformBase of the member m_IndexToWorldTransform (as far as I see it by just looking at the code), caching the inverse ourselves in the Geometry3D class speeds up rendering four-fold (both in release and binary).

Attached the changes as a patch.

Event Timeline

zelzer added a subscriber: zelzer.

Ivo had a look at it already and had no objections against the patch.

Ok, since mapper test are currently under development.

[SVN revision 22279]
ENH (#3688): caching the inverse transform to speed up the BackTransform() method

All tests pass and nobody reported odd behaviour. Closing bug.