[vtkusers] vtkImageAccumulate

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Mon Nov 11 18:29:46 EST 2002


>     hist.SetComponentExtent(0, 255, 0, 255, 1, 93);

Surely you want something a bit more reasonable like
  accum SetComponentExtent 0 255 0 0 0 0
  accum SetComponentSpacing 12 12 0.0

did you read the docs?

  // Description:
  // Set/Get - The component extent sets the number/extent of the bins.
  // For a 1D histogram with 10 bins spanning the values 1000 to 2000,
  // this extent should be set to 0, 9, 0, 0, 0, 0.
  // The extent specifies inclusive min/max values.
  // This implies the the top extent should be set to the number of bins -
1.

  // Description:
  // Set/Get - The component spacing is the dimension of each bin.
  // This ends up being the spacing of the output "image".
  // If the number of input scalar components are less than three,
  // then some of these spacing values are ignored.
  // For a 1D histogram with 10 bins spanning the values 1000 to 2000,
  // this spacing should be set to 100, 0, 0

  // Description:
  // Set/Get - The component origin is the location of bin (0, 0, 0).
  // Note that if the Component extent does not include the value (0,0,0),
  // then this origin bin will not actually be in the output.
  // The origin of the output ends up being the same as the componenet
origin.
  // For a 1D histogram with 10 bins spanning the values 1000 to 2000,
  // this origin should be set to 1000, 0, 0

your input data has only 1 scalar component, ( and is 0-255 char data) so
you can only accumulate over one dimension between o and 255. Hence
  accum SetComponentExtent 0 26 0 0 0 0
  accum SetComponentSpacing 10 0 0
  accum SetComponentOrigin 0 0 0

will give bins from 0 to 9, 10 to 19 etc up to 250 to 259 (half used!)
and the output will be a 1 dimensional structured points dataset which will
not be interesting to view unless you do some jiggery pokery with it to make
a nice plot etc.

JB







More information about the vtkusers mailing list