NIFTI Problem with Reformatted Segmentations

I am reformatting segmentations, and I am able to save them without issue as an NRRD fiel. However, when I attempt to save them as a NIFTI file (the utilized form for our research group) and reload the file, they are a few slices off. This is not the situation when reloading the same file saved in an NRRD format . Does anyone have any suggestions on why there may be this issue with the NIFTI file format and how to address it?

How did you reformat the segmentation? Can you share an example images in nrrd and nifti format?

Nifti has many issues. One of them is that image axes must be always converted to be orthogonal, which cause slight changes in the image geometry if your image axes were not exactly orthogonal. Unless you work with brain images, I would suggest not to use nifti, but use nrrd instead.

Thank you for the reply. This is what the same segmentation looks like when saved and reuploaded as the Nfiti file vs the NRRD file in the same position. With the Nifti file, it appears off by a few slides, and there seem to be gaps. How do you convert it to be orthogonal?

How did you reformat the segmentation?

If you did it by applying a matrix that has non-orthogonal axes then make sure the top-left 3x3 submatrix of the transformation matrix is orthogonal.

Slicer was used to reformat the segmentation and output the segmentations as NIFTIs. Can you clarify what you mean by non-orthogonal axes?

Where did you get the reference image from? Head CTs are often acquired with tilted gantry, which cannot be stored in a nifti image.

Can you share the segmentation in .seg.nrrd format (upload somewhere and post the link here)? If you can also share the complete scene (saved as .mrb) then it is even better.

Column vectors of the orientation matrix are orthogonal to each other (their dot product is zero).