[vtkusers] Fill the Isoline or Isosurface with color

Young-tae Kim ytsemikim at hotmail.com
Sat Jan 25 18:14:32 EST 2003


Hi, there. I really need your guy's help...
I have a 8-bit(jpg saved) RGB image. This image has 9 different color area. 
I converted and resized this image to gray scale. And then I run vtk with 
vtkMarchingContourFilter to generate isoline. After I run the vtk, I can see 
a image which has 9 different area separated by isolines. My problem is that 
I want to fill the RGB color into these area separated by isolines. Right 
now, whenever I run the vtk regardless of # of contours, I have a image 
which has one color isolines. I add my tcl source... Please, help me.

package require vtk
package require vtkinteraction
vtkJPEGReader reader1
reader1 SetFileName "C:/../../T02.jpg"
reader1 Update
vtkMarchingContourFilter iso1
iso1 SetInput [reader1 GetOutput]
iso1 GenerateValues 9 100 200
vtkLookupTable Lut
Lut SetHueRange 0.0 0.667
Lut SetSaturationRange 1.0 1.0
Lut SetValueRange 1.0 1.0
Lut SetAlphaRange 1.0 1.0
Lut SetNumberOfColors 256
Lut Build
vtkPolyDataMapper mapper
mapper SetInput [iso1 GetOutput]
mapper ScalarVisibilityOn
mapper SetScalarRange 100 200
mapper SetLookupTable Lut
vtkActor isoActor1
isoActor1 SetMapper mapper
eval [isoActor1 GetProperty] SetOpacity 0.3
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
ren1 AddActor isoActor1
ren1 SetBackground 1.0 1.0 1.0
renWin SetSize 300 300
iren AddObserver UserEvent {wm deiconify .vtkInteract}
renWin Render





_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail




More information about the vtkusers mailing list