[vtkusers] [vtkusers]: Urgent Help: Weird problem with volume rendering

Lisa Avila lisa.avila at kitware.com
Thu May 20 09:25:23 EDT 2004


Hello Thomas,

You need to set your sample distance on the mapper - otherwise it is likely 
sampling right over your entire volume and hence you see nothing.

Lisa


At 12:55 AM 5/20/2004, Thomas - Kuiran Chen wrote:
>Hi there,
>
>I am encouting an very strange problem in volume rendering.
>
>I've had a vtk volume data stored in vtkStructPoints format.  Previously I 
>set the data spacing in (0.1, 0.1, 0.1) millimeters and used the standard 
>volume rendering method to visualize the volume with no problem (the 
>procedure is stated in the VTK user guide).
>
>But when I set the data spacing to (0.0001, 0.0001, 0.0001) meters, 
>without any other changes to the data, the previously workable volume 
>rendering method won't work (simply show nothing in the visualization).
>
>Any one has any clue what happened here?   Help!!!!!
>
>The following is the little rendering codes to the do the job:
>
>         vtkStructuredPointsReader* StructuredPointsReader = 
> vtkStructuredPointsReader::New();
> 
>StructuredPointsReader->SetFileName("../../DataFactory/data_US_RADIUS_ID1018_SET8_DENSE/3D_VTK/Volume_BINARY_2004_0507_1536.vtk");
>
>         // renderer
>         vtkRenderer *aRenderer = vtkRenderer::New();
>         vtkRenderWindow *renWin = vtkRenderWindow::New();
>         renWin->AddRenderer(aRenderer);
>         vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>         iren->SetRenderWindow(renWin);
>
>         // Create compositing ray functions
>         vtkVolumeRayCastCompositeFunction *RayCastCompositeFunction = 
> vtkVolumeRayCastCompositeFunction::New();
>         RayCastCompositeFunction->SetCompositeMethodToInterpolateFirst();
>
>         // Create mip ray functions
>         vtkVolumeRayCastMIPFunction *MIPRayCastFunction = 
> vtkVolumeRayCastMIPFunction::New();
>         MIPRayCastFunction->SetMaximizeMethodToScalarValue();
>
>         //  we can use MIP
>         RaycastMapper->SetVolumeRayCastFunction( MIPRayCastFunction );
>         // This is where input data comes in
>         RaycastMapper->SetInput( StructuredPointsReader->GetOutput() 
> );         // This is where input data comes in
>
>         // Create volume
>         vtkVolume *Volume = vtkVolume::New();
>         Volume->SetProperty( VolumeProperty );
>         Volume->SetMapper( RaycastMapper );
>
>         aRenderer->AddProp( Volume );
>
>         // Camera setup
>         vtkCamera *aCamera = vtkCamera::New();
>         aCamera->SetViewUp (0, 0, -1);
>         aCamera->SetPosition (0, 1, 0);
>         aCamera->SetFocalPoint (0, 0, 0);
>         aCamera->ComputeViewPlaneNormal();
>
>         aRenderer->SetActiveCamera(aCamera);
>         aRenderer->ResetCamera ();
>
>         // Background setup
>         aRenderer->SetBackground(0,0,0);
>         renWin->SetSize(800, 600);
>
>         aRenderer->ResetCameraClippingRange ();
>
>         // interact with data
>         iren->Initialize();
>         iren->Start();
>
>
>Thanks,
>Thomas
>
>
>
>---------------------- Original Message ------------------------
>From: John Biddiscombe <jbiddiscombe at skippingmouse.co.uk>
>To: Bill Vogler; vtkusers at vtk.org <vogler at calcreek.com; vtkusers at vtk.org>
>Sent: 2004-05-19 16:57:41
>Subject: Re: [vtkusers] Need Help with vtkPlaneSource Sizing
>
>Use
>SetOrigin(0.0, 0.0, 0.0)
>SetPoint1(10.0, 0.0, 0.0 );
>SetPoint2(0.0, 34.0, 0.0 );
>
>and then
>SetXResolution(10);
>SetYResolution(340);
>
>and you'll get a plane with 10x340 quadrilaterals with dimensions 1.0x0.1
>
>When you change the resolution, you change the number of quadrilaterals, but
>the area covered is still controlled by point1,point2 and origin
>
>JB
>
>
>----- Original Message -----
>From: "Bill Vogler" <vogler at calcreek.com>
>To: <vtkusers at vtk.org>
>Sent: Wednesday, May 19, 2004 9:41 PM
>Subject: [vtkusers] Need Help with vtkPlaneSource Sizing
>
>
> > Hello -
> >
> > I am having problems sizing a plane created with vtkPlaneSource. The
>created
> > plane is of fixed size and I can't change the size using the member
>function
> > SetResolution();
> >
> > My understanding of a vtkPlaneSource is that it is an array of "m x n"
> > quadrilaterals located on the specified plane. By default the width and
> > height is of length one (1) and the resolution of the plane is controlled
>by
> > XResolution and YResolution (which are both integers).
> >
> > I would like to specify the width and height with a specific dimension of
> > real numbers (i.e., doubles). Therefore I am a bit confused why the
> > dimensions of the plane do not change is response to a SetResolution()
>call.
> > I am also a bit confused on how to specify this dimension using integers.
> >
> > TIA
> >
> > Bill
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>--------------------------------------------------------------------
>
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list