[vtkusers] vtkResliceImageViewer image quality problem

David Gobbi david.gobbi at gmail.com
Thu Jan 31 13:48:35 EST 2019

On Thu, Jan 31, 2019 at 11:29 AM Andrey <alekseev at rambler.ru> wrote:

> Thank you for your answer. No artifacts don't move around when I change
> zoom.
> But the changing when I move reslice coursor on this view (not on another
> view only on the same). Image size 477x477 px, pixel spacing 0.25 mm. May
> be
> it's not so obvious on the uploaded images but seems that artifacts are
> edges of cells of grid. I've tried to show them with blue line on image.
> I'm
> not very strong in VTK what can you recomend?
> <http://vtk.1045678.n5.nabble.com/file/t342685/bad_image.png>

It looks to me like the image is being stretched using nearest-neighbor
interpolation before it is going into the input of the vtkImageActor.  The
number of dislocations is the number of pixels by which the image is
stretched, and the dislocations would be expected to be evenly spaced,
just as we see in your screenshot.  The texture interpolation is then
blurring the dislocations so that they look the way they do.

My suspicion is that vtkImageResliceMapper is doing some incorrect
calculations.  It should not be stretching the image when you do an
orthogonal view, it should simply pass the image slices directly to
vtkImageActor.  It is also possible (but less likely) that vtkImageActor
is stretching the image before generating the texture that is used to
display it on the screen.

I can try testing with a similarly sized image (probably not today, but
soon).  Was this just a 2D slice, or was it a stack?  If a stack, what
was the size and spacing?  If the math in vtkImageResliceMapper is
bad, then certain image sizes probably trigger the error.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20190131/2f89fa88/attachment.html>

More information about the vtkusers mailing list