Thanks a lot, this solved the problem!<br><br>Tijmen<br><br><div class="gmail_quote">On Wed, Jul 6, 2011 at 5:43 PM, Shashwath T.R. <span dir="ltr"><<a href="mailto:trshash@gmail.com">trshash@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Try turning on linear interpolation in the volume property...<div><br></div><div>volumeProperty->SetInterpolationTypeToLinear();</div>
<div><br></div><div>Shash<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Jul 6, 2011 at 7:22 PM, Tijmen Klein <span dir="ltr"><<a href="mailto:T.R.Klein@student.rug.nl" target="_blank">T.R.Klein@student.rug.nl</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">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:<br>
<br><br><div><span style="white-space:pre-wrap"></span>volumeMapper = vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();</div><div><span style="white-space:pre-wrap"></span>volumeMapper->SetInputConnection(reader[1]->GetOutputPort());</div>
<div><br></div>
<div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkVolumeProperty> volumeProperty = vtkSmartPointer<vtkVolumeProperty>::New();</div>
<div><br></div><div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkPiecewiseFunction> compositeOpacity = vtkSmartPointer<vtkPiecewiseFunction>::New();</div><div>compositeOpacity->AddPoint(0.0,0.0);</div>
<div>compositeOpacity->AddPoint(40.0,1.0);</div><div>volumeProperty->SetScalarOpacity(compositeOpacity);</div><div><br></div><div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkColorTransferFunction> color = vtkSmartPointer<vtkColorTransferFunction>::New();</div>
<div>color->AddRGBPoint(0.0 , 0.23,0.30,0.75);</div><div>color->AddRGBPoint(40.0, 0.8 ,0.05 ,0.4);</div><div><span style="white-space:pre-wrap">c</span>olor->SetColorSpaceToDiverging();</div>
<div>volumeProperty->SetColor(color);</div><div><br></div><div><span style="white-space:pre-wrap">v</span>tkSmartPointer<vtkVolume> volume = vtkSmartPointer<vtkVolume>::New();</div><div>
<span style="white-space:pre-wrap"></span>volume->SetMapper(volumeMapper);</div><div><span style="white-space:pre-wrap"></span>volume->SetProperty(volumeProperty);<br><br>The volume is the added to a renderer (I have multiple vtkRenderers but only 1 vtkRenderWindow). I'm also using QT (qvtk widget).<br>
</div>And since a picture says more than a 1000 words, an example of what is looks like: <a href="http://dl.dropbox.com/u/27566470/pixels.png" target="_blank">http://dl.dropbox.com/u/27566470/pixels.png</a><br>This is a crop (without resize) of a screenshot from my running program. All other (non volume) elements look fine.<br>
<br>Does anyone have any idea how to solve this?<br><br><br>Cheers,<br><font color="#888888">Tijmen<br>
</font><br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br>