[vtkusers] Contouring (again)

Liam Kurmos quantum.leaf at googlemail.com
Wed Jul 21 07:11:53 EDT 2010


> OK, so I'm still having some issues. This may be a stupid question, but how
> can I get the grid back?

by the grid I guess you mean the vtkImageData?

>
> Can I recreate the grid from GetMapper()->GetInput() on the actor, or have I
> completely lost the original volumetric data?

I can't comment on this, without investigating. I always have a
reference to the vtkImageData.
>
> The only way I can see is to create the grid as a global variable and keep
> it throughout, but I not sure this is best practice, as I have to ensure it
> is deleted at some point and it may cause a memory leek.
>

If you use a smart pointer you don't need to worry about deleting the
volume, it will happen automatically when the last reference to it
goes out of scope.
In C++ you can make a class variable that has a reference to the
vtkImageData and pass this around.

this is what i do anyway, hope this helps,

Liam



More information about the vtkusers mailing list