# How to use python to scroll through a dataset

**URL:** <https://discourse.slicer.org/t/how-to-use-python-to-scroll-through-a-dataset/35973>\
**Category:** Development\
**Tags:** python\
**Created:** [May 7, 2024, 9:55pm UTC](https://discourse.slicer.org/t/how-to-use-python-to-scroll-through-a-dataset/35973 "2024-05-07T21:55:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@Tobias](https://discourse.slicer.org/u/Tobias)\
**Post date:** [May 7, 2024, 9:55pm UTC](https://discourse.slicer.org/t/how-to-use-python-to-scroll-through-a-dataset/35973/1 "2024-05-07T21:55:04Z")

</div>

Hi  
I use slicer alot in education but am very new to programing. I would like to make a python script that scrolls through a dataset from the first to the last image in z.  
So ideally it should be able to get the min and max for the active slice and the scroll through it one by one.

Can anyone give me some advice as how i should get started. For instance what is the easiest way to find the commands needed?

Any help in the right directions is very appreciated.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [May 7, 2024, 11:08pm UTC](https://discourse.slicer.org/t/how-to-use-python-to-scroll-through-a-dataset/35973/2 "2024-05-07T23:08:16Z")

</div>

If it is auto-scrolling that you desire, I would suggest to first look into the “AutoScroll” extension available to install through the Slicer Extensions Manager.

The associated code for AutoScroll can be reviewed at the following:

> **[GitHub - lassoan/SlicerAutoscroll](https://github.com/lassoan/SlicerAutoscroll)**
>
> Contribute to lassoan/SlicerAutoscroll development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@Tobias](https://discourse.slicer.org/u/Tobias)\
**Post date:** [May 8, 2024, 7:07am UTC](https://discourse.slicer.org/t/how-to-use-python-to-scroll-through-a-dataset/35973/3 "2024-05-08T07:07:17Z")

</div>

Thank you this is a very useful start  
Basically what i would like to do is scroll through the image as fast as possible and check the time. So use it as a kind of benchmark tool. I think some small modifications on this one should make that work very well.
