# Running a Scripted CLI Module in Parallel

**URL:** <https://discourse.slicer.org/t/running-a-scripted-cli-module-in-parallel/12687>\
**Category:** Development\
**Tags:** segmentation, module\
**Created:** [July 22, 2020, 2:03pm UTC](https://discourse.slicer.org/t/running-a-scripted-cli-module-in-parallel/12687 "2020-07-22T14:03:46Z")\
**Posts on this page:** 3\
**Page:** 1

<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 22, 2020, 2:03pm UTC](https://discourse.slicer.org/t/running-a-scripted-cli-module-in-parallel/12687/1 "2020-07-22T14:03:46Z")

</div>

Hello,

I have a local threshold segmentation code in a scripted python module which iterates through fiducial points and runs the local threshold function. Iterating through points takes a while to do and to speed it up, I would like it to run in parallel with a scripted CLI python module. I have set a list of parameters, and I have this line of code:

slicer.cli.runSync(slicer.modules.climodulecode, None, param, True, True)

I am not sure what to do in terms of adding code to the scripted cli module and how to use the parameters from there. I have looked at some examples but I am still a little unclear.

Thanks

---

<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 23, 2020, 1:33am UTC](https://discourse.slicer.org/t/running-a-scripted-cli-module-in-parallel/12687/2 "2020-07-23T01:33:12Z")

</div>

2 posts were merged into an existing topic: [Running a Module in Parallel](https://discourse.slicer.org/t/running-a-module-in-parallel/12641)

---

<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 23, 2020, 1:33am UTC](https://discourse.slicer.org/t/running-a-scripted-cli-module-in-parallel/12687/4 "2020-07-23T01:33:12Z")

</div>


