Re: updating vtkimagedata in animation.
David Gobbi <[email protected]> Fri, 18 Jan 2019 15:48:05 -0700
| Newsgroups | gmane.comp.lib.vtk.user |
|---|---|
| Message-ID | <CANwS1=EP0KEX_u6Mx7ph2CROV8az9viH_Sa6hvh=TZPckj6paw@mail.gmail.com> |
Hi Shadab,
When you directly modify data in VTK, it is necessary to call Modified() on
the data container or else the pipeline will not update.
For vtkImageData, the voxel values are stored in an array that can be
retrieved as follows:
data->GetPointData()->GetScalars()
So when you modify voxels, you should also do the following:
data->GetPointData()->GetScalars()->Modified();
data->Modified();
It's been a while since I've done anything similar myself, so there might
be other Modifed() calls that are necessary.
Cheers,
David
On Fri, Jan 18, 2019 at 3:40 PM shadab anwar <[email protected]>
wrote:
> Hi everyone,
>
> I am working on creating an animation of a tool and a workpiece
> (vtkimagedata). Where the tool should move to a location and turnoff the
> voxels (create a hole) at that location. I want to animate a dynamic scene.
>
> I am turning off voxels of workpiece (vtkimagedata) in " virtual void
> Execute () " function of " class vtkTimerCallback" but I am not able
> to render the updated vtkimagedata.
>
> basically I am not able to see the hole at those positions.
>
> Any suggestions? directions? on how its done will be a great help.
>
> Thanks,
> Shadab
>
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Search the list archives at: http://markmail.org/search/?q=vtkusers
Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers