VTK.js: Creating oblique slices with vtkImageReslice

:wave: Hello

Problem:

I am running into issues extracting oblique slices from my vtkImageData using vtkImageReslice. After applying a rotation to my reslice axes, output slices are cut off and appear to be rotated around the volume’s origin.

Information:

I have a simple solution that combines cornerstone.js and vtkImageReslice for generating orthogonal slices:

I would like to add support for oblique images. As I currently understand it, you can accomplish that using vtkImageReslice by following the steps outlined in this posting:

https://markmail.org/message/ycfr246az23acrl7

(Combining a single reslice and transform to achieve the desired output slice)

The vtk.js vtkImageReslice documentation mentions resliceTransform, but it’s implementation is a // todo stub.

Questions:

  • Is it possible to generate oblique slices with the current vtkImageReslice implementation in vtk.js?
  • Is a transform required, and if so, is there a way to accomplish it outside of resliceTransform?

If there is a better place for me to ask questions like this, please let me know.

If you don’t get any answer you can always try to post on vtk.js bug tracker.

1 Like

From what it seems you are trying to achieve, you should be able to simply use resliceAxes and not resliceTransform.

You can see an example (with widgets) here: https://github.com/Kitware/vtk-js/pull/857

Worst case, if you still want to use resliceTransform, you can simply add it by looking at how it is done in VTK C++. Merge requests are welcomed :slight_smile:

Hth,
Julien.

1 Like

Thanks for pointing me in the right direction, @finetjul!

I think I get the gist of the data flow and how this implementation is able to account for rotation. It looks like I have a lot of reading, experimenting, and Googling ahead of me :slight_smile:

Thanks again!

@dannyrb Can you provide insights on how to use a UI scroll bar to change slices in the example available at vtk.js