[vtkusers] slow MIP render

Jonathan Gagnon jonathangagnon at gmail.com
Tue May 30 06:07:02 EDT 2006


Hi,
I'm doing a MIP renderer but it is really slow. Here is my code :

    vtkStructuredPointsReader* vtkreader = readVolume(vtkfile);
    vtkreader->GetOutput()->ReleaseDataFlagOn();

    vtkImageCast* vtkImageCast = vtkImageCast::New();
    vtkImageCast->SetInput(vtkreader->GetOutput());
    vtkImageCast->SetOutputScalarTypeToUnsignedChar();

    vtkImageData *nouvelle_image =vtkImageData::New();
    nouvelle_image = vtkImageCast->GetOutput();

    vtkPiecewiseFunction* opacityTransferFunction =
vtkPiecewiseFunction::New();
    opacityTransferFunction->AddPoint(20.0, 0.0);
    opacityTransferFunction->AddPoint(255.0, 0.2);

    vtkVolumeProperty* volumeProperty = vtkVolumeProperty::New();
    volumeProperty->SetScalarOpacity(opacityTransferFunction);
    volumeProperty->SetInterpolationTypeToNearest();
    volumeProperty->SetScalarOpacityUnitDistance(1.0);
    volumeProperty->SetShade(0);

    volumeMapper->SetInput(nouvelle_image);

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

    aRenderer->AddActor(volume);


Is there a way to make it faster without loosing details ?

Thanks,

jo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060530/b61e57a9/attachment.htm>


More information about the vtkusers mailing list