[vtkusers] vtkSeedWidget and vtkImageViewer2 bug in visualization?

Jothybasu K Selvaraj jothybasu at gmail.com
Tue Apr 13 10:06:22 EDT 2010


It seems to be a depth problem.vtkImageViewer2 displays all the actors
whicher is above the image.To check ,comment the setupInteractor and see it
in 3D.

I would suggest you to hide the actors which ever is out of current slice.

Jothy

On Tue, Apr 13, 2010 at 2:49 PM, Nicolas Rannou <
nicolas_rannou at hms.harvard.edu> wrote:

> Hello,
>
> I'm experimenting some troubles using vtkSeedWidget.
>
> I visualize a volume (*.mhd) in a vtkImageViewer2.
> Then I use vtkSeedWidget to select some points through the volume.
>
> The problem is that when I select one point in one slice, then move to
> another slice to select another point, I can see the actor of the first
> selected point even if I am not on the same slice anymore.
> If I move further, the first point will not be visible after some more
> slices...
> The coordinates (real world coordinates) of all the created points are
> good.
>
> The problem must be in the visualization/actors somewhere...
>
> I tried to use vtkConstrainedPointHandleRepresentation and
> vtkImageActorPointPlacer without success.
>
> Did somebody already face this issue or have any advice?
>
>
> Thanks for your help,
>
>
>    Nicolas
>
>
> //----------------------------------------------------------------------------------------------------------//
> // Sample of code using vtkConstrainedPointHandleRepresentation //
>
> //----------------------------------------------------------------------------------------------------------//
>
> // Create rendering window and everything...
>  vtkRenderer *ren1 = vtkRenderer::New();
>  vtkRenderWindow *renWin = vtkRenderWindow::New();
>  renWin->AddRenderer(ren1);
>
>  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>  iren->SetRenderWindow(renWin);
>
> // Handler
>  vtkConstrainedPointHandleRepresentation *handle
>      = vtkConstrainedPointHandleRepresentation::New();
>  handle->GetProperty()->SetColor(1,0,0);
>
> // Seed representation
>  vtkSeedRepresentation *rep = vtkSeedRepresentation::New();
>  rep->SetHandleRepresentation(handle);
>
> // Seed widget
>  vtkSeedWidget *widget = vtkSeedWidget::New();
>  widget->SetInteractor(iren);
>  widget->SetRepresentation(rep);
>  widget->On();
>
> // Image viewer to deisplay the volume
> // reader is a vtkMetaImageReader
>  vtkImageViewer2* viewer = vtkImageViewer2::New();
>
>  viewer->SetInput( reader->GetOutput() );
>  viewer->SetRenderWindow( renWin );
>  viewer->SetRenderer( ren1 );
>
>  iren->Initialize();
>  viewer->Render();
>  iren->Start();
>
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100413/4e2b283b/attachment.htm>


More information about the vtkusers mailing list