# Using SCIFIO for reading Whole Slide Images at different resolutions.

**URL:** https://discourse.itk.org/t/using-scifio-for-reading-whole-slide-images-at-different-resolutions/4171
**Category:** Beginner Questions
**Tags:** scifio
**Created:** [May 31, 2021, 8:55am UTC](https://discourse.itk.org/t/using-scifio-for-reading-whole-slide-images-at-different-resolutions/4171 "2021-05-31T08:55:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jason\_Daniel](https://discourse.itk.org/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@Jason\_Daniel](https://discourse.itk.org/u/Jason_Daniel)
#### Post date: [May 31, 2021, 8:55am UTC](https://discourse.itk.org/t/using-scifio-for-reading-whole-slide-images-at-different-resolutions/4171/1 "2021-05-31T08:55:43Z")

</div>

Hi Everyone, I’m new to ITK and I am using SCIFIO to read in whole slide images from proprietary image formats: “.svs .vms .bif” etc. I want to know if it is possible to read the image in at a different resolution directly from the image file. For example, I know the image file stores the image pyramid so is it possible to set the itkImageFileReader to read one of the lower resolution layers rather the high resolution image? I can read in the full resolution image myself and then down-sample the image from that, but this seems redundant if a lower resolution image is already available.

Thanks.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [May 31, 2021, 2:36pm UTC](https://discourse.itk.org/t/using-scifio-for-reading-whole-slide-images-at-different-resolutions/4171/2 "2021-05-31T14:36:53Z")

</div>

@ctrueden might be able to answer that.

---

<div class="post-metadata">

### Author: ![Jason\_Daniel](https://discourse.itk.org/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@Jason\_Daniel](https://discourse.itk.org/u/Jason_Daniel)
#### Post date: [June 2, 2021, 2:19pm UTC](https://discourse.itk.org/t/using-scifio-for-reading-whole-slide-images-at-different-resolutions/4171/3 "2021-06-02T14:19:09Z")

</div>

Okay so I’ve managed to read in the file at a lower resolution using itkOpenSlideImageIO directly and setting the imageFileReader imageIO manually. The structure looked like this:

```auto
#include "itkOpenSlideImageIO.h" 

ReaderType::Pointer reader = ReaderType::New();
using OpenSlideIO = itk::OpenSlideImageIO;
OpenSlideIO::Pointer OS = OpenSlideIO::New();
OS->SetFileName(fileName);
OS->SetLevel(1);

reader->SetImageIO(OS);

```
