Importing SynthMorph transform/deformation field output (NIFTI) into 3D Slicer

I’ve implemented displacement field storage in 4D NIFTI files in ITK and Slicer and it should work well, as long as the displacement field file is valid.

What do you mean by “does not work”? What did you do, what did you expect to happen, and what happened instead?

I don’t see any artifacts, it is a color image.

A 4D array may be interpreted as an RGB color image, so if you chose “Volume” when you loaded the data then this is the correct behavior (it would be nice to select “Transform” by default when you load a displacement field, but I don’t think it is implemented yet).

If you choose “Transform” in the “Add data” window then the file will be loaded as a displacement field transform.

One suspicious thing in the file header that you shared is that image orientation is specified with both sform and qform. Is that intentional? What are the image origin, spacing, axis directions of this image in RAS space? What does Volumes module / Volume information section show?

It is easy to create an incorrect file (intent field may be wrong, some software might write the vector values in voxel space, etc.), so check all details and report any problems to the developers of the software that created the incorrect field. If you believe that the file is correct then please share a set of data files (upload somewhere and post the link here) and I’ll have a look.

You may also choose to use NRRD format instead, which does not suffer from many of the issues and ambiguities of NIFTI files.