[vtkusers] Point rendering : how to filter values with a vtkLookupTable
REGAT-BARREL Aurélien
arbvtk at yahoo.fr
Wed Feb 4 09:24:04 EST 2004
Hello,
I have a vtkStructuredPoints which contains some interesting values but also some "empty" values (=0) that are viewed in black, all around the interesting object which is composed by points from values 1 to 255. I would like to not see points with value zero, in order to "free" the object inside. I tried to play with a vtkLookupTable in order to assign a null alpha value to black points (=0) but it didn't work. The mapper seems to ignore my changes to its lookuptable. Here is an example. How can I filter black values without modifying my vtkStructuredPoints.
package require vtk
package require vtkinteraction
package require vtktesting
vtkMath math
# 20x10x10 points
set numberOfInputPoints 2000
vtkUnsignedCharArray scalars
for {set i 0} {$i < $numberOfInputPoints} {incr i 1} {
scalars InsertNextTuple1 [math Random 0 255]
}
vtkStructuredPoints cloud
cloud SetDimensions 20 10 10
cloud SetOrigin 0 0 0
cloud SetSpacing 1 1 1
[cloud GetPointData] SetScalars scalars
vtkDataSetMapper mapper
mapper SetInput cloud
mapper SetScalarRange 0 256
vtkActor actor
actor SetMapper mapper
vtkRenderer ren
ren AddActor actor
ren SetBackground 0 0 0
vtkRenderWindow renWin
renWin AddRenderer ren
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
renWin SetSize 500 500
renWin Render
iren Start
wm withdraw .
Later, I would like to create a slider that allows the user to filter viewed values from 0 to 255. How to do that ?
I attach a screenshot that shows my problem. I have a 3D object but I can't see it well. Black values are undesirable.
Thanks.
Aurélien
---------------------------------
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040204/24fa43c7/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bloc.png
Type: image/x-png
Size: 25069 bytes
Desc: bloc.png
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040204/24fa43c7/attachment.bin>
More information about the vtkusers
mailing list