[vtkusers] Histogram

David Gobbi dgobbi at irus.rri.ca
Sat Dec 1 17:16:37 EST 2001


Hi Bruno,

The output from vtkImageAccumulate is, itself, an image.
If you take the histogram of a single-component (i.e. greyscale)
image you get a 1D histogram, where the value of each x pixel
corresponds to the histogram bin count.

If you want the histogram as an array, you can get it as a set
of scalars by doing the following:

accumulate->Update();
scalars = accumulate->GetOutput()->GetPointData()->GetScalars();

Then look at the man page for vtkScalars to see how to get
the individual scalar values.

Note that this has changed in VTK 4.0:  In VTK 4.0, the values
are stored in a vtkDataArray instead of a vtkScalars object. 

I've CC'd this to the VTK user's list because other people might
be interested.

 - David

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

On Sat, 1 Dec 2001, bruno leite wrote:

> 
> David,
> 
> thank you for your attention, but, unfortunately, I have three remaining
> doubts. The first one: How can I get the histogram values using
> vtkImageAccumulate? The second one: Is it possible to display it? And the
> last one: Can I have the values of the histogram in a array of integers,
> so that I can manipulate it?
> 
> Once again thank you for your attention,
> 
> Bruno
> 
> >From: David Gobbi
> >To: bruno leite
> >CC:
> >Subject: Re: [vtkusers] Histogram
> >Date: Mon, 26 Nov 2001 19:59:29 -0500 (EST)
> >
> >Hi Bruno,
> >
> >The filter for creating histograms is called vtkImageAccumulate.
> >
> > - David
> >
> >On Tue, 27 Nov 2001, bruno leite wrote:
> >
> > > Users,
> > >
> > > How can I make histogram from a grayscale tiff image? Is there any
> > > function that I can use?
> > >
> > > Thank You,
> > >
> > > Bruno
> >
> 
> ________________________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
> 
> 




More information about the vtkusers mailing list