About dicom or nifti standardization

I have 2 different nifti. One of them comes in the same way on the same axes as the original dicom. The other one is inverted or axial, sagittal displaced. What should I do to apply a standardization? Is there a python code to make them all look and come in the same way? Is there a module that I can examine the code on Slicer?

A nifti that looks wrong

The right-looking nifti

There’s no general solution for this, since nifti files can be created by many different tools making different assumptions. You need to take care through whatever process you use that the geometry information of the scans is preserved. We try to be very careful about this within the Slicer code but can’t control for external software.

Can I make their postures similar to each other? Or should I do this when converting from dicom to nifti? I have many nifti in this way. I guess I can’t translate them all according to a fixed rule.

Probably the best way to deal with this is to fix incorrect/ambiguous NIFTI images before loading them into Slicer. For example, you can use nibabel to read the file, fix information in the header, and then write to file.

Be aware that it’s possible for there to be a left-right flip as well, so even manual correction may not be definitive depending on the pipeline used.