Skip to content

Fix vtkImageTransform::TransformPointSet normals

This is a fix for the release branch.

The transformation of normals in vtkImageTransform::TransformPointSet is incorrect. It is visible as odd, orientation dependent discolouration of isosurfaces/contours generated by vtkFlyingEdges3D using vtkImageData with non-orthogonal direction matrix.

The inverse transpose of the direction matrix has to be used instead of the direct matrix itself and this is what the change does.

This is just a quick fix to correct the error but in my view the whole file is rather poor in many ways and it seems to be reimplementing already existing linear transform functionality badly and inefficiently. A much more efficient way would be to use vtkImageData::PhysicalToIndexMatrix or a replica of it in a transposed matrix product similar to gemm(t,n,...) from blas, this would make is easy for compilers to vectorise.

Merge request reports