# Bug with Orthographic rendering

**URL:** <https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973>\
**Category:** Support\
**Created:** [May 30, 2019, 5:29pm UTC](https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973 "2019-05-30T17:29:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 30, 2019, 5:29pm UTC](https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973/1 "2019-05-30T17:29:37Z")

</div>

When orthographic rendering is enabled, modifying any of the 3D scene options (box, labels, background etc) resets the field of view (like zoom level). We use orthographic rendering quite a bit to enable the ruler option to prepare figures for publication purposes.

On a related note, it would be good to revert the ruler color to black, if the 3D scene background is white. Otherwise it is not visible.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 30, 2019, 7:02pm UTC](https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973/2 "2019-05-30T19:02:12Z")

</div>

Yes, the reset happens at the line highlighted below. If I remove that line then the field of view is not reset when changing view parameters, but the first time you enter orthographic mode the field of view is very small (at least for the MRHead dataset). I’m not sure that’s better.

For the ruler color, maybe better to let the user select black or white ruler (e.g. white ruler over a dark specimen might make sense even if the background it white). We could just add some more rows to the off/thick/thin ruler menu for this.

> <https://github.com/Slicer/Slicer/blob/d9cad8916139374f5462e137b878697387874cb8/Libs/MRML/DisplayableManager/vtkMRMLViewDisplayableManager.cxx#L473>

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 30, 2019, 7:48pm UTC](https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973/3 "2019-05-30T19:48:27Z")

</div>

Reset happening while changing rendering types is acceptable, at least for me. What’s annoying is after I set up the scene in the orientation I would to present, and had to change the background, or remove the box or labels and it resets. It makes is hard to produce consistent looking images interactively.

I am not sure how white ruler with show up on dark specimen. I personally prefer not to overlay the ruler on the image being rendered so that nothing is obstructed. Maybe an option to set the color?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 30, 2019, 8:08pm UTC](https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973/4 "2019-05-30T20:08:08Z")

</div>

Right now I believe it goes through this same path when any mode is changed, meaning the orthographic view is reset. Yes, it’s probably possible to bypass that. Right now there’s just one path, and any time a view parameter is changed that parallel scale setting is updated. I guess the real question is why manipulating the view doesn’t set the view node’s field of view to match the ParallelScale so that it can be reset correctly.

> [@muratmaga](#):
>
> I am not sure how white ruler with show up on dark specimen. I personally prefer not to overlay the ruler on the image being rendered so that nothing is obstructed. Maybe an option to set the color?

What I meant was an image like below. In general for this I think it would be better for the user to explicitly set the color rather than having it change automatically so there’s more control.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/f/7f65c66beb842cfc3138e8a70ff9eeafe4ebb669.jpeg)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 30, 2019, 8:37pm UTC](https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973/5 "2019-05-30T20:37:07Z")

</div>

> [@pieper](#):
>
> I guess the real question is why manipulating the view doesn’t set the view node’s field of view to match the ParallelScale so that it can be reset correctly.

I found that indeed, the view node wasn’t being updated by the camera widget and that’s why the view was getting reset when the modes were changed. I went ahead and [committed a fix](https://github.com/Slicer/Slicer/commit/773d1ff461766b7124875c7e48edeabf67ce4fd4) that works for me - if anyone sees any side effects let me know.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 31, 2019, 12:04am UTC](https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973/6 "2019-05-31T00:04:00Z")

</div>

Thanks @pieper. I am all for giving the user the option to set the color of the ruler and the text. Would be a nice feature to have.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 31, 2019, 8:29pm UTC](https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973/7 "2019-05-31T20:29:43Z")

</div>

I went ahead and implemented the options for ruler color.

> <https://github.com/Slicer/Slicer/issues/1147>
>
> \_This issue was created automatically from an original \[Mantis Issue\](https://ma…ntisarchive.slicer.org/view.php?id=1147). Further discussion may take place here.\_

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 31, 2019, 10:00pm UTC](https://discourse.slicer.org/t/bug-with-orthographic-rendering/6973/8 "2019-05-31T22:00:33Z")

</div>

@muratmaga just commited the ruler color options (added a yellow option too per @lassoan’s suggestion). You can try it in a future nightly build.
