[vtkusers] Beginner question about updating the imagedata inputs to a volume mapping vtk pipeline
Kyle.Blay at csiro.au
Kyle.Blay at csiro.au
Thu Aug 27 22:06:40 EDT 2009
Hi,
I'm trying to get a very basic volume renderer running. I construct a vtkImageData object and dimension / allocate / populate it with data. Then I feed it into a vtkVolumeTextureMapper2D object with SetInput() and attach the appropriate opacity/color transfer functions etc and renderer.
I can get it to render no problems.
What I'm completely mystified with is when I try to tell the mapper to use a different vtkImageData object (with different dimensions, spacings etc) by calling SetInput again. The rendered output clearly reflects the new data I've attached, but the dimensions appear to stay the same as the old vtkImageData... (even if I call RemoveAllInputs first). E.g. if the first image is 600x50x100 and the replacement is 100x100x100, changing the input changes the data (I recognize the 100x100x100 image data), but the appearance on the screen reflects the 600x50x100 data shape.
I'm guessing it's something about the extent to render process / update not being updated. The only way I can seem to get this to happen is by deleting and re-creating the volumetexturemapper2d object and assigning it the new image.
Can anyone give me a quick tip on how I would do this without recreating the mapper object? I've tried Modified() and Update() on the mapper object and it doesn't appear to make any difference.
I'm rather new to vtk, and unfortunately I'm using an old (4.4) version at the moment as I'm trying to resurrect a development project from several years ago... (not sure if I'm game to try and convert to 5.x yet ! :)..
Cheers,
Kyle
More information about the vtkusers
mailing list