[vtkusers] Saving a sequence of TIFF images

David J. Netherway djn at elan.mad.adelaide.edu.au
Thu Jun 22 04:53:27 EDT 2000


Hello,

I have defined a tcl proc below to save a series of tiff images.
When I call it I get a series of images of the same image. I can see
that rendered image on screen is updated but where do I update the
content of the tiff image. I tried inserting (as below) a "windowToImage
Update" but that had no effect. Where should the update go ?

Thanks, David Netherway


vtkRenderer renderer3D
 vtkRenderWindow renWin3D
    renWin3D AddRenderer renderer3D
 ...etc

set initSaveTiffImages 0
proc SaveTiffImages {} {
  global initSaveTiffImages filename
  if { $initSaveTiffImages != 1 } {
    set initSaveTiffImages 1
    vtkWindowToImageFilter windowToImage
       windowToImage SetInput renWin3D
    vtkTIFFWriter tiffImage
       tiffImage SetInput [windowToImage GetOutput]
  }

  set dir [file dirname $filename]
  set dir [file dirname $dir]/z_axis
  puts "movieDirectory = $dir"
  set cam [renderer3D GetActiveCamera]
  # rotate the camera 360 degress in increments
  set inc 90
  for {set i 0} {$i < 360} {incr i $inc} {
    tiffImage SetFileName $dir/image[format "%03d" $i].tif
    renWin3D Render
    windowToImage Update
    tiffImage Write
    $cam Azimuth -$inc
  }
  renWin3D Render
}






More information about the vtkusers mailing list