<br><font size=2 face="sans-serif">Hi Luis,</font>
<br>
<br><font size=2 face="sans-serif">As I understand, I should add something
like</font>
<br>
<br><font size=2 face="Courier New"> itk::FixedArray< HistogramMeasurementType,
1 > min_limit;</font>
<br><font size=2 face="Courier New"> min_limit[0] = -0.5;</font>
<br><font size=2 face="Courier New"> itk::FixedArray< HistogramMeasurementType,
1 > max_limit;</font>
<br><font size=2 face="Courier New"> max_limit[0] = -255.5;</font>
<br>
<br><font size=2 face="Courier New"> generator->SetHistogramMin(min_limit);</font>
<br><font size=2 face="Courier New"> generator->SetHistogramMax(max_limit);</font>
<br>
<br><font size=2 face="sans-serif">but </font><font size=2 face="Courier New">HistogramMeasurementType</font><font size=2 face="sans-serif">
is unsigned char, so floating-point values are converted to unsigned char's.</font>
<br><font size=2 face="sans-serif">So how should I set the min and max
of the histogram ?</font>
<br>
<br><font size=2 face="sans-serif">By the way, ImageHistogram3 does count
both values 0 and 255 (bin 0: 26069, bit 254: 30728).</font>
<br>
<br><font size=2 face="sans-serif">Thank you,</font>
<br><font size=2 face="sans-serif"><br>
Mark Rabotnikov<br>
EBW team<br>
CT Engineering<br>
Philips Medical Systems Technologies LTD<br>
Phone: +972-4-8310646<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=33%>
<br>
<br>
<br>
<br>
<br><font size=1 face="sans-serif"><b>Luis Ibanez <luis.ibanez@kitware.com></b>
</font>
<p><font size=1 face="sans-serif">Sent by:</font>
<br><font size=1 face="sans-serif">insight-users-bounces+mark.rabotnikov=philips.com@itk.org</font>
<p><font size=1 face="sans-serif">20/01/2006 14:10</font>
<td width=66%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Mark Rabotnikov/HFA/MS/PHILIPS@PHILIPS</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">insight-users@itk.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [Insight-users] ImageHistogram1
example</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Classification</font></div>
<td></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<div align=right>
<br></div></table>
<br>
<br>
<br><font size=2><tt><br>
Hi Mark,<br>
<br>
The labeling of histogram bins is done based on the value that <br>
corresponds to the middle of the bin.<br>
<br>
This is natural when the intensities are seen as float numbers,<br>
but becomes disconcerting when the intensities are integer.<br>
(as you just pointed out)<br>
<br>
In practice, when you want a bin to capture the 255 values,<br>
you will have to make sure that the range of the bin goes from<br>
<br>
min-bin = 254.5<br>
max-bin = 255.5<br>
<br>
This may require you to play a bit with the min and max of<br>
the total histogram, as well as with the settings of the<br>
number of bins. For an image that have 8 bits pixels, you<br>
may want to have a histogram with bins from<br>
<br>
min-histogram-bin =
-0.5<br>
max-histogram-bin = 255.5<br>
<br>
In that way, the actual integer values of the pixels in your<br>
image will fall squarely inside the bins, and you will get<br>
the bins counting that you expect.<br>
<br>
What you want to avoid is to tell the histogram to use limits<br>
such as:<br>
<br>
min-histogram-bin =
0.0<br>
max-histogram-bin = 255.0<br>
<br>
because then the pixels with values = 255 will not be included<br>
in the last bin, since they are just in the boundary of the bin.<br>
<br>
<br>
<br>
Please let us know if you manage to set up the bins in the way<br>
you want, or if you continue experiencing any problems.<br>
<br>
<br>
Thanks<br>
<br>
<br>
Luis<br>
<br>
<br>
-------------------------<br>
Mark Rabotnikov wrote:<br>
> <br>
> Hello,<br>
> <br>
> I have the following problem. When I run ImageHistogram1 example on
the <br>
> binary image<br>
> Examples\Data\BrainProtonDensitySliceBorder20Mask.png of size 56797
<br>
> pixels, all having values 0 or 255, I get the following result:<br>
> <br>
> Histogram size 255<br>
> bin = 0 frequency = 26069<br>
> bin = 1 frequency = 0<br>
> bin = 2 frequency = 0<br>
> ...................................<br>
> <br>
> bin = 254 frequency = 0<br>
> <br>
> Where are the pixels with value 255 ?<br>
> <br>
> Thank you,<br>
> <br>
> Mark Rabotnikov<br>
> EBW team<br>
> CT Engineering<br>
> Philips Medical Systems Technologies LTD<br>
> Phone: +972-4-8310646<br>
> <br>
> <br>
> ------------------------------------------------------------------------<br>
> <br>
> _______________________________________________<br>
> Insight-users mailing list<br>
> Insight-users@itk.org<br>
> http://www.itk.org/mailman/listinfo/insight-users<br>
<br>
_______________________________________________<br>
Insight-users mailing list<br>
Insight-users@itk.org<br>
http://www.itk.org/mailman/listinfo/insight-users<br>
</tt></font>
<br>