# SetSliceToRASByNTP

**URL:** https://discourse.slicer.org/t/setslicetorasbyntp/17578
**Category:** Support
**Created:** [May 11, 2021, 11:55pm UTC](https://discourse.slicer.org/t/setslicetorasbyntp/17578 "2021-05-11T23:55:55Z")
**Posts on this page:** 6
**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: [May 11, 2021, 11:55pm UTC](https://discourse.slicer.org/t/setslicetorasbyntp/17578/1 "2021-05-11T23:55:55Z")

</div>

[Set slice position and orientation from 3 markup fiducials](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository/markups.html?highlight=position%20fiducial#set-slice-position-and-orientation-from-3-markup-fiducials)  
这段代码通过3个fiducials,来定位旋转red\_slicer,怎样用同样的方法来定位和旋转yellow\_slicer呢?就像这样…

This code uses 3 fiducials to position and orientation the red slice view, how to position and rotate the yellow\_slicer in the same way? Just like this…

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/8/18b6c90e07ff7c290072efedda01cd03287abf0e.jpeg)

---

<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: [May 12, 2021, 3:43am UTC](https://discourse.slicer.org/t/setslicetorasbyntp/17578/2 "2021-05-12T03:43:46Z")

</div>

我的微信号(My WeChat ID):

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/9/49a4dcdf58ad5a829ece0c2402c11a283ea248b7.jpeg)

[gelamb@sina.com](mailto:gelamb@sina.com)

---

<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: [May 13, 2021, 5:44am UTC](https://discourse.slicer.org/t/setslicetorasbyntp/17578/3 "2021-05-13T05:44:53Z")

</div>

You can rotate views by Ctrl-Alt-Left-click-and-drag or two-finger pinch on a Windows touchscreen or macOS touchpad (after enabling slice intersections).

There are many modules for exploring tool trajectories and rotating views.

For example, you can use Path Explorer module (in SlicerIGT extension) - specify entry and target point, create a trajectory, select it, and if you select an In Plane view, you can rotate it along the trajectory using the slider.

For just simple rotating of views, you can use or copy-paste code from Valve View module in SlicerHeart extension.

---

<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: [May 13, 2021, 12:16pm UTC](https://discourse.slicer.org/t/setslicetorasbyntp/17578/4 "2021-05-13T12:16:18Z")

</div>

我整明白了…三点决定一个平面,所以,要从两个视角来观察一条直线的关键是第3个点的选择!  
下面是解决方案:

> I fully understand…Three points determine a plane, so the key to observing a straight line from two perspectives is the third point!  
> Here is the solution:
> 
> ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/c/accd83e3660dfaaae14231902d959e996e9dfe7f.jpeg)

---

<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: [May 13, 2021, 12:35pm UTC](https://discourse.slicer.org/t/setslicetorasbyntp/17578/5 "2021-05-13T12:35:33Z")

</div>

只是得到的视角或slice view无法和坐标轴对齐…有点小遗憾…

> It’s just that the obtained perspective or slice view cannot be aligned with the coordinate axis…it’s a little regrettable…

---

<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: [May 13, 2021, 1:07pm UTC](https://discourse.slicer.org/t/setslicetorasbyntp/17578/6 "2021-05-13T13:07:10Z")

</div>

You can specify what is “up” in the slice view by the transverse vector (`planeX` in the code snippet above). See in [this example](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#set-slice-position-and-orientation-from-a-normal-vector-and-position) how to make the “up” direction snap to meaningful anatomical axis directions.
