I’m new to Slicer and am working on a project trying to automate a few Slicer steps for many files by creating a python script and then running it without opening the Slicer GUI.
I’ve been reading through sections in the slicer docs in particular the “Run a Python script file in the Slicer environment” seems to be what I’m trying to do.
The part I’m stuck on is the very first step of how to load a file (tif file as a Volume) in slicer through python. I’d really appreciate any tips or example code on how to do this part!
For bigger picture context, I have a folder with dozens of .tif files from CTs. I’d like to run a script that will for each .tif file replicate the following steps I’ve been doing in the Slicer GUI:
- Load the tif file as a Volume (Add data button)
- Segment based on a threshold
- Select remove island based on a known location (background CT scan equipment)
- Save the segmentation quantification & a .stl file of the 3d model
Thanks!