# Help in programming

**URL:** https://discourse.slicer.org/t/help-in-programming/20048
**Category:** Development
**Tags:** python
**Created:** [October 7, 2021, 9:12am UTC](https://discourse.slicer.org/t/help-in-programming/20048 "2021-10-07T09:12:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Bence\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bence_horvath/32/4029_2.png) [@Bence\_Horvath](https://discourse.slicer.org/u/Bence_Horvath)
#### Post date: [October 7, 2021, 9:12am UTC](https://discourse.slicer.org/t/help-in-programming/20048/1 "2021-10-07T09:12:19Z")

</div>

Hi,

I would like to get position of a fiducial markup and add it to a variables.

I try this way, but I get ‘none’ for result. There are exist a fiducial.

self.Incus = slicer.qMRMLNodeComboBox()  
self.Incus.nodeTypes = [“vtkMRMLMarkupsFiducialNode”]  
self.point = self.Incus.currentNode()  
pos = [0.0, 0.0, 0.0]  
print(self.point.GetNthFiducialPosition(0,pos))

result: None

when I printed only self.point it return all data of the fiducial

Best regards!  
Bence

---

<div class="post-metadata">

### Author: ![S\_Arbabi](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@S\_Arbabi](https://discourse.slicer.org/u/S_Arbabi)
#### Post date: [October 7, 2021, 10:46am UTC](https://discourse.slicer.org/t/help-in-programming/20048/2 "2021-10-07T10:46:53Z")

</div>

you can access [a repository of codes](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html) in here, there’s a line of code that can help you:  
something like this: fidList.GetNthFiducialWorldCoordinates(0,world)

---

<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: [October 7, 2021, 1:06pm UTC](https://discourse.slicer.org/t/help-in-programming/20048/3 "2021-10-07T13:06:24Z")

</div>

Szia Bence,

Your print statement prints out the return value of the function. But GetNthFiducialPosition does not return anything, it puts the result in the argument array, in your case `pos`.  
So if you do `print(pos)` after the GetNthFiducialPosition call, you’ll see the coordinates.

---

<div class="post-metadata">

### Author: ![Bence\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bence_horvath/32/4029_2.png) [@Bence\_Horvath](https://discourse.slicer.org/u/Bence_Horvath)
#### Post date: [October 11, 2021, 7:13am UTC](https://discourse.slicer.org/t/help-in-programming/20048/4 "2021-10-11T07:13:01Z")

</div>

Oooohh, thank you very very much!!! 😊

---

<div class="post-metadata">

### Author: ![Bence\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bence_horvath/32/4029_2.png) [@Bence\_Horvath](https://discourse.slicer.org/u/Bence_Horvath)
#### Post date: [October 11, 2021, 8:44am UTC](https://discourse.slicer.org/t/help-in-programming/20048/5 "2021-10-11T08:44:21Z")

</div>

And how can I get positions of LineMarkup’s control point?  
GetControlPoints() doesn’t work with “vtkMRMLMarkupsLineNode” .

---

<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: [October 11, 2021, 11:53am UTC](https://discourse.slicer.org/t/help-in-programming/20048/6 "2021-10-11T11:53:39Z")

</div>

`GetControlPoints` is not a Python enabled function. You need to use `GetNthControlPointPosition`. I think it owuld be useful if you checked out the API. Then you’ll see what you can use. [Slicer: vtkMRMLMarkupsNode Class Reference](http://apidocs.slicer.org/master/classvtkMRMLMarkupsNode.html)

---

<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 11, 2021, 2:32pm UTC](https://discourse.slicer.org/t/help-in-programming/20048/7 "2021-10-11T14:32:15Z")

</div>

The most convenient way for getting all the control positions in Python is the [slicer.util.arrayFromMarkupsControlPointData](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#slicer.util.arrayFromMarkupsControlPointData) function.
