# Exporting jpgs of MRI slices

**URL:** https://discourse.slicer.org/t/exporting-jpgs-of-mri-slices/28057
**Category:** Development
**Tags:** python
**Created:** [February 27, 2023, 3:34am UTC](https://discourse.slicer.org/t/exporting-jpgs-of-mri-slices/28057 "2023-02-27T03:34:43Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [February 27, 2023, 8:39pm UTC](https://discourse.slicer.org/t/exporting-jpgs-of-mri-slices/28057/2 "2023-02-27T20:39:25Z")

</div>

First, we understand that some machine learning examples are hard-coded to handle only jpg or png, but converting the original data to an 8 bit format truncates the dynamic range and is probably a bad idea.

That out of the way, you can use the [ScreenCapture](https://slicer.readthedocs.io/en/latest/user_guide/modules/screencapture.html) module’s slice sweep mode to catpure the images. [Here’s an example](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#capture-a-slice-view-sweep-into-a-series-of-png-files) doing this from a python script.

The [batch processing](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#batch-processing) examples will get you started applying this to a set of images.

---

_[View the full topic](https://discourse.slicer.org/t/exporting-jpgs-of-mri-slices/28057)._
