[vtkusers] Is it surface/volume rendering for VE?
Andres Barrera
andresba at hotmail.com
Tue Dec 21 12:01:32 EST 2004
Hi Mohamed,
I haven't tried to get exactly what you want, but you can enhance your
visualization (if you want to use surface rendering) with setting some actor
properties such as:
smoothActor->SetMapper( parisonMapper);
Actor->GetProperty()->SetDiffuse (...);
Actor->GetProperty()->SetSpecularColor(...);
Actor->GetProperty()->SetSpecular(...);
Actor->GetProperty()->SetSpecularPower(...);
Actor->GetProperty()->SetAmbient(...);
Also, by using 'vtkPolyDataNormals', your surfaces will look smoother.
Andres
PS: here's some code you can use to start playing with (at your own risk! :D
)....
void openSmoothSTLActor(char * fileName, vtkActor* smoothActor)
{
vtkSTLReader * sr = vtkSTLReader::New();
sr->SetFileName( fileName );
vtkGeometryFilter *geom = vtkGeometryFilter::New();
geom->SetInput( sr->GetOutput() );
vtkPolyDataNormals *Normals = vtkPolyDataNormals::New();
Normals->SetInput ( geom->GetOutput() );
Normals->SetFeatureAngle( 100 );
vtkLookupTable *lut = vtkLookupTable::New();
lut->SetHueRange( 0.0, 0.66667);
vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
parisonMapper->SetInput ( Normals->GetOutput() );
parisonMapper->SetLookupTable( lut );
parisonMapper->SetScalarRange( 0.12, 1.0 );
if (smoothActor == NULL)
smoothActor = vtkActor::New();
smoothActor->SetMapper( mapper );
smoothActor->GetProperty()->SetSpecularColor(
smoothActor->GetProperty()->GetColor() );
smoothActor->GetProperty()->SetSpecular(0.3);
smoothActor->GetProperty()->SetSpecularPower(20);
smoothActor->GetProperty()->SetAmbient(0.2);
smoothActor->GetProperty()->SetDiffuse(0.8);
// clean up ...
sr ->Delete();
geom ->Delete();
Normals ->Delete();
lut ->Delete();
mapper ->Delete();
}
>
>Dear VtkUsers,
>
>I need to visualize the internal views of hollow organs. I tried both
>surface and volume rendering of vtk. However, i never get the output
>provided by commercial packages such as
>
>http://www.vitalimages.com/vipage.aspx?pg=ct-colonography
>
>My questions are, if you already saw that website.
>
>1. Are they using surface/volume rendering (I believe surface!)
>2. How to achieve that quality using vtk. Is it a light problem, or
>rendering technique one.
>
>I do not think it is my graphic card problem because i have "nvidia Quadro
>FX 3000. "
>
>
>thanks for your help.
>
>
>
>Mohamed Sabry Mohamed
>Medical Imaging Research Assistant
>CVIP Lab
>University of Louisville
>Kentucky, USA.
>msabry at cairo.spd.louisville.edu
>
>_________________________________________________________________
>Express yourself instantly with MSN Messenger! Download today it's FREE!
>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>_______________________________________________
>This is the private VTK discussion list. Please keep messages on-topic.
>Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list