# Call the module through Python and make it complete certain work or modify some of the default values in the module

**URL:** <https://discourse.slicer.org/t/call-the-module-through-python-and-make-it-complete-certain-work-or-modify-some-of-the-default-values-in-the-module/8764>\
**Category:** Development\
**Created:** [October 13, 2019, 3:29am UTC](https://discourse.slicer.org/t/call-the-module-through-python-and-make-it-complete-certain-work-or-modify-some-of-the-default-values-in-the-module/8764 "2019-10-13T03:29:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yulaomao](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yulaomao/32/78556_2.png) [@yulaomao](https://discourse.slicer.org/u/yulaomao)\
**Post date:** [October 13, 2019, 3:29am UTC](https://discourse.slicer.org/t/call-the-module-through-python-and-make-it-complete-certain-work-or-modify-some-of-the-default-values-in-the-module/8764/1 "2019-10-13T03:29:14Z")

</div>

Hi,  
I want to call the module through Python and make it complete certain work or modify some of the default values in the module.  
For example, in “volume rendering” module, “preset” is set to "CT - bones ".

 ![L%7D%60(K6%40E63ZW3)~C2N4PP)J](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/6/16893f6d4ae7ad0a98f55259ae26ebb50b27200c.png)

---

<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:** [October 13, 2019, 3:33am UTC](https://discourse.slicer.org/t/call-the-module-through-python-and-make-it-complete-certain-work-or-modify-some-of-the-default-values-in-the-module/8764/2 "2019-10-13T03:33:47Z")

</div>

See in this [example in the script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Show_volume_rendering_automatically_when_a_volume_is_loaded) how to show volume rendering with a certain preset.

---

<div class="post-metadata">

**Author:** ![yulaomao](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yulaomao/32/78556_2.png) [@yulaomao](https://discourse.slicer.org/u/yulaomao)\
**Post date:** [October 13, 2019, 4:08am UTC](https://discourse.slicer.org/t/call-the-module-through-python-and-make-it-complete-certain-work-or-modify-some-of-the-default-values-in-the-module/8764/3 "2019-10-13T04:08:58Z")

</div>

Thank you for your reply. I really don’t know about it and I don’t have much time to study. May I ask if you can tell me who can help me complete the series of tasks I need? I can pay a certain salary. Thanks very much.

---

<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:** [October 13, 2019, 11:17am UTC](https://discourse.slicer.org/t/call-the-module-through-python-and-make-it-complete-certain-work-or-modify-some-of-the-default-values-in-the-module/8764/4 "2019-10-13T11:17:46Z")

</div>

You just need to copy-paste a few lines from example that you can find at the link that I gave. I copy the code here:

```python
import SampleData
volumeNode = SampleData.SampleDataLogic().downloadMRHead()

volRenLogic = slicer.modules.volumerendering.logic()
displayNode = volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode)
displayNode.GetVolumePropertyNode().Copy(volRenLogic.GetPresetByName('MR-Default'))
displayNode.SetVisibility(True)

```

> [@yulaomao](#):
>
> you can tell me who can help me complete the series of tasks I need? I can pay a certain salary

You can [post here to offer a job](https://discourse.slicer.org/c/announcements/jobs) or contact [Slicer commercial partners](https://www.slicer.org/wiki/CommercialUse#Commercial_Partners).
