[vtkusers] How to draw on the surface of 3D volume using vtkImageTracerWidget?

tanyuguo tyg at array-it.com
Mon Nov 21 22:08:33 EST 2005


Hello,every vtkusers:

I'm writting a program that can remove ROI from a 3D volume.I prepared to use 

a vtkImageTracerWidget to implement this function.I use vtkImageTracerWidget

like this:

  tracerWidget = vtkImageTracerWidget::New();
  //aRenderer is the point of vtkRenderer
  tracerWidget->SetDefaultRenderer(aRenderer);
  tracerWidget->SetCaptureRadius(1.5);
  tracerWidget->GetGlyphSource()->SetColor(1, 0, 0);
  tracerWidget->GetGlyphSource()->SetScale(3.0);
  tracerWidget->SetGlyphAngle(45.0);
  tracerWidget->GetGlyphSource()->Modified();
  //I want to draw always on the plane paralleled with screen
  tracerWidget->ProjectToPlaneOff();
  //I don't know why the following sentence must be added 
  //and how it works
  tracerWidget->SetProjectionNormalToZAxes();
  //volume is the point of vtkVolume
  tracerWidget->SetProp(volume);
  //vtkData is the original 3D image data
  tracerWidget->SetInput(vtkData);
  tracerWidget->SetInteractor(iren);
  tracerWidget->SnapToImageOn();
  tracerWidget->AutoCloseOn();
  tracerWidget->On();

But when program runs,the lines and polygons I draw always stay in the interior 

of the volume.This problem doesn't disappear even I invoke 

"tracerWidget->SetProjectionPosition()".

Can anyone tell me how to draw always on the surface of the 3D volume?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051122/72d6597c/attachment.htm>


More information about the vtkusers mailing list