# Python Module Logic Class

**URL:** <https://discourse.slicer.org/t/python-module-logic-class/12415>\
**Category:** Development\
**Created:** [July 7, 2020, 1:18pm UTC](https://discourse.slicer.org/t/python-module-logic-class/12415 "2020-07-07T13:18:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vertebra](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/vertebra/32/7475_2.png) [@vertebra](https://discourse.slicer.org/u/vertebra)\
**Post date:** [July 7, 2020, 1:18pm UTC](https://discourse.slicer.org/t/python-module-logic-class/12415/1 "2020-07-07T13:18:14Z")

</div>

Hello! We are working on testing our module, but it only sets the image to the FA.nrrd because of the ScriptedLoadableModuleTest.

 ![Screen Shot 2020-07-07 at 8.57.32 AM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/5/3554cf7f97620906c4c478ae1bbe0fb215ef1162.png)

As you can see, our code uses a pre-placed fiducial point to create a segment around it(called lumbar in this case). Then it sets the parameters for the local threshold function, but the function doesn’t complete. What I mean by that is it sets the parameters but doesn’t control-click/run the function. We think this is because of our logic function.

Does anyone know how to alter the run function in the Scripted Loadable Module Logic to actually run your own program? Is that where we put in:

effect.self().apply(ijkPoints)

If so, how do we run all the functions in our main class?

Thanks!

---

<div class="post-metadata">

**Author:** ![vertebrae](https://avatars.discourse-cdn.com/v4/letter/v/dec6dc/32.png) [@vertebrae](https://discourse.slicer.org/u/vertebrae)\
**Post date:** [July 7, 2020, 1:33pm UTC](https://discourse.slicer.org/t/python-module-logic-class/12415/2 "2020-07-07T13:33:43Z")

</div>

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

---

<div class="post-metadata">

**Author:** ![vertebrae](https://avatars.discourse-cdn.com/v4/letter/v/dec6dc/32.png) [@vertebrae](https://discourse.slicer.org/u/vertebrae)\
**Post date:** [July 7, 2020, 6:51pm UTC](https://discourse.slicer.org/t/python-module-logic-class/12415/5 "2020-07-07T18:51:57Z")

</div>

@lassoan do you have a solution for this?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 7, 2020, 7:26pm UTC](https://discourse.slicer.org/t/python-module-logic-class/12415/6 "2020-07-07T19:26:49Z")

</div>

FA.nrrd is an example that was used in old templates. Please use the latest module template.

You can use any test data - from Slicer’s sample data sets or anything that you upload into your own repository.

I’ve already described [in a different topic](https://discourse.slicer.org/t/python-editing-feature-size-local-threshold/12393/16) how to run `apply` method of Local threshold effect. If you still have problems with that then please ask there. Provide link to your source code, if you have questions about why your code is not working.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 7, 2020, 8:03pm UTC](https://discourse.slicer.org/t/python-module-logic-class/12415/7 "2020-07-07T20:03:57Z")

</div>

2 posts were merged into an existing topic: [Python - Editing Feature Size Local Threshold](https://discourse.slicer.org/t/python-editing-feature-size-local-threshold/12393/18)
