# Help me! Update plane from fiducial points...How can I aligne the red plane with Coordinate axis?

**URL:** <https://discourse.slicer.org/t/help-me-update-plane-from-fiducial-points-how-can-i-aligne-the-red-plane-with-coordinate-axis/17344>\
**Category:** Support\
**Tags:** python\
**Created:** [April 27, 2021, 5:46am UTC](https://discourse.slicer.org/t/help-me-update-plane-from-fiducial-points-how-can-i-aligne-the-red-plane-with-coordinate-axis/17344 "2021-04-27T05:46:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [April 27, 2021, 5:46am UTC](https://discourse.slicer.org/t/help-me-update-plane-from-fiducial-points-how-can-i-aligne-the-red-plane-with-coordinate-axis/17344/1 "2021-04-27T05:46:49Z")

</div>

```python
# Update plane from fiducial points
def UpdateSlicePlane(data):
  a = data
  points = np.array([list(zip(*a))])[0]
# b2 = np.array([list(zip(*a))])
  sliceNode = slicer.app.layoutManager().sliceWidget("Red").mrmlSliceNode()
  planePosition = points.mean(axis=1)
  planeNormal = np.cross(points[:,1] - points[:,0], points[:,2] - points[:,0])
  planeX = points[:,1] - points[:,0]
  sliceNode.SetSliceToRASByNTP(planeNormal[0], planeNormal[1], planeNormal[2],
    planeX[0], planeX[1], planeX[2],
    planePosition[0], planePosition[1], planePosition[2], 0)

UpdateSlicePlane(data33)
slicernb.ViewDisplay('OneUpRedSlice', center=False)

```

 ![下载](https://user-images.githubusercontent.com/10215735/116176690-26c5a080-a745-11eb-8c75-e25a6f955804.png)

我想将图片对齐,就像这样:

I want aligne the red plane with Coordinate axis?, like that:

 ![image](https://user-images.githubusercontent.com/10215735/116177287-1eba3080-a746-11eb-960b-a55bbfcaf8a6.png)
