[vtkusers] Saving a sequence of TIFF images

Patrick de Koning patrick at lkeb.azl.nl
Thu Jun 22 05:10:01 EDT 2000


"David J. Netherway" wrote:
> 
> 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 ?
> 

Try using "windowToImage Modified" instead of "windowToImage Update".
That works for me

> 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
> }
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> vtkusers mailing list
> vtkusers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtkusers

-- 
--------------------------------------------------------------------
Ir. P.J.H. de Koning                    Leiden University Medical Center
Department of Radiology, C2S            Division of Image Processing
P.O. Box 9600                           2300 RC  LEIDEN
the Netherlands                         Tel. +31-71-5266206  
Fax +31-71-5266801                      Email patrick at lkeb.azl.nl




More information about the vtkusers mailing list