[vtkusers] vtkPanel.vtkPanel.GetRenderer().AddActor( vtkActor ) shows black surface (java wrapper)

Sebastien Jourdain sebastien.jourdain at kitware.com
Thu May 24 11:49:05 EDT 2012


Did you attached a lookup table to your mapper ?

Seb

On Thu, May 24, 2012 at 11:38 AM, Jonathan Ruiz Peinado
<jonathan.ruiz3 at gmail.com> wrote:
> Hi,  I've managed to get a custom slice from a volume using this example,
> basically It's probing the volume with a custom surface.
> http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CurvedReformation
>
> Now I'm trying to show this slice/surface in an vtkPanel but it's not
> working as it should, I can see the surface  but it isn't textured at all
> it's just black.
>
> the code I'm using to do this is:
> vtkPanel.GetRenderer().AddActor(
> dicomViewer.getDicomImage().getActorCustomReslice(line_points) );
>
> vtkPanel.GetRenderer().AddActor(new vtkLegendScaleActor());
>
> vtkPanel.GetRenderer().GetActiveCamera().SetViewUp(0,0,1);
> vtkPanel.GetRenderer().GetActiveCamera().SetPosition(0,0,0);
> vtkPanel.GetRenderer().GetActiveCamera().SetFocalPoint(0,1,0);
> vtkPanel.GetRenderer().ResetCamera();
>
>
> If I use a regular vtkRenderWindow as I show below It shows me the surface
> perfectly textured inside the render window
> vtkRenderer renderer = new vtkRenderer();
> vtkRenderWindow renderWindow = new vtkRenderWindow();
>
> renderWindow.AddRenderer(renderer);
> vtkRenderWindowInteractor renderWindowInteractor = new
> vtkRenderWindowInteractor();
> renderWindowInteractor.SetRenderWindow(renderWindow);
>
> // Add the actors to the scene
> renderer.AddActor(dicomViewer.getDicomImage().getActorCustomReslice(line_points));
> renderer.SetBackground(.2, .3, .4);
>
> // Set the camera for viewing medical images
> renderer.GetActiveCamera().SetViewUp(0,0,1);
> renderer.GetActiveCamera().SetPosition(0,0,0);
> renderer.GetActiveCamera().SetFocalPoint(0,1,0);
> renderer.ResetCamera();
> renderWindow.Render();
> renderWindowInteractor.Start();
>
> I'm adding an vtkActor to the vtkPanel, It works fine when I add an
> vtkImageActor. can it be the problem?  should i transform it to an
> vtkImageActor some way? how?
>
>
> Thanks in advance!
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list