# ParameterNodeWrapper with dynamic Minimum/Maximum

**URL:** <https://discourse.slicer.org/t/parameternodewrapper-with-dynamic-minimum-maximum/33807>\
**Category:** Development\
**Tags:** python\
**Created:** [January 16, 2024, 10:22pm UTC](https://discourse.slicer.org/t/parameternodewrapper-with-dynamic-minimum-maximum/33807 "2024-01-16T22:22:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [January 16, 2024, 10:22pm UTC](https://discourse.slicer.org/t/parameternodewrapper-with-dynamic-minimum-maximum/33807/1 "2024-01-16T22:22:41Z")

</div>

Hi,

I am working on adapting some code to use the `parameterNodeWrapper` and was wondering if there is any way to set the validator’s Minimum and Maximum values of ctkSliderWidget dynamically at runtime.

## Use case

I have a volume sequence selector in the UI which upon selection should set the maximum value of the slider to the `number of data nodes -1`.

I can directly set the maximum of the slider, but I will receive a ValueError when exceeding the initially set Minimum/Maximum.

Similarly, it would be interesting to validate the value of one parameter to be smaller/larger than another parameter.

---

<div class="post-metadata">

**Author:** ![che85](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/che85/32/636_2.png) [@che85](https://discourse.slicer.org/u/che85)\
**Post date:** [January 16, 2024, 11:11pm UTC](https://discourse.slicer.org/t/parameternodewrapper-with-dynamic-minimum-maximum/33807/2 "2024-01-16T23:11:51Z")

</div>

Since there is already a binding between the UI and the parameter node, could we simply update the UI component’s minimum/maximum values and adjust the validation parameters accordingly?

Is there a way to access the validator directly through the parameterNodeWrapper?
