# Histogram Fixed Bin Size

**URL:** https://discourse.itk.org/t/histogram-fixed-bin-size/2243
**Category:** Uncategorized
**Created:** [September 11, 2019, 7:51pm UTC](https://discourse.itk.org/t/histogram-fixed-bin-size/2243 "2019-09-11T19:51:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sarthakpati](https://discourse.itk.org/user_avatar/discourse.itk.org/sarthakpati/32/383_2.png) [@sarthakpati](https://discourse.itk.org/u/sarthakpati)
#### Post date: [September 11, 2019, 7:51pm UTC](https://discourse.itk.org/t/histogram-fixed-bin-size/2243/1 "2019-09-11T19:51:33Z")

</div>

Hi,

I am trying to calculated Histogram based on the Fixed Bin Size (as opposed to giving the number of total bins). Is that possible in ITK?

Reference: [https://ibsi.readthedocs.io/en/latest/03\_Image\_processing.html?highlight=fbs#fixed-bin-size](https://ibsi.readthedocs.io/en/latest/03_Image_processing.html?highlight=fbs#fixed-bin-size)

Thanks,  
Sarthak

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [September 11, 2019, 8:30pm UTC](https://discourse.itk.org/t/histogram-fixed-bin-size/2243/2 "2019-09-11T20:30:27Z")

</div>

You can accomplish that by setting the number of bins and minimum and maximum values. [Example](https://itk.org/Doxygen/html/SphinxExamples_2src_2Numerics_2Statistics_2HistogramCreationAndBinAccess_2Code_8cxx-example.html#_a1).

`BinSize=(Max-Min)/Number`
