[vtkusers] Proposal: vtkImageData Shift/Scale

David Gobbi dgobbi at irus.rri.on.ca
Mon Oct 30 20:15:12 EST 2000


This is a comment about integer Scalars in general.

Usually, when I read a data set into vtkStructuredPoints or vtkImageData,
the scalar values that are read in have some sort of dimension to them,
i.e. they represent intensity or Hounsfield units or density or some other
physical quantity.

If the data is stored in a set of integer scalars, I would like to be able
to map the integer value n to the real, physical value v that the data
represents, i.e.

v = i*Scale + Shift

The Shift & Scale could be IVars of vtkImageData, or IVars of vtkScalars.
My preference is that they be IVars of vtkScalars.
The usual way of setting them would be e.g. via
vtkImageReader::SetDataScale(), vtkImageReaderSetDataShift()
Each imaging filter would have the option of either ignoring or using
the Shift & Scale (and it would be written in the docs for each filter
whether they did or didn't ignore them).  Ideally, the vtkLookupTable
would apply the shift & scale before converting the scalars.

What does everyone think of this?  Having this feature added to VTK would
make my life a fair bit easier (and I'd be willing to make the necessary
changes).

 - David

--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario





More information about the vtkusers mailing list