Skip to content
  • pieper's avatar
    ENH: only issue one convergence warning for inverse transform · 84b28af5
    pieper authored
    Certain grid transforms may not have invertable derivatives
    meaning that the calculation in vtkOrientedGridTransform::
    InverseTransformDerivative can be expected not to converge.
    
    The call is made repeatedly from vtkImageReslice, so if there is
    a non-invertable transform thousands of convergence failures
    can occur, leading to the application freezing for a long time
    while generating output.
    
    This change limits the output to a single failure message for a
    given state of the transform.
    
    As discussed in this thread [1] some grid transforms can
    result in many convergence failures in one vtk update
    pass (e.g. when use to render slices through transforms).
    
    The code compresses warnings message to avoid
    hanging the application with too much output.
    
    With this change, a developer or debugger interested in knowing
    about all the convergence failures can observe this event
    and implement their own logic.
    
    This approach remains compatible with the design of vtk transforms.
    
    [1] https://github.com/Slicer/Slicer/pull/812
    
    From: Steve Pieper <pieper@isomics.com>
    
    git-svn-id: http://svn.slicer.org/Slicer4/trunk@26501 3bd1e089-480b-0410-8dfb-8563597acbee
    84b28af5