[vtkusers] Actors not visible on vtkImageviewer2

David Gobbi david.gobbi at gmail.com
Fri Dec 11 18:17:07 EST 2009


With vtkImageViewer2, I'm not sure what Z coordinate (i.e. depth) is
used for the ImageActor.  You have to make sure that the Z position of
your actor places it in front of the image.  Don't use an Actor2D,
it's best to use regular actors so that the actors share the same
world coordinates as your image data.

For doing anything sophisticated, though, you should use a
vtkRenderWindow, a vtkRenderer, and a vtkImageActor to display your
images.  This will provide you with much greater flexibility than
using vtkImageViewer2, especially when you want to add other objects
to the scene.

    David


On Fri, Dec 11, 2009 at 1:49 PM, KS Jothybasu <jothybasu at gmail.com> wrote:
> Actually I am using vtkImageViewer2 to display the image. I am using
> vtkImageViewer2.setInput(data) then vtkImageViewer2.addActor(actor). But,
> the problem is actor is visible outside the image but not in the
> images.should the actor be a vtkActor2D? I am using the output from the
> vtkCutter cut using a vtkPlane, it uses only a vtkActor?
>
> Thanks
>
> Jothy
>
> On Fri, Dec 11, 2009 at 7:52 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>>
>> Hi Jothy,
>>
>> When the opacity is not 1.0, the order in which you add the actors to
>> the renderer becomes important.  If you want the actor be be in front,
>> then you must add it after you add the image actor.
>>
>>   David
>>
>>
>> On Fri, Dec 11, 2009 at 10:10 AM, KS Jothybasu <jothybasu at gmail.com>
>> wrote:
>> > Hi,
>> >
>> > Could someone please tell me my my actor are not visible on
>> > vtkImagedata,
>> > they appear as they are behind the image when I set the image opacity to
>> > 0.5.
>> >
>> > Thanks
>> >
>> > Jothy
>
>



More information about the vtkusers mailing list