If you're using SPM5 to do the segmentation, it will read and write NIFTI files. If the datasets are still flipped then something is wrong. You should also be able to avoid the Analyze format altogether.
Also I would imagine that mirrored files are less of an issue than establishing the proper orientation for each Analyze dataset. If you must use the Analyze header, you can take a look at this old message thread (one that you started) to review how to set various environment variables to control the reading and writing of Analyze datasets in AFNI.
[
afni.nimh.nih.gov]