[vtkusers] Getting pixel values

Julian humphries at mail.utexas.edu
Mon Jul 2 19:03:17 EDT 2001


TJ Wilkinson wrote:
> 
> I am using vtkImager, vtkImageMapper, vtkActor2D to display 3D volumes
> slice-wise.  

Is there anybody on this list who hasn't written a slice viewer???  Perhaps
somebody (of course, not me!) should start a GNU type slice viewer project
over at SourceForge.  (Note, I am as guilty of as everybody else of 
rolling my own)


I would like to probe the underlying pixel values.  Should I
> use a Picker for this, or just use the interface somehow?  And once I have
> the point in terms of the image extent, what method is appropriate to call
> to find out the pixel value?  Do I need to GetScalarPointer and index to
> the pixel in question?


As I suspect many others have, I use a widget library to make handling of
things like window and mouse interaction easier.  In my case it was 
wxPython with a mouse motion event handler.  In the event handler I  use
GetPixelData from the current render window and write x and y position and
scalar value to the window with a textmapper.  This is also a simple way to
navigate through the stack, alter contrast, etc.

Incidently, I have found the combination of VTK and wxPython to work quite
well.  Throw in a little PIL and you can input and output most anything.

Julian Humphries
University of Texas




More information about the vtkusers mailing list