Using 3D Slicer as a background service

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!

It sounds like you would be interested in the WebServer module!

2 Likes

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!

1 Like

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

1 Like

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!

1 Like