[vtkusers] Layers of vtkImageStack not visible

David Gobbi david.gobbi at gmail.com
Tue May 22 15:30:28 EDT 2018


I don't know why it is happening, but there are checks that you can try:

1) In QuadView.cxx after you call Render() on all the views, loop through
the
axial image stack to verify that all of the images are actually present.
Also,
you can call GetBounds() on the actor and on the mapper to see if the
size is as expected.  Also, the bounds for the different data sets should
overlap.  Since your UserMatrix is identity, the mapper and actor should
return the same bounds.

2) In the Property, set the Opacity to 0.5.  Perhaps the layers aren't in
the
correct order (I'm not sure why this would happen, but maybe your UIDs
aren't monotonically increasing as you add more data sets?)

 - David


On Tue, May 22, 2018 at 3:41 AM, ochampao <ochampao at hotmail.com> wrote:

> Hi vtkUsers,
>
> I am developing an application that uses 3 vtkImageStack instances for
> overlaying multiple layers of vtkImageSlice's. Each vtkImageStack
> corresponds to one of the anatomical views (axial, coronal, sagittal).
>
> I am observing a peculiar behaviour which I cannot explain/fix. In
> particular, although the 3 views use identical pipelines (except from
> camera
> orientation/position), the vtkImageStack of axial view does not always
> render all layers, whereas the coronal and sagittal views seem to be able
> to
> render any number of layers.
>
> In the attached screenshot below, you can see that the Second layer in the
> Axial view is not visible, even when slicing though the volume:
>
> <http://vtk.1045678.n5.nabble.com/file/t341857/vtkImageStackIssue.png>
>
> In the example above the first volume is from a Dicom series whereas the
> second from a Nifti file, but the same behaviour is observed when both
> volumes are from Dicom. Also, applying the user matrix
> (vtkImageSlice::SetUserMatrix()) does not seem to make any difference in
> the
> observed behaviour.
>
> I have attached the relevant sections of my source code here:  QuadView.cxx
> <http://vtk.1045678.n5.nabble.com/file/t341857/QuadView.cxx>
>
> Brief explanation of the methods:
> * initStaticPipeline(): initializes the 3 empty views and configures each
> vtkImageStack
> * addImage(): is called whenever a new volume is loaded
> * renderViews2D(): forces the 3 views to render
> * resetCameras2D(): resets the 3 cameras and configures camera orientation
> and position.
>
> Does anyone have any ideas why this behaviour is observed and how to fix
> it?
>
> Thanks for your help.
> Panos.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180522/bb8e26f1/attachment.html>


More information about the vtkusers mailing list