# AutoRange in vtk.js?

**URL:** https://discourse.vtk.org/t/autorange-in-vtk-js/13464
**Category:** Web
**Created:** [March 6, 2024, 5:09pm UTC](https://discourse.vtk.org/t/autorange-in-vtk-js/13464 "2024-03-06T17:09:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![frankms](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/ccd318/32.png) [@frankms](https://discourse.vtk.org/u/frankms)
#### Post date: [March 6, 2024, 5:09pm UTC](https://discourse.vtk.org/t/autorange-in-vtk-js/13464/1 "2024-03-06T17:09:14Z")

</div>

Does vtk.js offer auto range similar to the c++ version below?

[VTK/Imaging/Statistics/vtkImageHistogramStatistics.cxx at master · Kitware/VTK (github.com)](https://github.com/Kitware/VTK/blob/master/Imaging/Statistics/vtkImageHistogramStatistics.cxx#L130)

I’d like to use auto range as window level for NIFTI images.

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [March 13, 2024, 5:41pm UTC](https://discourse.vtk.org/t/autorange-in-vtk-js/13464/2 "2024-03-13T17:41:03Z")

</div>

vtk.js doesn’t have vtkImageHistogramStatistics, but the auto-range implemention is trivial enough to include in your own application when setting the default window/level parameters.

---

<div class="post-metadata">

### Author: ![frankms](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/ccd318/32.png) [@frankms](https://discourse.vtk.org/u/frankms)
#### Post date: [March 13, 2024, 5:47pm UTC](https://discourse.vtk.org/t/autorange-in-vtk-js/13464/3 "2024-03-13T17:47:04Z")

</div>

Thanks for the reply, I’ve implemented my own auto range, but was wondering if vtk.js already has one.
