# Create a mesh in python script

**URL:** <https://discourse.slicer.org/t/create-a-mesh-in-python-script/1543>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [November 28, 2017, 4:31pm UTC](https://discourse.slicer.org/t/create-a-mesh-in-python-script/1543 "2017-11-28T16:31:56Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [November 30, 2017, 5:45pm UTC](https://discourse.slicer.org/t/create-a-mesh-in-python-script/1543/5 "2017-11-30T17:45:18Z")

</div>

> [@Frederic](#):
>
> So It would be:
> 
> segmentEditorWidget.setActiveEffectByName(“Threshold”, 110,400)
> 
> segmentEditorWidget.setActiveEffectByName(“Smmoting”,"Gaussian ", 2)

It’s a couple of more lines (setActiveEffectByName only activates an effect). See the examples that I linked above.

> [@Frederic](#):
>
> Is there in 3dslicer, a RAS to MNI coordinate conversion function?

RAS is anatomical coordinate system (right-anterior-superior). What is MNI coordinate system?

> [@Frederic](#):
>
> Is there a button to trigger the shift key linked motion?

You can easily add a shortcut for jump to a current cursor position, just open the Python console and copy-paste these lines to make Ctrl+M jump to current slice position:

```
def jumpToCursor():
  ras=[0,0,0]
  slicer.mrmlScene.GetFirstNodeByClass('vtkMRMLCrosshairNode').GetCursorPositionRAS(ras)
  slicer.modules.markups.logic().JumpSlicesToLocation(ras[0], ras[1], ras[2], slicer.vtkMRMLCrosshairNode.JumpSlice)

shortcut = qt.QShortcut(slicer.util.mainWindow())
shortcut.setKey(qt.QKeySequence("Ctrl+M"))
shortcut.connect( 'activated()', jumpToCursor )

```

If you want this feature permanently then add it to your application startup script (edit it in menu: Edit / Application settings / Application startup script).

---

_[View the full topic](https://discourse.slicer.org/t/create-a-mesh-in-python-script/1543)._
