[vtkusers] get volume attributes on clipped surface

Jianlong Zhou zhou at isg.cs.uni-magdeburg.de
Wed Sep 26 08:34:20 EDT 2001


hi, all,

I am doing a volume clipping work. My pipeline is like followings: I 
use an implicit volume as an implicit function to clip a sphere 
source.The source code segment is below. What I want to obtain 
here is I am interested in the volume attributes ( e.g. volume 
intensity, etc.) on the clipped sphere surface. Does anyone know 
how to get volume attributes on the clipped sphere surface? Your 
any suggestion will be greatly appreciated.
Thank you in advance.

Jianlong

  //Create sphere source
   vtkSphereSource *Ball =vtkSphereSource::New();
          Ball->SetRadius(r);
	  Ball->SetCenter(x, y, z);
	  Ball->SetThetaResolution(256);
	  Ball->SetPhiResolution(256);

   vtkPolyDataMapper *ballGeometryMapper
                                      =vtkPolyDataMapper::New();
	  ballGeometryMapper->SetInput(Ball->GetOutput());
	  ballGeometryMapper->ImmediateModeRenderingOn();

   vtkActor *ballGeometry =vtkActor::New();
	  ballGeometry->SetMapper(ballGeometryMapper);
	  ballGeometry->VisibilityOff();

   //implicitVolume
   vtkImplicitVolume *aVolumeModel =vtkImplicitVolume::New();
	  aVolumeModel->SetVolume(reader->GetOutput());
	  aVolumeModel->SetOutValue(0);

   // clip the Ball geometry
   vtkClipPolyData *ballClipper =vtkClipPolyData::New();
	  ballClipper->SetInput(Ball->GetOutput());
	  ballClipper->SetClipFunction(aVolumeModel);
	  ballClipper->SetValue( 600.5);
	  ballClipper->GenerateClipScalarsOn();
	  ballClipper->GenerateClippedOutputOff();
	  ballClipper->Update();

   vtkPolyDataMapper *ballMapper =vtkPolyDataMapper::New();
	  ballMapper->SetInput(ballClipper->GetOutput());
	  ballMapper->SetScalarRange( 0, 2047);
	  ballMapper->ScalarVisibilityOn();

   vtkActor *ball =vtkActor::New();
	  ball->SetMapper( ballMapper);




More information about the vtkusers mailing list