We have images where, for some unknown reason (at least, unknown to me), the image orientation tag [0020, 0037] can vary thoughout the volume, possibly due to rounding error.
This causes issues in CreateMoreUniqueSeriesIdentifier, as filenames will be split into multiple groups. These groups are then sorted independently of each other.
Furthermore, in AnalyzeFileForITKImageSeriesReaderSpacingAssumption, the code assumes that images are processed in order. The function calculates the distance between one slice and the next, and compares it with the distance between the first two slices seen. So, if the first two slices are 0 and 1, and the inter-slice distance is about 1.5mm say, but the next slice seen is actually a slice from the other end of the volume, the slice will be rejected, and put in another group.