[vtkusers] vtkImageData problem

David Gobbi david.gobbi at gmail.com
Sun Nov 15 22:24:11 EST 2015


In VTK 6 the data objects don't have an Update method.  You
have to call Update on the filter that generates the data.

w2i->Modified();
w2i->Update();
id = w2i->GetOutput();

On an unrelated note, did you mean to do a DeepCopy here?

id = vtkImageData::New();
id = w2i->GetOutput();

 - David



On Sun, Nov 15, 2015 at 8:17 PM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:

> Having got my program to build and run with VTK-6.3, I am now encountering
> a problem with its behaviour.  The 3D display of the scene is working fine,
> but code that captures the image (for creating a video) is failing.
>
> Previously I have been doing this with VTK-5.10:
>
> id = vtkImageData::New();
>
> id = w2i->GetOutput();
>
> w2i->Modified();
>
> id->Update();
>
> imwidth = id->GetDimensions()[0];
>
> imheight = id->GetDimensions()[1];
>
> if (imwidth == 0) {
>
>     LOG_QMSG("ERROR: recorder: vtkImageData dimension = 0");
>
>     exit(1);
>
> }
>
> To get this to compile now I have to comment out the id->Update().  When the program executes it stops with the error that imwidth=0.
>
> Should I replace id->Update() with something else?
>
> Thanks
> Gib
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151115/5a1337d4/attachment.html>


More information about the vtkusers mailing list