[Insight-developers] Histogram code

Miller, James V (Research) millerjv@crd.ge.com
Wed, 26 Mar 2003 08:54:05 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2F39F.2A8A1FC0
Content-Type: text/plain;
	charset="iso-8859-1"

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 

 

 

------_=_NextPart_001_01C2F39F.2A8A1FC0
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2715.400" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=652271913-26032003><FONT size=2>I have a few questions on the 
Histogram class:</FONT></SPAN></DIV>
<DIV><SPAN class=652271913-26032003></SPAN><SPAN 
class=652271913-26032003></SPAN><SPAN class=652271913-26032003><FONT 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2>1. The code for building the 
histogram is rather involved, here is a snippet from the 
HistogramMatchingImageFilter</FONT></SPAN></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typename 
HistogramType::IndexType index;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typename 
HistogramType::InstanceIdentifier id;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typename 
HistogramType::MeasurementVectorType measurement;<BR>&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; measurement[0] = 
value;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; index = histogram-&gt;GetIndex( 
measurement );<SPAN class=652271913-26032003>&nbsp;&nbsp; // Step 
(a)</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id = 
histogram-&gt;GetInstanceIdentifier( index );<SPAN 
class=652271913-26032003>&nbsp;&nbsp;&nbsp; // Step 
(b)</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; histogram-&gt;IncreaseFrequency( 
id, 1 );<SPAN 
class=652271913-26032003>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
// Step (c)</SPAN><BR></FONT></DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2>I read this as: 
</FONT></SPAN></DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(a) What is the index of the bin that my measurement falls 
in?</FONT></SPAN></DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(b) What is the "identifier" for this bin?</FONT></SPAN></DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(c) Increase the frequency of said bin</FONT></SPAN></DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2>I would think I just want do 
the following</FONT></SPAN></DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=652271913-26032003>&nbsp;&nbsp;&nbsp;<FONT 
size=2>&nbsp;&nbsp;&nbsp; histogram-&gt;InsertMeasurement( measurement );&nbsp; 
// or some API like this</FONT></SPAN></DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2>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.&nbsp; 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.</FONT></SPAN></DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=652271913-26032003><FONT size=2>2. What does the 
GetMeasurement(id)/GetMeasurementVector method do on a histogram? Does it return 
the bin center?</FONT></SPAN></DIV>
<DIV class=Section1>
<P class=MsoNormal>&nbsp;<?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P style="MARGIN: 0in 0in 0pt"><B><SPAN 
style="COLOR: navy; FONT-FAMILY: 'Comic Sans MS'">Jim Miller</SPAN></B> 
<BR><B><I><SPAN 
style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial">_____________________________________</SPAN></I></B><BR><EM><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Visualization &amp; 
Computer Vision</SPAN></EM><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial"><BR><EM>GE 
Research</EM><BR><EM>Bldg. KW, Room C218B</EM><BR><EM>P.O. Box 8, Schenectady NY 
12301</EM><BR><BR></SPAN></I><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue"><A 
href="mailto:millerjv@research.ge.com">millerjv@research.ge.com</A></SPAN></U></EM></P>
<P style="MARGIN: 0in 0in 0pt"><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue">james.miller@research.ge.com</SPAN></U></EM><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">(518) 387-4005, Dial 
Comm: 8*833-4005, </SPAN></I><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Cell: (518) 505-7065, 
Fax: (518) 387-6981</SPAN></I> </P>
<P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C2F39F.2A8A1FC0--