ANTsR icon indicating copy to clipboard operation
ANTsR copied to clipboard

TPS transforms with ANTsR

Open muratmaga opened this issue 10 months ago • 1 comments

I have a TPS transform created in Slicer and saved in h5 format. When I try to read this into ANTsR, I am getting this error. So TPS is not supported as transform format?

> tps = '/tmp/Transform.h5'
> antsr.tx=readAntsrTransform(tps)
ITK ExceptionObject caught !

itk::ExceptionObject (0x60db27af5350)
Location: "unknown" 
File: /tmp/RtmpXGmjPO/R.INSTALL227d863ed3ac81/ITKR/src/itks/Modules/IO/TransformBase/src/itkTransformIOBase.cxx
Line: 62
Description: ITK ERROR: HDF5TransformIOTemplate(0x60da90d50ab0): Could not create an instance of "ThinPlateSplineKernelTransform_float_3_3"
The usual cause of this error is not registering the transform with TransformFactory
Currently registered Transforms: 
[truncated, long list of supported transforms]

muratmaga avatar Feb 26 '25 06:02 muratmaga

So, if I remember correctly, the TPS transform isn't something that's registered by default in the ITK transform factory. As I'm looking at the code, that appears to be the case. But I'm assuming that Slicer adds this to their underlying ITK. Does Slicer allow you to resample the transform as a displacement field? If so, you could go that route as a workaround. That's what we do here.

ntustison avatar Feb 26 '25 16:02 ntustison