问题:exception message :there are no registration IO factories
原因:
This exception is thrown when ITK does not recognize the fileformat that you are trying to read or write. When reading, ITK recognize file formats by asking a set of internal readers to attempt to read your file. If none of the registered readers accept your file, then the exception above is thrown. When writing, ITK uses the extension of the filename in order to chose the fileformat to be used. Make sure that you use one of the filename extensions recognized by ITK, and that the ImageIO class for that format has been registered.
Enable all the IO modules that you wish to support in your ITK CMake configuration.
链接:https://itk.org/Wiki/ITK/FAQ#NoFactoryException
解决方法:和读取image file类似的处理方法
1、添加头文件:#include "itkTxtTransformIOFactory.h"
2、添加:itk::TxtTransformIOFactory::RegisterOneFactory();
注意:
保存transform的文件格式不同,添加的头文件不同:HDF5TransformIO, MatlabTransformIO
参考链接:
https://itk.org/ITKExamples/src/IO/ImageBase/RegisterIOFactories/Documentation.html
https://simpleitk.readthedocs.io/en/master/Documentation/docs/source/IO.html