Applying a transform from .tfm file in ITK

Slicer stores all data in files in LPS coordinate system (to be compatible with DICOM and most other medical image computing software). Therefore, if your point coordinates are in LPS then you don’t need to deal with any LPS/RAS conversion.

However, ITK transforms store the resampling transform (fixed to moving image) and points must be transformed using the modelling transform, which is the inverse of the resampling transform.

If you have a composite transform (e.g., linear + bspline) then you can compute the inverse by splitting to the transform to components, and apply them the inverse of each component (you missed this inversion) in reverse order (you got this right).

Some years ago ITK could not compute inverse transform at a specific points (only invert an entire displacement field, which is extremely costly operation), so in 3D Slicer we chose VTK to do all real-time operations transformations (concatenate, invert, apply to images and meshes). I’m not sure if the situation in ITK has changed since then. @dzenanz do you know if ITK can compute an inverse transform dynamically at any specific location (without requiring computing an entire displacement field and then inverting that field)?

1 Like