# Treshold terminology

**URL:** https://discourse.paraview.org/t/treshold-terminology/11307
**Category:** Development
**Tags:** proposal
**Created:** [January 31, 2023, 3:04pm UTC](https://discourse.paraview.org/t/treshold-terminology/11307 "2023-01-31T15:04:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ondrej\_Kincl](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ondrej_kincl/32/10723_2.png) [@Ondrej\_Kincl](https://discourse.paraview.org/u/Ondrej_Kincl)
#### Post date: [January 31, 2023, 3:04pm UTC](https://discourse.paraview.org/t/treshold-terminology/11307/1 "2023-01-31T15:04:58Z")

</div>

When I use the Threshold filter on a dataset in Paraview 5.10 or 5.11, I have the option to change the threshold method from “Between” (which is default) to “Above upper threshold” or “Below lower threshold”. I find this formulation confusing and inconsistent with the “Between” method. I think the correct names should be “Above lower threshold” and “Below upper threshold”.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 31, 2023, 3:05pm UTC](https://discourse.paraview.org/t/treshold-terminology/11307/2 "2023-01-31T15:05:57Z")

</div>

WDYT @Tiffany_Chhim ?

---

<div class="post-metadata">

### Author: ![Tiffany\_Chhim](https://discourse.paraview.org/user_avatar/discourse.paraview.org/tiffany_chhim/32/10690_2.png) [@Tiffany\_Chhim](https://discourse.paraview.org/u/Tiffany_Chhim)
#### Post date: [January 31, 2023, 3:10pm UTC](https://discourse.paraview.org/t/treshold-terminology/11307/3 "2023-01-31T15:10:56Z")

</div>

Hello Ondřej,

I agree that it can sound a bit counter intuitive compared to the “Between” mode.  
One reason for this behavior is that existing code was used when the new modes "Above upper threshold” and “Below lower threshold” were added.

Changing these to “Above lower threshold” and “Below upper threshold” would require adding a couple of new methods to produce the desired effects.

---

<div class="post-metadata">

### Author: ![Ondrej\_Kincl](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ondrej_kincl/32/10723_2.png) [@Ondrej\_Kincl](https://discourse.paraview.org/u/Ondrej_Kincl)
#### Post date: [January 31, 2023, 3:47pm UTC](https://discourse.paraview.org/t/treshold-terminology/11307/4 "2023-01-31T15:47:00Z")

</div>

Hello Tiffany,

Thank you for your reply. However, I think that “Above lower threshold” could be implemented using the existing code as “Between” method with the upper threshold automatically set to plus infinity (or maximum value). I don’t understand why that would be difficult?

---

<div class="post-metadata">

### Author: ![Tiffany\_Chhim](https://discourse.paraview.org/user_avatar/discourse.paraview.org/tiffany_chhim/32/10690_2.png) [@Tiffany\_Chhim](https://discourse.paraview.org/u/Tiffany_Chhim)
#### Post date: [February 1, 2023, 3:37pm UTC](https://discourse.paraview.org/t/treshold-terminology/11307/5 "2023-02-01T15:37:35Z")

</div>

That’s a good question. If we look into the API for `vtkThreshold`, we have the following methods:

```auto
  /**
   * Methods used for thresholding. vtkThreshold::Lower returns true if s is lower than the lower
   * threshold, vtkThreshold::Upper returns true if s is larger than the upper threshold, and
   * vtkThreshold::Between returns true if s is between the lower and upper thresholds.
   *
   * [...]
   */
  int Lower(double s) const;
  int Upper(double s) const;
  int Between(double s) const;

```

Notice the description for the `Upper` and `Lower` methods. Those are the reason for the choice that was made 🙂

---

<div class="post-metadata">

### Author: ![Ondrej\_Kincl](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ondrej_kincl/32/10723_2.png) [@Ondrej\_Kincl](https://discourse.paraview.org/u/Ondrej_Kincl)
#### Post date: [February 1, 2023, 3:51pm UTC](https://discourse.paraview.org/t/treshold-terminology/11307/6 "2023-02-01T15:51:57Z")

</div>

So this oddity was created by programmers behind vtk. I understand. 🙂
