I’ve implemented a complete MPR viewer using the concept of FourPaneViewer with vtkResliceImageViewer. The viewer includes axial, coronal, sagittal and 3D views. However, I’m encountering a major issue: all three axial,coronal and sagittal views appear flipped, behaving like mirror images of what is expected.
To identify the issue, I fixed the reslice cursors at known positions in axial, coronal, and sagittal views and compared the output of my application against another independent viewer with identical reslice cursor positions. That’s when I noticed the discrepancy. I’ve attached side-by-side image comparisons below for clarity.
I would really appreciate any guidance on how to resolve this flipping/mirroring issue in the MPR views. Are there specific transformations, reslice matrix adjustments, or orientation settings I might be missing?
Additionally, if there’s a better alternative or approach for implementing this as a standalone application using VTK 8.2 with Qt and C++, I’m open to suggestions.
The author of vtkImageResliceViewer hard-coded the axial, coronal, and sagittal view orientations in the UpdateOrientation() method. Here is a link to the code. Notice that the code contains comments suggesting different camera positions for medical image viewing. Modifying the code according to those comments should fix the flip in the view.
Probably the cleanest way to modify the code is to create your own subclass of vtkResliceImageViewer, and override the UpdateInformation() method so that it provides your desired orientations.
Additionally, if there’s a better alternative or approach for implementing this as a standalone application using VTK 8.2 with Qt and C++, I’m open to suggestions.
An alternative approach would be not to start a medical image viewer from scratch (from raw VTK + Qt). Nowadays software solutions evolve so quickly that you do not have the luxury to spend many months redeveloping basic features. For desktop (VTK+Qt) medical image computing applications you can build on 3D Slicer or MITK platform - both are free, restriction-free, open-source software.