# Using 3D Slicer as a background service

**URL:** <https://discourse.slicer.org/t/using-3d-slicer-as-a-background-service/27802>\
**Category:** Development\
**Created:** [February 14, 2023, 2:15am UTC](https://discourse.slicer.org/t/using-3d-slicer-as-a-background-service/27802 "2023-02-14T02:15:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GradyC](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@GradyC](https://discourse.slicer.org/u/GradyC)\
**Post date:** [February 14, 2023, 2:15am UTC](https://discourse.slicer.org/t/using-3d-slicer-as-a-background-service/27802/1 "2023-02-14T02:15:09Z")

</div>

Hello, I am currently developing a project where I think 3D Slicer’s rasterization would come in handy. To keep things simple I am developing a 3D printer where we must convert an .STL file to a .TIFF stack. There is plenty of documentation on that process so that is not my concern.

What I aim to do is create my own front end allowing the user to input parameters for the rasterization process (DPI, input/output directories, slice height, bit-depth etc.), and modify the python script to rasterize based on user input. My main question is how can I start 3D Slicer as a service in the background so I can run the Python script to rasterize my .STL file?

I apologize if this is a stupid question, but essentially I want the 3D Slicer to be “invisible” (i.e. a background service I call) and have the front end GUI that I have created be the only user facing item. I look forward to any responses!

---

<div class="post-metadata">

**Author:** ![ebrahim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebrahim/32/13403_2.png) [@ebrahim](https://discourse.slicer.org/u/ebrahim)\
**Post date:** [February 14, 2023, 2:20am UTC](https://discourse.slicer.org/t/using-3d-slicer-as-a-background-service/27802/2 "2023-02-14T02:20:26Z")

</div>

It sounds like you would be interested in [the WebServer module](https://slicer.readthedocs.io/en/latest/user_guide/modules/webserver.html)!

---

<div class="post-metadata">

**Author:** ![GradyC](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@GradyC](https://discourse.slicer.org/u/GradyC)\
**Post date:** [February 14, 2023, 2:27am UTC](https://discourse.slicer.org/t/using-3d-slicer-as-a-background-service/27802/3 "2023-02-14T02:27:11Z")

</div>

Thank you for the response. I actually found this module earlier and it seemed like it fit my needs perfectly. I ran the start server command and 3D Slicer started to open on my local machine as well (I am assuming because I had to input the Slicer’s exec file as a parameter). I am going to look into ways to start Slicer silently in the background. Thanks again!

---

<div class="post-metadata">

**Author:** ![ebrahim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebrahim/32/13403_2.png) [@ebrahim](https://discourse.slicer.org/u/ebrahim)\
**Post date:** [February 14, 2023, 2:57am UTC](https://discourse.slicer.org/t/using-3d-slicer-as-a-background-service/27802/4 "2023-02-14T02:57:39Z")

</div>

I didn’t try this before but if you can run WebServer module functionality via python script then maybe you can get what you want [by using using --no-main-window and --no-splash](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository/gui.html#run-python-commands-in-the-slicer-environment)

---

<div class="post-metadata">

**Author:** ![GradyC](https://avatars.discourse-cdn.com/v4/letter/g/22d042/32.png) [@GradyC](https://discourse.slicer.org/u/GradyC)\
**Post date:** [February 15, 2023, 4:51pm UTC](https://discourse.slicer.org/t/using-3d-slicer-as-a-background-service/27802/5 "2023-02-15T16:51:50Z")

</div>

Actually this seems perfect for the intentions I need it. I can get my program to run this command in the background so the user doesn’t have to interface with 3D Slicer. Thank you!
