# SlicerQR Development

**URL:** <https://discourse.slicer.org/t/slicerqr-development/15954>\
**Category:** Development\
**Tags:** registration, build, segmentation, dicom, python\
**Created:** [February 11, 2021, 3:59pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954 "2021-02-11T15:59:22Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 6, 2021, 8:41pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/143 "2021-05-06T20:41:51Z")

</div>

@jcfr @lassoan,

Hello, have you tried running Slicer on a VDI? Does it work?.

---

<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 7, 2021, 1:36pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/144 "2021-05-07T13:36:30Z")

</div>

We have successfully used Slicer in several virtual environments (VirtualBox, VMWare, Hyper-V) and it works well in docker containers, Windows subsystem for Linux, etc. There was only one exception, Parallels on macOS, which only supported an embarrassingly old OpenGL version (this was about 1-2 years ago, the situation may have improved since then).

---

<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 7, 2021, 1:56pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/145 "2021-05-07T13:56:54Z")

</div>

There might also be some issues with versions of microsoft’s remote desktop protocol and the version of opengl they support. But other remote desktop solutions like VNC, nomachine, google remote desktop, teamviewer, etc all work well.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 13, 2021, 4:03pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/147 "2021-05-13T16:03:58Z")

</div>

Hello @lassoan @pieper @jcfr,

I was asked by a radiologist if there’s a way to present other types of 3D renderings in the 3D view of SlicerQREADS. I’m thinking this would be fairly easy with this amazing development environment. How could I implement some kind of toggle that would show a MIP and other 3D rendering in that 3d view in addition to the current intersecting planes?

Thanks!

---

<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 13, 2021, 4:07pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/148 "2021-05-13T16:07:56Z")

</div>

Yes, that would be very straightforward. The full volume rendering API is scriptable and can be triggered of events or UI actions. See:

[https://slicer.readthedocs.io/en/latest/developer\_guide/script\_repository.html#show-volume-rendering-automatically-when-a-volume-is-loaded](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#show-volume-rendering-automatically-when-a-volume-is-loaded)

---

<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, 4:43pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/149 "2021-05-13T16:43:02Z")

</div>

@spycolyf We can give more specific advice if you attach a few screenshots of the kind of renderings that you would like to see.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 13, 2021, 5:25pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/150 "2021-05-13T17:25:21Z")

</div>

> [@pieper](#):
>
> Yes, that would be very straightforward. The full volume rendering API is scriptable and can be triggered of events or UI actions. See:

Wow! Thanks! 🙂

OK now that I’m in the beta testing phase of the app, I’m starting to get feedback from physicians about certain features of SlicerQREADS (SQR) they need changed. We are currently making matrices for prioritizing the issues. Therefore, I want to warn you that I will be asking many questions on how to implement certain changes. I think it will be very impressive to the physicians when they see how quickly the changes can be made and my team will be impressing when they se how easily they can be made. So, thank you ahead of time, and forgive me in advanced for many future questions.

Thanks

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 13, 2021, 5:27pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/151 "2021-05-13T17:27:55Z")

</div>

> [@lassoan](#):
>
> We can give more specific advice if you attach a few screenshots of the kind of renderings that you would like to see.

Thanks @lassoan. I will 🙂

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 13, 2021, 5:30pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/152 "2021-05-13T17:30:50Z")

</div>

@lasson, @pieper

- A Maximum intensity projection would be most useful.
- And one more type of rendering with opacities would be great. Got any impressive suggestions?

I’ll look and get more specific, and a link to observe different rendering would save time if you have any. Thanks.

🙂

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 13, 2021, 6:30pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/153 "2021-05-13T18:30:17Z")

</div>

Great! I’ll look into those in a little while, but just to be more specific, I need…

- a MIP
- at least CT 3D surface renderings skin, bone, lung and brain.

I think other more sophisticated renderings will involve segmentation like with the picture below. Correct? Or could this be done automatically?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/6/6602012cf13f5beba45264255b7f01d0bc4f14f2.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:** [May 13, 2021, 7:22pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/154 "2021-05-13T19:22:45Z")

</div>

I’ve added two code snippets that you can use to set up these renderings.

