[vtkusers] Issue of the volume rendering with using vtkOpenGLGPUVolumeRayCastMapper.

Takahashi takahashi_tak at inet.co.jp
Wed May 26 04:55:26 EDT 2010


Hi, everyone.


I have a problem in the volume redndering with using
vtkOpenGLGPUVolumeRayCastMapper.

I want to move the camera like WalkThrough.

In the past, I had used the vtkFixedPointVolumeRayCastMapper, then the
rendering is always OK.

But, changed to use the vtkOpenGLGPUVolumeRayCastMapper instead of
vtkFixedPointVolumeRayCastMapper,
Rotating the volume actor, sometime the rendering is not good.

Sometimes "whole volume is vanished", "A part of volume is clipped", and
"the rendering image is strange ( like warped )".

I changed only the mapper type, and the camera setting is not changed.


You can reproduce the issue with using the code like as follows.

// VolumeRayCastMapper creating part.
//
// ... image_data is a volume data as vtkImageData
//
{
  vtkOpenGLGPUVolumeRayCastMapper* mapper =
vtkOpenGLGPUVolumeRayCastMapper::New();

  mapper->SetMaxMemoryInBytes( 512 * 1024 * 1024 );
  mapper->SetMaxMemoryFraction( 0.8 );

  mapper->SetInput( image_data );
  mapper->SetBlendModeToComposite();
  mapper->SetAutoAdjustSampleDistances( 1 );
  mapper->Update();
}

// Camera setting part.
//
// ... renderer is a renderer as vtkRenderer.
// ... volume_center ( x, y, z ) is a position of the center of volume data.
{
  camera = renderer->MakeCamera();
  renderer->SetActiveCamera( camera );

  camera->SetparallelProjection( 0 );
  camera->SetPosition( volume_center.x, volume_center.y, volume_center.z );
  camera->SetFocalPoint( volume_center.x, volume_center.y, 1000.0 );
  camera->ViewUp( 0.0, 1.0, 0.0 );
  camera->SetClippingRange( 0.1, 2000.0 );
  camera->SetViewAngle( 30.0 );
}

// Volume actor rotation part.
//
// ... volume_actor is a vtkVolume, which has the
vtkOpenGLGPUVolumeRayCastMapper.
//
{
  volume_actor->RotateWXYX( rot_x, 1.0, 0.0, 0.0 );
  volume_actor->RotateWXYX( rot_y, 0.0, 1.0, 0.0 );
  volume_actor->RotateWXYX( rot_z, 0.0, 0.0, 1.0 );
}


If someone knows the way to avoid this issue, some setting or modification.
Please teach me.


Best regards
Takahashi




More information about the vtkusers mailing list