[vtkusers] Fwd: vtkImageData opacity problems

Matthias Noll matthias.noll at igd.fraunhofer.de
Tue Dec 6 11:26:52 EST 2011


Dear vtk users,

I'm currently facing a strange problem utilizing vtkImageActors with
opacity and I hope that anyone of you can help me.

I have a 3D vtkImageData object with ct data that I display per slice in
a given axis direction using the ->SetDisplayExtent(ext) function of the
vtkImageData for a given index.

e.g.
selectSlice(int idx)
{
      int ext[6];
      _actor_CT->GetInput()->GetExtent(ext);	
      if((idx>=ext[4]) && (idx<=ext[5]))
	ext[4] = ext[5] = idx;

      _actor_CT->SetDisplayExtent(ext);
      _renderWin->Render();
}

Now I have a second vtkImageActor displaying a live image e.g.
Ultrasound. The opacity setting for both vtkImageActors are

->SetOpacity(0.5);

I now would think that after adding both actors to the renderer I would
be able to see through both images.

In reality I can see the whole ct slice through the ultrasound image if
the ultrasound is in front however if the ct slice is in front I can't
see the ultrasound image. The interesting part is, that in either
setting I still can see all vtkAxisActors and a actor for a boundingbox
generated out of the ct's current extend. I have no idea in the
slightest why one image is transparent for everything and the other is
just transparent for some objects.

Here are three example images by link displaying my problem.

http://imageshack.us/photo/my-images/249/error3p.png/
http://imageshack.us/photo/my-images/266/error2nj.png/
http://imageshack.us/photo/my-images/10/error1zt.png/

I'm glad for any suggestions.
With best regards,
Matthias




More information about the vtkusers mailing list