# Set center of rotation for transform in 3D view

**URL:** <https://discourse.slicer.org/t/set-center-of-rotation-for-transform-in-3d-view/14363>\
**Category:** Feature requests\
**Created:** [November 1, 2020, 1:12pm UTC](https://discourse.slicer.org/t/set-center-of-rotation-for-transform-in-3d-view/14363 "2020-11-01T13:12:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manjula](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/manjula/32/80981_2.png) [@manjula](https://discourse.slicer.org/u/manjula)\
**Post date:** [November 1, 2020, 1:12pm UTC](https://discourse.slicer.org/t/set-center-of-rotation-for-transform-in-3d-view/14363/1 "2020-11-01T13:12:07Z")

</div>

Even though it is possible to rotate the object in 3D view interactively whenever the rotation transformation is applied it is working as origin in the world origin ( I guess. )  
3D interactor is very difficult to precisely adjust and i don’t know if it is possible to constrain the 3D interactor to rotate around only one axis if needed.  
Is it possible to add a feature to change the object origin to the center of the geometry from GUI? (and if possible other centers of origin as well )

(i am aware any center of origin can be defined from the fiducial point using the script)

---

<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 1, 2020, 7:55pm UTC](https://discourse.slicer.org/t/set-center-of-rotation-for-transform-in-3d-view/14363/2 "2020-11-01T19:55:07Z")

</div>

Similar questions come up quite often but so far in most cases it turned out that manual rotation in 3D view had not been a good solution anyway, so we did not end up investing a lot of time into improving the transform widget. It is true then if you could set the center of rotation and axes directions more easily then it would make accurate orientation somewhat more feasible (we have an [open issue](https://github.com/Slicer/Slicer/issues/2579) for this). But there are always much better solutions than free translation/rotation in 3D, because that is inherently a very tedious, iterative process.

If you describe what task you are trying to solve then we can give advice what tools you may consider.

---

<div class="post-metadata">

**Author:** ![manjula](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/manjula/32/80981_2.png) [@manjula](https://discourse.slicer.org/u/manjula)\
**Post date:** [November 1, 2020, 8:19pm UTC](https://discourse.slicer.org/t/set-center-of-rotation-for-transform-in-3d-view/14363/3 "2020-11-01T20:19:17Z")

</div>

It is that often that we need to orient an ROI box in relation to structures. For example we here we want to make the ROI box parallel to the bone surface. Right now we achieved this with the script placing a fiducial in the centroid and rotating it around that.  
But if there is an automated function to set the object origin to the center of geometry/segment then it would be easily rotated from the transform module

![Screenshot from 2020-11-01 21-13-11](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/8/18615690a176c8e2e04007d055d95869f9b1e401.jpeg)

---

<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 1, 2020, 8:30pm UTC](https://discourse.slicer.org/t/set-center-of-rotation-for-transform-in-3d-view/14363/4 "2020-11-01T20:30:50Z")

</div>

We’ll implement ROI rotation in the new Markups ROI node. It should be available in a few months.

Note that you can create optimal oriented bounding box fully automatically, using 10-15 lines of code (see [New Segment Statistics: Oriented Bounding Box, Diameter and More](https://discourse.slicer.org/t/new-segment-statistics-oriented-bounding-box-diameter-and-more/10203)). The script could be slightly modified to create ROI from automatically rotate the ROI to have one side parallel to a specified line.

If you don’t want to do any programming, then you can rotate the volume so that the cut axes are parallel to R/A/S axis and then you don’t need to rotate the ROI.

---

<div class="post-metadata">

**Author:** ![manjula](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/manjula/32/80981_2.png) [@manjula](https://discourse.slicer.org/u/manjula)\
**Post date:** [November 1, 2020, 8:42pm UTC](https://discourse.slicer.org/t/set-center-of-rotation-for-transform-in-3d-view/14363/5 "2020-11-01T20:42:28Z")

</div>

> [@lassoan](#):
>
> We’ll implement ROI rotation in the new Markups ROI node. It should be available in a few months.

It would be great and thank you very much for that. Which will simplify many things.

> [@lassoan](#):
>
> Note that you can create optimal oriented bounding box fully automatically

This is the way we currently using…

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [November 2, 2020, 3:52pm UTC](https://discourse.slicer.org/t/set-center-of-rotation-for-transform-in-3d-view/14363/6 "2020-11-02T15:52:03Z")

</div>

I’ve started the implementation of the Markups ROI here: [https://github.com/Sunderlandkyl/Slicer/tree/wip\_roi](https://github.com/Sunderlandkyl/Slicer/tree/wip_roi)

There are a lot of issues with it currently, but I plan to to have it completed by the end of November.

---

<div class="post-metadata">

**Author:** ![manjula](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/manjula/32/80981_2.png) [@manjula](https://discourse.slicer.org/u/manjula)\
**Post date:** [November 2, 2020, 4:39pm UTC](https://discourse.slicer.org/t/set-center-of-rotation-for-transform-in-3d-view/14363/7 "2020-11-02T16:39:36Z")

</div>

Thank you very much for the great effort! 👏
