[Insight-developers] Histogram code
Jisung Kim
bahrahm@yahoo.com
Wed, 26 Mar 2003 08:31:40 -0800 (PST)
Hi.
There is a method, IncreaseFrequency(measurement
vector, frequency value) that actually does what you
suggested.
The GetMeasurementVector method returns the center (a
vector) of the bin. GetMeasurement(n, dim) returns the
center of n-th bins along the dim-th dimension (which
is a scalar value).
Thanks,
--- "Miller, James V (Research)" <millerjv@crd.ge.com>
wrote:
> I have a few questions on the Histogram class:
>
> 1. The code for building the histogram is rather
> involved, here is a snippet
> from the HistogramMatchingImageFilter
>
> typename HistogramType::IndexType index;
> typename HistogramType::InstanceIdentifier id;
> typename HistogramType::MeasurementVectorType
> measurement;
>
> measurement[0] = value;
> index = histogram->GetIndex( measurement );
> // Step (a)
> id = histogram->GetInstanceIdentifier( index
> ); // Step (b)
> histogram->IncreaseFrequency( id, 1 );
> // Step (c)
>
> I read this as:
> (a) What is the index of the bin that my
> measurement falls in?
> (b) What is the "identifier" for this bin?
> (c) Increase the frequency of said bin
>
> I would think I just want do the following
>
> histogram->InsertMeasurement( measurement );
> // or some API like
> this
>
> and the histogram code will determine what bin that
> measurement falls in and
> update the frequency. Essentially, once I set up the
> structure of histogram,
> I want to treat it rather abstractly. While the
> index and identifier API's
> provide great power, there are pretty low level it
> all you want to do is
> build a histogram and pull off quantiles.
>
>
> 2. What does the
> GetMeasurement(id)/GetMeasurementVector method do on
> a
> histogram? Does it return the bin center?
>
> <?xml:namespace prefix = o ns =
> "urn:schemas-microsoft-com:office:office"
> />
>
> Jim Miller
> _____________________________________
> Visualization & Computer Vision
> GE Research
> Bldg. KW, Room C218B
> P.O. Box 8, Schenectady NY 12301
>
> millerjv@research.ge.com
> <mailto:millerjv@research.ge.com>
>
> james.miller@research.ge.com
> (518) 387-4005, Dial Comm: 8*833-4005,
> Cell: (518) 505-7065, Fax: (518) 387-6981
>
>
>
>
>
=====
Jisung Kim
bahrahm@yahoo.com
106 Mason Farm Rd.
129 Radiology Research Lab., CB# 7515
Univ. of North Carolina at Chapel Hill
Chapel Hill, NC 27599-7515
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com