ImageReslice behave

Hi everyone,
I’ve met an issue when using ImageReslice, it’s like this, I have a cursor to control the resliceAxes of the resclice, when it is located at some position which makes the cutting plane be close to standard xyz axes, the quality of the image looks fine, like this(the brown and blue cross are the cutting planes):
standard_reslice_plane

standard_tanstandard_ortho

When the cursor is located at some shifted places, the quality of the images get much worse, like this:
shift_reslice_plane
shift_tanshift_ortho

Should I change some params to avoid this? What I did on reslice is:

    reslice.setResliceAxes(cursorMatrix)
    reslice.setSlabMode(options.slabMode)
    reslice.setSlabNumberOfSlices(1)
    reslice.setTransformInputSampling(false)
    reslice.setAutoCropOutput(true)
    reslice.setOutputDimensionality(2)

Interpolation type is set to linear in the imageSlice property.

Thanks in advance

Only nearest-neighbor interpolation exists so far in vtkImageReslice.

You would need to check, what is missing in vtkImageReslice/index.js to support LINEAR interpolation. You can do so by comparing with vtkImageReslice.cxx in VTK C++.

Please contribute a pull request (or externalize the work if you have funding).

Hth,
Julien.

Hi Julien,
I finished a demo with that but since it’s still using cpu to calculate, the trilinear interpolation method takes too much time(about 5ms for a 500 * 500 * 300 imageData), which means if there are 3 reslices(axial, coronal and sagittal), it’s hard to get the whole render framerate to 60fps with more calculations for some other functions, so I changed the vtkImageReslice to a vtkImageResliceMapper instance which uses gpu to do the interpolation and it performs good.

Hi Xoz,

If you have something working it would be great if you could contribute it upstream with a PR.

I have the following 2 comments:

  • vtkImageResliceMapper is GPU, hence it means that currently (can change in the future), the 3D volume must be uploaded onto the GPU as many times as there are renderwindows.
  • In most cases, (e.g. you scroll only 1 view), there should be only 1 slice recomputation. If you rotate a view while keep axes orthogonal, you may have 2 views to refresh. So there is some optimization that can be done to not have the 3 views always recomputed.
1 Like