Sagittal

You can flip the normals or rotate axes of slice views, to flip/rotate a single view.

Note that the problems that you are struggling with are all solved many years ago in numerous open-source medical imaging software that you can just take and freely customize and enhance. Redeveloping basic features is useful as a learning exercise but when you feel ready to do real work then choose a software platform that provides most features that you need and build on that.

I know what youā€™re talking about
However, my project doesnā€™t need all the features of an application like 3D Slicer or MITK, and I need a small program suitable for the UI design of my project.
This is why it is necessary to solve this problem.
VTK beginners are very hard to develop, so help is urgent.

It is much easier to disable/hide features that you donā€™t need than to redevelop all features you need.

It is common for software developers to think that their application will be something simple, providing only a few features. However, the truth is that unless your project dies, you will need to keep adding more features. Existing application platforms already contain all the basic features that you need in the foreseeable future. If you donā€™t have to worry about redeveloping and maintaining basic features, then you can spend much more time on creating new, valuable functionalities that make a difference.

Okay.
Are there any existing projects using VTK except 3D Slicer and MITK?
Thank you for answer.

2 Likes

Thank you. :wink:

@Yongun_Lee, @lassoan, @pieper,

@Yongun_Lee , did you ever solve your issue?

Iā€™m having the same exact problem and I started with the Four Panes Viewer example recommended by many as a great starting point for performing oblique slicing.

I donā€™t have time to start over with another app because I need to meet a release deadline. Everything is perfect except that darn Sagittal view need to be flipped horizontally. Originally, the axial view was vertically flipped (superior on the bottom) and in the process of attempting to correct the axial orientation, The sagittal view ended up facing right. Whack-A-Mole. If I could somehow swing the camera to the other side of the body, I think that would solve it. No time to find another example to start over again. Users have high expectations and want his functionality ASAP. I think the problem might stem from the fact that for VTKā€™s (0 .0) origin is in the lower left corner.

Iā€™ll keep trying things and will let yā€™all know if I solve this. Iā€™ll share my app after I perfect it. Thanks.

@dgobbi, Does your vtkDICOM solve the above issue?

Image orientation in vtk-dicom is briefly described here. This link is focused on the ā€œreaderā€ and doesnā€™t talk much about the ā€œviewerā€.

In general, you are correct that getting the correct image orientation in the viewer is a matter of properly positioning and orienting the camera for each view. But I havenā€™t ever really looked at the Qt FourPaneViewer example so I canā€™t say how it would have to be modified to provide the views that you require.

Hello @sankhesh,

I have been working with your version of FourPaneViewer for usage here at the Mayo Clinic and find that it is great for using as a plug-in to our enterprise viewer, QREADS. Iā€™ve modified it to read compressed DICOM files with GDCM, added orientation markers and removed the recording function. Now, I have having the most challenging time with the following:

  1. Setting the initial orientation to: Axial: ALPR Sagittal: SPIA Coronal: SLIR (clockwise starting at the top). This is our main issue. I was able to make some progress in getting the orientations almost there, but no matter what I do, there is always one view that is 180 degrees out of proper rotation. How do I solve this?

  2. Setting the initial zoom and window level. How do I do this.

  3. Scrolling through the slices with the mouse wheel. How do I gain better control of the mouse wheel events?

But, we love what youā€™ve done so far to get us started. I eagerly await your responseā€¦

@sankhesh FYI: The desired orientations are as seen in @Yongun_Lee Splicer image above.

Hi @dporter,

My apologies but I donā€™t quite recall which version of FourPaneViewer youā€™re referring to.
Neverthless, I can answer your questions in terms of general VTK usage below:

  1. I would recommend using vtkImageResliceMapper to do the volume slicing. That way, for the three slices, you would just have to provide three planes along the three orthogonal axes. Once you have the slices, the slice display orientation can be set up via camera parameters.

  2. The zoom can be set by changing the parallel scale on the camera if the view projection is orthogonal. If using perspective projection, use vtkCamera::Dolly.
    The image window width and level can be changed by passing those values through to the image property set on the image actor.

  3. Youā€™d have to override the interactor style. Here is an example that demonstrates using the mouse wheel to control image slice numbers in a DICOM series: https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadDICOMSeries/

I hope this helps.

