[vtkusers] Input to/output from vtkRencerLaargeImage apparently not refreshing
Steve Chall
stevec at renci.org
Wed Apr 2 17:02:18 EDT 2008
Fellow VTK fans,
I've written an app that generates a sequence of images in a loop, taking
progressive slices through a sampled volume of data. That part is working
just fine using a vtkWindowToImageFilter as input to a vtkPNGWriter.
However, when I try to generate a sequence of images alongside that first
sequence, each of which is identical to its corresponding image in the first
sequence except much bigger (this second sequence uses vtkRenderLargeImage,
instead of vtkWindowToImageFilter, as an input to vtkPNGWriter), then the
0th big image is just fine but all subsequent big images are just the 0th
image repeated over again.
I've tried lots of variants on this scheme, like using different objects
(vtkPNGWriter, etc.) for each, and hooking them up using
SetInput(xxx->SetOutput) vs. SetInputConnection(xxx->GetOutputPort()) with
no change. I'd appreciate it if someone more familiar with
vtkRenderLargeImage could look at the following - extracted from actual code
and adapted to highlight this specific problem, hopefully without fatal
typos or omissions - and tell me what might be wrong. Thanks very much.
-Steve
// .general C++/VTK setup and boilerplate above this point
pngWriter = vtkPNGWriter::New();
windowToImageFilter = vtkWindowToImageFilter::New();
bigRender = vtkRenderLargeImage::New();
renWin = vtkRenderWindow::New();
ren = vtkRenderer::New();
char fileName[255];
renWin->AddRenderer(ren);
renWin->SetSize(640, 480);
bigRender->SetInput(ren);
bigRender->SetMagnification(5);
for (int i = 0; i < numSlices; i++)
{
SetUpNextImage(i); // prepare the image for rendering. This works fine for
small<i>.png.
pngWriter->SetInput(windowToImageFilter->GetOutput());
sprintf(fileName, "small%d.png", i);
pngWriter->SetFileName(fileName);
windowToImageFilter->SetInput(renWin);
diskRenWin->Render();
pngWriter->Write(); // Beautiful: small<i>.png just as I'd expect.
sprintf(fileName, "big%d.png", i);
pngWriter->SetInput(bigRender->GetOutput());
pngWriter->SetFileName(fileName);
pngWriter->Write(); // Uh-oh: every image is just big0.png over
again for all i.
}
-Steve Chall
Senior Research Software Developer
Renaissance Computing Institute
Phone: 919-515-0051
Email: stevec at renci.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080402/ba41b760/attachment.htm>
More information about the vtkusers
mailing list