[vtkusers] vtkImageData problem

Gib Bogle g.bogle at auckland.ac.nz
Sun Nov 15 22:31:16 EST 2015


Thanks David, that works.  As to whether I mean to do a DeepCopy - you tell me.  I know just enough to be dangerous.  What would you do?

Cheers
Gib
________________________________
From: David Gobbi [david.gobbi at gmail.com]
Sent: Monday, 16 November 2015 4:24 p.m.
To: Gib Bogle
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkImageData problem

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<mailto: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/20151116/653a2f72/attachment-0001.html>


More information about the vtkusers mailing list