[vtkusers] (no subject)

Sedat DOGAN2 d_sedat at hotmail.com
Sun Aug 13 16:32:32 EDT 2000


Dear Friends,
I have a little problem (I think).But unfortunetely I can't solve it.
My problem is like this:

I rendered a volume with vtkRayCastingMapper.
I have visualized it on the renderwindow.
But when I make some changes on vtkRayCastMapper, I want my program to render the new changes by itself.
I have added update() methods for all related filters and objects , but ı can not render it. I think I couldn't understand backward lazy execution of the pipeline.
My code is as follows:

vtkVolumeProperty *volProperty=vtkVolumeProperty::New();
vtkPieceWiseFunction *opacityTFunc=vtkPiecewiseFunction::New();
     opacityTFunc->AddPoint(0,0.0);
     opacityTFunc->AddPoint(255,0.5);
     
vtkColorTransferFunction *colorTFunc=vtkColorTransferFunction::New();
   colorTFunc->AddRGBPoint(0,0.1,0.1,0.2);
   colorTFunc->AddRGBPoint(64,1,0.0,0.0);
   volProperty->SetColor(colorTFunc);
   volProperty->SetScalarOpacity(opacityTFunc);

vtkVolumeRayCastCompositeFunction *compositeFunction=vtkVolumeRayCastCompositeFunction::New();

vtkVolumeRayCastMapper *volumeMapper=vtkVolumeRayCastMapper::New();
    volumeMapper->SetVolumeRayCastFunction(compositeFunction);
    volumeMapper->SetInput(VTK_Form->tiffReader->GetOutput());

vtkVolume *volume=vtkVolume::New();
    volume->SetMapper(volumeMapper);
    volume->SetProperty(volProperty);
    vtkRenderWindow1->GetRenderer()->AddProp(volume);
 vtkRenderWindow1->GetRenderer()->ResetCamera();


NOW EVERYTHING IS OK. When I click a button. I want to change Raycast compositefunction like this:

vtkVolumeRayCastMIPFunction *MIPFunction=vtkVolumeRayCastMIPFunction::New();
volumeMapper->SetVolumeRayCastFunction(MIPFunction);

vtkRenderWindow1->GetRenderer()->Render();//here it does not update the view.

but when I use mouse in renderwindow, it updates and true image appears on the window. But I want to display the updated volume by itself. HOW CAN I DO THIS.

Thank you very much.

Sedat DOGAN










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


More information about the vtkusers mailing list