Thank you for your response @sankhesh, I know youā€™re really busy so I try to pack all of my questions in each email to minimize the quantity. Please forgive me.

  1. The version Iā€™m using is the one from your site GitHub - sankhesh/FourPaneViewer: Modifications to the VTK example dated Feb 18th, 2018. Are there better ones out there? Iā€™m assuming the youā€™re the best. :slight_smile:

  2. What is your favorite open source code that does MPR oblique slicing with Thick Slicing, W/L, zoom, pan. Yours was the best and most intuitive I could find so far. I added @dgobbi code for decompression, sorting and DICOM element access.

  3. Are you at liberty share some of your Slicer code or direct me to it? Iā€™m sure youā€™ve made improvements since 2018

  4. Does Slice have Image Fusion code such as PET/CT or PET/MRI?

@dporter That is indeed quite old but yes, that was aimed at a simple but comprehensive MPR viewer.

There are some new additions to VTK since then that would provide better performance like the vtkImageResliceMapper to do the actual slicing which also lets you do thick slicing. The window/level operation as well as the camera interaction code for zooming, panning, etc. largely remain the same.

All of the Slicer code base is here: https://github.com/Slicer/Slicer. Getting to individual MPR components there might be tricky as that code is much more organized and modularized than the simple FourPaneViewer example. Having said that, if Slicer and its extensions work well for you, Iā€™d recommend creating a custom Slicer application tailored to your needs. Kitware can help with that.

Slicer used to have a module for image fusion (https://www.slicer.org/wiki/Modules:PETCTFusion-Documentation-3.6). I am not sure of its current status though. However, the clinical term ā€œImage Fusionā€ can be broken down into three steps - image registration, resampling, display. The first two steps can be achieved using ITK, and VTK would allow display of the registered images.

Wow @sankhesh!

That fusion looks really great and Iā€™m definitely cool with using ITK for registration / resampling. Does it have reference markers similar to MPR triangulation?

Important Question: Would it be extremely difficult to extract the MPR and FUSION code from the Splicer app and create stand-alone executable MPR and Fusion modules? I could then launch it from my app passing the DICOM file paths as args. Thatā€™s my plan.

Hey Sankhesh, you have been so so helpful. I feel so much better about the potentials. Have a great weekend and stay safe.

Image fusion is a built-in Slicer feature, for example you can visualize PET/CT images like this:

Yes, for sure this is possible. However, in the mid/long term, you would miss a lot of opportunities to make your users happy.

For example, if you go with a simple implementation then your users will notice that tilted-gantry CT images, and images with variable slice spacing or orientation, and images with overview image stored with the same series instance UID as regular frames, etc. appear distorted in MPR views. Stock ITK/VTK DICOM implementation cannot load and display these images correctly. Or they may complain that certain images are not loaded at all, or they would like to see DICOM segmentation objects or RT structure sets. With decades of hard work we added all these features because they are necessary. Yes, they make the application bigger and more complex, but general-purpose 3D DICOM viewers cannot ignore these problems.

Also, there is a lot of work keeping all the underlying libraries up-to-date, make sure they all work on old and new hardware, operating system versions, in various software configurations. If you build your application on a platform then others do this work for you for free.

Slicer is not the best solution for everything, but if you want to develop a general-purpose, extensible, and customizable 3D medical image viewer in C++/Python then it is very hard to find anything better.

1 Like

@lassoan, @pieper, @sankhesh,

Hey Lassoan and team thanks so much for your time. I sincerely appreciate this! Sorry, Iā€™m starting to get mixed up about who Iā€™m communicating with.

So if I wanted to launch Slicer from the Mayo viewer app, QREADS, and show this Fusion interface with only the 4 quad images, no text on the left, and no Splicer logo, how would I do that? Is that possible? Let met show you the UI experience Iā€™m trying to achieve. This is being used by the Mayo AZ Med school. It would save me a lot of time and effort if I could use Splicer in such a way that gives the user a simple interface that made them unaware of the fact that they we loading another app.

You can start from the QuickSegment slicelet example and customize the GUI further (add/remove any widgets anywhere): https://www.slicer.org/wiki/Documentation/Nightly/Developers/Slicelets#Slicelet_examples

This is how Slicer is used as a viewer/editor plugin from other applications. See for example this topic. You may contact the author of that topic to share best practices with you.

Thanks so much @lassoan! Would adding thick slices and oblique be pretty straighforward?

@lassoan Also, is this really at no cost? Why does this seem too good to be true? This is an amazing service!