Scripting Slicer - What is possible?

Hello there!
I am quite new to Slicer and I am having difficulties to understand what is actually possible with Slicer Scripting and what not.

So my problem is the following: I know that I can script modules that I can import into Slicer GUI. But what I want to do, is to use all the slicer functions in a seperate python script outside of the Slicer GUI by just importing the module “slicer”.

I have seen that there is a big script repository at
https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository
but is that a script repository only for slicer modules? Or can I use all those functions also in arbitrary python scripts as long as I import slicer correctly?

If that would be possible, I have another question regarding the installation of slicer. Right now, I have just downloaded slicer from the homepage https://download.slicer.org/. But then there is a different installation guide for developers at Windows — 3D Slicer documentation .
Do I have to install that on top of the regular programm or instead? Or don’t I need that at all? Because I cannot figure out how to import slicer packages into any python script.

I hope I was able to tell what exactly my problem is. Also sorry, I am quite new to all of this. To give a bit of context: my ultimate goal is to script the problem that I have 200 .nrrd Segementations that I want to convert to nii.gz (Labelmap-) Volumes while being able to define a reference Volume for each Segmentation.

Thanks in advance!

Slicer has a built-in python, but we don’t package slicer something you can import into other python environments (we’ve talked about this as a goal, but it’s not the way things are now).

So any of the example scripts expect you to have a slicer environment to operate in. If you start slicer with the --no-main-window option and the --python-script <script>.py it will work like a regular python environment, or Slicer --no-main-window --python-code "slicer.app.pythonConsole().show()" will pop up a console with the slicer commands available but no other gui unless you create one.

HTH