[ITK-users] [Insight-users] Histogram number of bins automatic

Luis Ibanez luis.ibanez at kitware.com
Wed Mar 19 11:26:26 EDT 2014


Hi Jose,

On Wed, Mar 5, 2014 at 12:52 PM, Jose Ignacio Prieto <
joseignacio.prieto at gmail.com> wrote:

> 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.
>

There might note be really a way of doing this...

Is it correct to rephrase your request as:

"I'm looking for the number of bins that will produce a histogram without
empty bins"  ?




> 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.
>
>
An alternative here might be to smooth the histogram.

You can treat the histogram as a 1-D image, and
apply itk image smoothing filters to it.


> I am sure that there is a smarter way than just deleting the zeroes from
> the hist and keeping them in a dictionary.
>
>

We might not be understanding correctly what you are trying to do.

Maybe a diagram or an image could help.

   Thanks

       Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140319/411a279b/attachment.html>


More information about the Insight-users mailing list