I’m displaying a freesurfer surface, and applying a LUT from a text file to display different colors. However, I have a few hundred LUTs that I need to apply and take screenshots of each. Is it possible to automate slicer to do that?
It’s always possible to write a python script for things like that, but there’s nothing quite like that built in.
It is really easy to implement batch processing with Slicer. You have two options:
- A. Create a bash/batch file that iterates through files and launches Slicer with each argument.
- B. Manually launch Slicer and run a Python script that walks through the files and performs the loading/processing/export operations that you need.
How to load data, create screenshots: The slicer script repository should give you lots of complete examples for implementing common operations. A few specific hints:
- Load data from file using slicer.util.load…() methods: slicer.util.loadVolume, slicer.util.loadModel, etc.
- Save screen capture of selected views using ScreenCapture module
Feel free to ask any questions, we should be able to respond very quickly.
1 Like