# Automating snapshots

**URL:** <https://discourse.slicer.org/t/automating-snapshots/387>\
**Category:** Support\
**Created:** [May 25, 2017, 6:33pm UTC](https://discourse.slicer.org/t/automating-snapshots/387 "2017-05-25T18:33:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbook](https://avatars.discourse-cdn.com/v4/letter/g/7ea924/32.png) [@gbook](https://discourse.slicer.org/u/gbook)\
**Post date:** [May 25, 2017, 6:33pm UTC](https://discourse.slicer.org/t/automating-snapshots/387/1 "2017-05-25T18:33:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 25, 2017, 6:59pm UTC](https://discourse.slicer.org/t/automating-snapshots/387/2 "2017-05-25T18:59:03Z")

</div>

It’s always possible to write a python script for things like that, but there’s nothing quite like that built in.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 25, 2017, 9:50pm UTC](https://discourse.slicer.org/t/automating-snapshots/387/3 "2017-05-25T21:50:49Z")

</div>

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](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Launching_Slicer) with each argument.
- B. Manually launch Slicer and run a Python script that [walks through the files](http://www.tutorialspoint.com/python/os_walk.htm) and performs the loading/processing/export operations that you need.

How to load data, create screenshots: The slicer [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository) 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](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Load_volume_from_file), [slicer.util.loadModel](http://slicer.readthedocs.io/en/latest/developer_guide/slicer.html?highlight=loadmodel#slicer.util.loadModel), etc.
- [Save screen capture of selected views using ScreenCapture module](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Capture)

Feel free to ask any questions, we should be able to respond very quickly.
