Transform SPM header to be readable by ANTs

Hi! Is there a quick way to transform an SPM header such that it can be read without any problems in ANTs? I have images that have been worked on in SPM which I need to read in with ANTs.

Thank you!

You mean converting nifti pair (.hdr/.img) to nifti (.nii)? nibabel or mri_convert should be able to do that easily.

Hi! I am not sure, whether that is what I mean. I have .nii files which have been coregistered using SPM and which I am now coregistering to other files using ANTs. I noticed that with some participants, the coregistration did not work. I am pretty sure that this is due to the way the header information from SPM and ANts contains the orientation information differently. Somebody told me that that makes it difficult to use images that have been preprocessed in SPM for further processing in ANTs - so you guys shoudl be experts on that :). I am not sure whether you can see that in the header, but the orientation information is different, so maybe there is something to it? I attach screen shots of the orientation information of the same image file in SPM and ANTs.

The answer to this question is exactly what I’m looking for. However, no answer is given. I’m now thinking it might just be easier to use BBRegister and then C3DAffineTool to convert to ITK space. This is a slight pain in the butt. Or I’ll just ditch ANTs altogether…

Edit: Here’s a link to a nipype workflow that does this.