write euler2d transform to file

Hi all,

I’m trying to use ImageRegistration5.cxx to register two 2d images. I’d like to have the program write the resultant transform to file so I can use it later in Slicer. I’m using the code below, and a file is being written, but when I try to open it in Slicer, it doesn’t load anything to the data module. Do I need to change this transform to 3dEuler? Or is this a problem on the slicer side?
Relevant code for the writer:
using TransformWriterType = itk::TransformFileWriterTemplate;
TransformWriterType::Pointer transformWriter = TransformWriterType::New();
transformWriter->SetInput(registration->GetTransform());
transformWriter->SetFileName(“RegistrationTransform.h5”);
transformWriter->Update();

I think that transforms need to be affine type for Slicer to read them. So you should convert them before writing. You should open Slicer’s log to see the exact error message.