> [@spycolyf](#):
>
> A Maximum intensity projection would be most useful.

See [this script](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#show-volume-rendering-using-maximum-intensity-projection).

> [@spycolyf](#):
>
> And one more type of rendering with opacities would be great.

See [this script](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#show-volume-rendering-making-soft-tissues-transparent).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/0/e0b66ce8e52357eddae7d578a613305988b6c6a3.jpeg)

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 18, 2021, 6:45pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/155 "2021-05-18T18:45:36Z")

</div>

Thanks @lassoan, @pieper

I’ve gotten things to work somewhat. I’m trying to implement it in such a way that the user has a choice between MIP, Surface Rendering and Intersecting planes. How can I get back to the Intersecting Planes view after having switched the other views? Also how do I programmatically toggle slice visibility in 3D view (as can be done with the “v” key). Thanks.

---

<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 18, 2021, 7:17pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/156 "2021-05-18T19:17:26Z")

</div>

> [@spycolyf](#):
>
> How can I get back to the Intersecting Planes view after having switched the other views?

I’m not sure what you mean by “intersection planes view”. You can show/hide slice planes and change volume rendering settings.

> [@spycolyf](#):
>
> Also how do I programmatically toggle slice visibility in 3D view (as can be done with the “v” key).

You can [add keyboard shortcut at Qt level](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#keyboard-shortcuts-and-mouse-gestures) or add an observer to the keypress event to each 3D viewer’s interactor (you can search for `vtk.vtkCommand.KeyPressEvent` for examples; or use a scripted displayable manager to capture keyboard events).

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 18, 2021, 7:49pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/157 "2021-05-18T19:49:29Z")

</div>

@lassoan Oh, ok. Then I should ask, how do I show/hide the slice planes with Python commands.

Then how do I set the renderings to nothing.

Thanks

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [May 18, 2021, 9:20pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/158 "2021-05-18T21:20:20Z")

</div>

> [@spycolyf](#):
>
> Then I should ask, how do I show/hide the slice planes with Python commands

I think you are looking for the following: [Show slice views in 3D window](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#show-slice-views-in-3d-window)

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 18, 2021, 11:24pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/159 "2021-05-18T23:24:51Z")

</div>

@jamesobutler, @lassoan, @pieper

> [@jamesobutler](#):
>
> I think you are looking for the following: [Show slice views in 3D window](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#show-slice-views-in-3d-window)

Thanks @jamesobutler,

That works. I appreciate that. Now I can display the renderings without the slice planes. Great!

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 18, 2021, 11:29pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/160 "2021-05-18T23:29:57Z")

</div>

How do I clear out the renderings to switch to another rendering? I can switch from the opacity rendering to the MIP, but not from the MIP to any other rendering. I think if I can reset or clear the MIP first, it might work. How do I clear out the rendering?

Thanks

---

<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 19, 2021, 1:27am UTC](https://discourse.slicer.org/t/slicerqr-development/15954/161 "2021-05-19T01:27:21Z")

</div>

You can [choose a different rendering preset](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#show-volume-rendering-automatically-when-a-volume-is-loaded) and [set rendering technique to `slicer.vtkMRMLViewNode.Composite`](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#show-volume-rendering-using-maximum-intensity-projection).

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [May 20, 2021, 6:08pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/162 "2021-05-20T18:08:14Z")

</div>

@jcfr

Hello JC, I’m seeing that I can’t set the 3D view to display MIPS or 3D rendering with the SlicerQREADS build. But when I run the SlicerQREADS module inside of the Slicer app, I can perform the 3D render with my Python changes. Did you remove this capability from SlicerQREADS?

Thanks

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [May 20, 2021, 8:52pm UTC](https://discourse.slicer.org/t/slicerqr-development/15954/163 "2021-05-20T20:52:13Z")

</div>

> Did you remove this capability from SlicerQREADS?

Since MIP was not part of the requirements, the VolumeRendering module providing the functionality has been disabled:

> <https://github.com/KitwareMedical/SlicerQReads/blob/d40ce875aa49f396fc8fe2b578e477d6cd02894f/CMakeLists.txt#L123-L134>

[Previous page](https://discourse.slicer.org/t/slicerqr-development/15954.md?page=5)

[Next page](https://discourse.slicer.org/t/slicerqr-development/15954.md?page=7)
