<div dir="ltr">Hi Jose,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 5, 2014 at 12:52 PM, Jose Ignacio Prieto <span dir="ltr"><<a href="mailto:joseignacio.prieto@gmail.com" target="_blank">joseignacio.prieto@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all, I am having a problem trying to show a histogram of a MR image. I would like to set the number of bins by getting all the samples that at least have a frequency of one. </div>
</blockquote><div><br></div><div>There might note be really a way of doing this...</div><div><br></div><div>Is it correct to rephrase your request as:</div><div><br></div><div>"I'm looking for the number of bins that will produce a histogram without empty bins"  ?</div>
<div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Images have the slope/intercept multiplier, so I cannot set the number of bins as max-min because there are lots of empty bins. I don't want them because after the histogram I run a derivative signum change detector to localize the peaks, and this zeros get me a lot of noise.<div>

<br></div></div></blockquote><div><br></div><div>An alternative here might be to smooth the histogram.</div><div><br></div><div>You can treat the histogram as a 1-D image, and</div><div>apply itk image smoothing filters to it.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>I am sure that there is a smarter way than just deleting the zeroes from the hist and keeping them in a dictionary.</div>
<div><br></div></div></blockquote><div><br></div><div><br></div><div>We might not be understanding correctly what you are trying to do.</div><div><br></div><div>Maybe a diagram or an image could help.</div><div><br></div>
<div>   Thanks </div><div><br></div><div>       Luis</div></div></div></div>