How are image stacks sorted?

I’m currently using orthanc with the osimis viewer. (I can pull the docker info for the specific image if needed), and I had a question about how stacks are organized. I’ve had a few physicians complain that the images are out of order when they view a study. I’ll readily admit that I’m a programmer and I don’t work in a cath lab. We are also collecting images from multiple cath labs and locations, so I think there is room for a wide variety of varience.

I wanted to see if there’s anything I can do to make sure images are ordered properly or if there’s anything I can pass along to the cath lab techs to make sure that the images are ordered correctly.

Any help or further info you can pass along would be hugely appreciated!!

Hi John,

Here’s the code that handles slices sorting:
https://bitbucket.org/osimis/osimis-webviewer-plugin/src/417247b97410bb9376035edf3067c2971e63f460/backend/WebViewerLibrary/Series/SeriesHelpers.cpp#lines-358

It first tries to sort according to ImagePositionPatient and, if not possible, sort according to InstanceNumber or ImageIndex.
Note that, in order to sort according to ImagePositionPatient, the ImageOrientationPatient tag must be set correctly as well.

HTH

Alain.