[vtkusers] MIP volume rendering

Larcher Aurélie aurelie.larcher at imag.fr
Wed Dec 17 04:01:53 EST 2008


Hi Stéphane,

You can use ray cast mapper for MIP rendering :

 

vtkPiecewiseFunction *opacityTransferFunction=vtkPiecewiseFunction::New();  

      /* 


Defines the transparency / scalar values */

vtkColorTransferFunction
*colorTransferFunction=vtkColorTransferFunction::New();

      /* 


Defines colors / scalar values */

vtkVolumeProperty *volumeProperty=vtkVolumeProperty::New();

      volumeProperty->SetColor(colorTransferFunction);

      volumeProperty->SetScalarOpacity(opacityTransferFunction);

      volumeProperty->SetInterpolationTypeToLinear();

vtkVolumeRayCastMIPFunction  *mipFunction =
vtkVolumeRayCastCompositeFunction::New();

vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();

      volumeMapper->SetInput(reader->GetOutput());

      volumeMapper->SetVolumeRayCastFunction(mipFunction);

vtkVolume *volume = vtkVolume::New();

      volume->SetMapper(volumeMapper);

      volume->SetProperty(volumeProperty);

ren->AddVolume(volume);

 

Notes that your reader must be unsigned char or unsigned short, otherwise
use vtkImageCast with the SetOutputScalarTypeToUnsignedShort function.

Aurélie

 

  _____  

De : vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] De la part
de Stéphane CALANDE
Envoyé : mercredi 17 décembre 2008 09:39
À : vtkusers at vtk.org
Objet : [vtkusers] MIP volume rendering

 

Hi vtk-list,


I am looking for an example of MIP-rendering source code with vtk and c++.
Can you help me ?


Thank you very much!

Regards,



Stéphane

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081217/07d7ccf3/attachment.htm>


More information about the vtkusers mailing list