Is it possible to read the displacement field?

Hi all,

Multiple registration methods integrated in Slicer3D allow the generation of displacement fields. However, the output is typically in binary formats such as .nii or .mhd, with the core displacement data stored in .raw files. Neither format is readily usable for reading the displacement field, for example, to determine the new location of a specific node after displacement. Could anyone advise on how to access and process these displacement fields in Matlab or Python? I mean not visualization but reading the displacement field data of one specific point.

Best regards,
Chuan

Hi - you can use arrayFromGridTransform to get a numpy array of vectors representing the displacement field. You can use this together with the rest of the vtkMRMLTransfornNode api to determine whatever you need to know.