# What's Causing These Slicer / Python Errors

**URL:** <https://discourse.slicer.org/t/whats-causing-these-slicer-python-errors/17447>\
**Category:** Development\
**Tags:** python\
**Created:** [May 4, 2021, 4:08pm UTC](https://discourse.slicer.org/t/whats-causing-these-slicer-python-errors/17447 "2021-05-04T16:08:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 4, 2021, 4:08pm UTC](https://discourse.slicer.org/t/whats-causing-these-slicer-python-errors/17447/1 "2021-05-04T16:08:52Z")

</div>

@pieper @lassoan @jcfr @jamesobutler

My module works perfectly except if I push the “Set Thickness” button first. Then hardly anything works. If I push other buttons first, everything works perfectly. We beta test next Monday, so HELP!!!

This issue is listed in tracker here: https://github.com/KitwareMedical/SlicerQReads/issues/103

Here’s the deal. After I push the “Set Threshold” button I get this error…

```
Traceback (most recent call last):
  File "/home/jcfr/Projects/SlicerQReads-Release/Slicer-build/lib/SlicerQReads-4.13/qt-scripted-modules/QReads.py", line 389, in updateGUIFromParameterNode
    QReadsLogic.slabThicknessInMmToNumberOfSlices(volumeNode, slabThicknessInMm))
  File "/home/jcfr/Projects/SlicerQReads-Release/Slicer-build/lib/SlicerQReads-4.13/qt-scripted-modules/QReads.py", line 612, in slabThicknessInMmToNumberOfSlices
    assert tichknessInMm > 0
AssertionError

```

Here’s the code segments at 389 and 612

> ```
> def updateGUIFromParameterNode(self, caller=None, event=None):
> QReadsLogic.setSlab( (line 389)
> QReadsLogic.slabModeFromString(slabModeStr),
> QReadsLogic.slabThicknessInMmToNumberOfSlices(volumeNode, slabThicknessInMm))
> 
> ```

```
@staticmethod
  def slabThicknessInMmToNumberOfSlices(volumeNode, tichknessInMm):
     if volumeNode is None:
      return 1
    assert tichknessInMm > 0 (line 612)
    return int(tichknessInMm / max(volumeNode.GetSpacing()))

```

… and no jokes anout

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [May 4, 2021, 4:55pm UTC](https://discourse.slicer.org/t/whats-causing-these-slicer-python-errors/17447/2 "2021-05-04T16:55:43Z")

</div>

3 posts were merged into an existing topic: [SlicerQR Development](https://discourse.slicer.org/t/slicerqr-development/15954)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [May 4, 2021, 4:55pm UTC](https://discourse.slicer.org/t/whats-causing-these-slicer-python-errors/17447/3 "2021-05-04T16:55:44Z")

</div>


