# Matlab Bridge Module Creation

**URL:** <https://discourse.slicer.org/t/matlab-bridge-module-creation/3687>\
**Category:** Development\
**Tags:** segmentation, extensions-manager, matlab\
**Created:** [August 7, 2018, 8:06pm UTC](https://discourse.slicer.org/t/matlab-bridge-module-creation/3687 "2018-08-07T20:06:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aginn](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@aginn](https://discourse.slicer.org/u/aginn)\
**Post date:** [August 7, 2018, 8:06pm UTC](https://discourse.slicer.org/t/matlab-bridge-module-creation/3687/1 "2018-08-07T20:06:17Z")

</div>

Hi all,

I am relatively new to 3D Slicer and Matlab Bridge.

I have been using Matlab Bridge to create a custom module to cut down on my segmentation times. Is there a way to call and execute a pre-existing 3D Slicer Module (e.g. Grow Segmentation from Segment Editor or Generate/Export 3D model from Segmentations) within my .m file?

Any help would be appreciated - thanks in advance!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [August 7, 2018, 8:29pm UTC](https://discourse.slicer.org/t/matlab-bridge-module-creation/3687/2 "2018-08-07T20:29:17Z")

</div>

I think the opposite approach would be easier and more appropriate. What I mean is writing a python script or module that drives the Segment Editor effects, and also calls your Matlab Bridge module to execute the algorithm. The intention with Matlab Bridge was to enable executing Matlab computations, and not to allow Matlab to drive a Slicer processing pipeline.

---

<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:** [August 7, 2018, 8:57pm UTC](https://discourse.slicer.org/t/matlab-bridge-module-creation/3687/3 "2018-08-07T20:57:47Z")

</div>

You can find here examples of how to run segment editor effects from Python as shown in the [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#How_to_run_segment_editor_effects_from_a_script).

---

<div class="post-metadata">

**Author:** ![aginn](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@aginn](https://discourse.slicer.org/u/aginn)\
**Post date:** [August 7, 2018, 9:10pm UTC](https://discourse.slicer.org/t/matlab-bridge-module-creation/3687/4 "2018-08-07T21:10:22Z")

</div>

Thank you! I will do this instead.

---

<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:** [September 10, 2019, 1:08pm UTC](https://discourse.slicer.org/t/matlab-bridge-module-creation/3687/5 "2019-09-10T13:08:02Z")

</div>

A post was split to a new topic: [How to call Matlab module from Python scripted module](https://discourse.slicer.org/t/how-to-call-matlab-module-from-python-scripted-module/8362)
