# Is there a python api for void qSlicerReformatModuleWidgetPrivate:: resetSlider(qMRMLLinearTransformSlider\* slider)?

**URL:** <https://discourse.slicer.org/t/is-there-a-python-api-for-void-qslicerreformatmodulewidgetprivate-resetslider-qmrmllineartransformslider-slider/33338>\
**Category:** Support\
**Created:** [December 11, 2023, 1:27pm UTC](https://discourse.slicer.org/t/is-there-a-python-api-for-void-qslicerreformatmodulewidgetprivate-resetslider-qmrmllineartransformslider-slider/33338 "2023-12-11T13:27:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![derekcbr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/derekcbr/32/18793_2.png) [@derekcbr](https://discourse.slicer.org/u/derekcbr)\
**Post date:** [December 11, 2023, 1:27pm UTC](https://discourse.slicer.org/t/is-there-a-python-api-for-void-qslicerreformatmodulewidgetprivate-resetslider-qmrmllineartransformslider-slider/33338/1 "2023-12-11T13:27:48Z")

</div>

BreadcrumbsSlicer/Modules/Loadable/Reformat  
/qSlicerReformatModuleWidget.cxx  
Is it possible to call resetSlider method?  
reformatLogic = slicer.modules.reformat.logic()  
reformatLogic.RotateSlice(sliceNode, 0, rotateX)  
reformatLogic.RotateSlice(sliceNode, 1, rotateZ)  
reformatLogic.RotateSlice(sliceNode, 2, rotateY)  
Cause when I change the above rotation, the result will be wrong if not calling resetSlider.  
Thanks!

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [December 11, 2023, 2:55pm UTC](https://discourse.slicer.org/t/is-there-a-python-api-for-void-qslicerreformatmodulewidgetprivate-resetslider-qmrmllineartransformslider-slider/33338/2 "2023-12-11T14:55:21Z")

</div>

@derekcbr, what is the effect that you consider wrong? Is it that the GUI is not updated accordingly?

---

<div class="post-metadata">

**Author:** ![derekcbr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/derekcbr/32/18793_2.png) [@derekcbr](https://discourse.slicer.org/u/derekcbr)\
**Post date:** [December 12, 2023, 1:05am UTC](https://discourse.slicer.org/t/is-there-a-python-api-for-void-qslicerreformatmodulewidgetprivate-resetslider-qmrmllineartransformslider-slider/33338/3 "2023-12-12T01:05:04Z")

</div>

Is it possible to use python to update sliders in GUI? qSlicerReformatModuleWidget

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [December 14, 2023, 9:51am UTC](https://discourse.slicer.org/t/is-there-a-python-api-for-void-qslicerreformatmodulewidgetprivate-resetslider-qmrmllineartransformslider-slider/33338/4 "2023-12-14T09:51:18Z")

</div>

@derekcbr, I’m understanding that your question is due to a mismatch between the reslice rotations you try to implement in python and the UI of the `reformat module`. Based on that:

- The `reformat module` is a loadable module where UI, data model and logic are tightly integrated. Modifications on the data model (e.g., MRML nodes) should be correctly reflected in the UI and vice-versa; logic typically modifies the data model, which in turn, should correctly update the values in the UI.

- You should not need to adjust the UI to reflect changes you produce by changing MRML nodes or invoking public logic functions. This could be a bug int he `reformat module`. Do you have data + python snippet to reproduce the issue. Maybe it is something that should be reported and fixed
