[vtkusers] How to display contents of vtkImageData

Elvis Dowson elvis.dowson at mac.com
Fri Nov 14 12:53:39 EST 2008


I also just tried extending it to add an alpha component and that  
works fine !

# Fill image with some color and alpha values
set r 255
set g 0
set b 0
set a 100
for {set i 0} {$i <  16} {incr i} {
   for {set p 0} {$p <  16} {incr p} {
   imageData SetScalarComponentFromFloat $i $p 0 0 $r
   imageData SetScalarComponentFromFloat $i $p 0 1 $g
   imageData SetScalarComponentFromFloat $i $p 0 2 $b
   imageData SetScalarComponentFromFloat $i $p 0 3 $a
   }
}



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


More information about the vtkusers mailing list