[vtkusers] Problem with very pixelated volume rendering

Tijmen Klein T.R.Klein at student.rug.nl
Wed Jul 6 09:52:30 EDT 2011


I'm trying to create a volume rendering. The output seems to be ok, but is
very pixelated. It seems like the sampling resolution is too low. I tried
adjusting the imageSampleDistance and autoAdjustSampleDistances, but the
result was the same. My basic code looks like this:


volumeMapper = vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();
volumeMapper->SetInputConnection(reader[1]->GetOutputPort());

vtkSmartPointer<vtkVolumeProperty> volumeProperty =
vtkSmartPointer<vtkVolumeProperty>::New();

vtkSmartPointer<vtkPiecewiseFunction> compositeOpacity =
 vtkSmartPointer<vtkPiecewiseFunction>::New();
compositeOpacity->AddPoint(0.0,0.0);
compositeOpacity->AddPoint(40.0,1.0);
volumeProperty->SetScalarOpacity(compositeOpacity);

vtkSmartPointer<vtkColorTransferFunction> color =
 vtkSmartPointer<vtkColorTransferFunction>::New();
color->AddRGBPoint(0.0 , 0.23,0.30,0.75);
color->AddRGBPoint(40.0, 0.8 ,0.05 ,0.4);
color->SetColorSpaceToDiverging();
volumeProperty->SetColor(color);

vtkSmartPointer<vtkVolume> volume = vtkSmartPointer<vtkVolume>::New();
volume->SetMapper(volumeMapper);
volume->SetProperty(volumeProperty);

The volume is the added to a renderer (I have multiple vtkRenderers but only
1 vtkRenderWindow). I'm also using QT (qvtk widget).
And since a picture says more than a 1000 words, an example of what is looks
like: http://dl.dropbox.com/u/27566470/pixels.png
This is a crop (without resize) of a screenshot from my running program. All
other (non volume) elements look fine.

Does anyone have any idea how to solve this?


Cheers,
Tijmen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110706/391598e6/attachment.htm>


More information about the vtkusers mailing list