# How to get boundary coordinate of the markup plane in IJK

**URL:** <https://discourse.slicer.org/t/how-to-get-boundary-coordinate-of-the-markup-plane-in-ijk/13446>\
**Category:** Development\
**Created:** [September 11, 2020, 5:58pm UTC](https://discourse.slicer.org/t/how-to-get-boundary-coordinate-of-the-markup-plane-in-ijk/13446 "2020-09-11T17:58:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yusuke](https://avatars.discourse-cdn.com/v4/letter/y/ad7895/32.png) [@Yusuke](https://discourse.slicer.org/u/Yusuke)\
**Post date:** [September 11, 2020, 5:58pm UTC](https://discourse.slicer.org/t/how-to-get-boundary-coordinate-of-the-markup-plane-in-ijk/13446/1 "2020-09-11T17:58:49Z")

</div>

Hi,

I would like to know how to get coordinates for the boundaries of a markup plane in IJK.  
In fiducial point case, my understanding is that we can get the following codes:  
world = [0, 0, 0, 0]  
fiducialNode.GetNthFiducialWorldCoordinates(index, world)  
then something like this  
p\_Ras = [coord[0], coord[1], coord[2], 1.0]  
p\_Ijk = RasToIjkMatrix.MultiplyDoublePoint(p\_Ras)

but I am wondering how to get the coordinates of plane nodes. I couldn’t find the function for it in the vtkMRMLMarkupsPlaneNode class.

Thank you for your help!

---

<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 11, 2020, 7:15pm UTC](https://discourse.slicer.org/t/how-to-get-boundary-coordinate-of-the-markup-plane-in-ijk/13446/2 "2020-09-11T19:15:46Z")

</div>

Markups plane coordinate system is described in the [documentation](https://apidocs.slicer.org/master/classvtkMRMLMarkupsPlaneNode.html#details): “Origin of plane at 0,0,0, XYZ axis aligned to XYZ unit vectors”. For example, homogeneous coordinate of one of the corners is `[planeBounds[0], planeBounds[2], 0, 1]`.

---

<div class="post-metadata">

**Author:** ![Yusuke](https://avatars.discourse-cdn.com/v4/letter/y/ad7895/32.png) [@Yusuke](https://discourse.slicer.org/u/Yusuke)\
**Post date:** [September 14, 2020, 7:19pm UTC](https://discourse.slicer.org/t/how-to-get-boundary-coordinate-of-the-markup-plane-in-ijk/13446/3 "2020-09-14T19:19:32Z")

</div>

Thank you so much for your comment!

I was able to get the rectangle points by the following codes.

```
    planeMarkup = slicer.mrmlScene.GetFirstNodeByClass("vtkMRMLMarkupsPlaneNode")
    vol=slicer.util.getNode('MR*')

    planeBounds = [0, 0, 0, 0, 0, 0]
    planeMarkup.GetPlaneBounds(planeBounds)
    planeToWorldMatrix = vtk.vtkMatrix4x4()
    planeMarkup.GetPlaneToWorldMatrix(planeToWorldMatrix)

    ras_p1 = planeToWorldMatrix.MultiplyPoint([planeBounds[0], planeBounds[2], 0, 1])
    ras_p2 = planeToWorldMatrix.MultiplyPoint([planeBounds[1], planeBounds[3], 0, 1])
    RasToIjkMatrix = vtk.vtkMatrix4x4()
    vol.GetRASToIJKMatrix(RasToIjkMatrix)

    p1 = RasToIjkMatrix.MultiplyDoublePoint(ras_p1)
    p2 = RasToIjkMatrix.MultiplyDoublePoint(ras_p2)
    print('p1:{}'.format(p1))
    print('p2:{}'.format(p2))

```

Thanks for your help!
