[vtkusers] Does a load array not cause an update?

H. Vidal, Jr. hvidal at tesseract-tech.com
Thu Jul 10 12:47:38 EDT 2003

I have the following scenario:

vtkUnsignedShortArray iArray
iArray SetNumberOfValues len

iArray SetArray somePointer len

vtkImageData imgData
imgData SetDimensions x y 1
imgData SetScalarTypeToUnsignedShort
imgData SetSpacing 1.0 1.0 1.0
imgData SetOrigin 0.0 0.0 0.0
[imgData GetPointData] SetScalars iArray

vtkImageMagnify mag
mag SetInput imgData
mag SetMagFactor to whatever

vtkImageViewer imgViewer
imgViewer SetInput [ mag GetOutput]

imgViewer SetColorWindow and SetColorLevel
set vtkiw [ vtkImageViewerWidget .view
             -v imgViewer ]

::vtk::bind_tk_imageviewer_widget $vtkiw

pack .view

This works *the first time* I load it; I can see my data from
somePointer, I can interactively control W/L via mouse, etc.

However, when I attempt the iArray SetArray again (and again and again
in acquisition loop), I do not get a re-display of data, that is, I
continue to see same first frame.

I have tried some Update's on some objects, but I think I am missing
something fundamental about the nature of 'dirty buffers' in vtk so that
implicit refresh of pipeline will be honored. I suspect this has to do
with the SetArray, but I am not sure.

Any suggestions on how to approach this problem?

Many thanks.

Hernando Vidal, Jr.
Tesseract Technology

More information about the vtkusers mailing list