[vtkusers] Volume rendering too slow

Edgar Andrasch edgar.andrasch at gmx.de
Tue Apr 1 13:27:51 EDT 2008


Hello,

I want to render a volume in vtk. It is very slowly. How can I accelerate this? I have to use a vtkVolumeRayCastMapper.

//Convert the node data to an mitk::Image
mitk::Image::Pointer img = dynamic_cast<mitk::Image*>( node->GetData() );
//Pointer to the vtkVolumeRayCastMapper
vtkVolumeRayCastMapper *volumeMapper;
//Set the selected image fot the vtkVolumeRayCastMapper
volumeMapper->SetInput(img->GetVtkImageData())
//Volumerendering
node->SetProperty( "volumerendering", new mitk::BoolProperty( true ) );
// create a transfer function to assign optical properties (color and opacity) to grey-values of the data
mitk::TransferFunction::Pointer tf = mitk::TransferFunction::New();
tf->InitializeByMitkImage ( img );
// set the piecewise opacity transfer function AddPoint(double x, double y)
tf->GetScalarOpacityFunction()->AddPoint (lowPoint , 0 );
tf->GetScalarOpacityFunction()->AddPoint (highPoint , 1 );
//Pointer on actual renderer
vtkRenderer* rendererAct;
//Get the VtkRenderer
rendererAct = m_MultiWidget->GetRenderWindow4()->GetRenderer()->GetVtkRenderer();	
//Transferfunction
node->SetProperty ( "TransferFunction", new mitk::TransferFunctionProperty ( tf.GetPointer() ) );
//Update the actual window
mitk::RenderingManager::GetInstance()->RequestUpdate(rendererAct->GetRenderWindow());

Thanks for all responses
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger



More information about the vtkusers mailing list