I forgot to say that after the file name dialog and before the image save I need to switch back to displaying the VTK scene (otherwise, of course, the image file contains a blank screen).