# Loading only specific images in a folder. 

**URL:** <https://discourse.slicer.org/t/loading-only-specific-images-in-a-folder/8045>\
**Category:** Support\
**Created:** [August 15, 2019, 3:05pm UTC](https://discourse.slicer.org/t/loading-only-specific-images-in-a-folder/8045 "2019-08-15T15:05:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![garbulinskamaja](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@garbulinskamaja](https://discourse.slicer.org/u/garbulinskamaja)\
**Post date:** [August 15, 2019, 3:05pm UTC](https://discourse.slicer.org/t/loading-only-specific-images-in-a-folder/8045/1 "2019-08-15T15:05:09Z")

</div>

I have a folder with 460 images. I would like to load only 3 of them at the same time. Not one and not 460 using the python interactor.  
Now to load all of them I am using this code:

```python
image_path_slicer = os.path.join(project_path, "data/06_WK1_01_crop_0000.tif")
[success, volume] = slicer.util.loadVolume(filename = image_path_slicer, returnNode=True) 

```

So, is there anyway I could choose “06\_WK1\_01\_crop\_0000.tif”, “06\_WK1\_01\_crop\_0001.tif”, “06\_WK1\_01\_crop\_0002.tif” and load only these without creating a new folder with just these files?

Thank you very much in advance!

---

<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:** [August 15, 2019, 3:09pm UTC](https://discourse.slicer.org/t/loading-only-specific-images-in-a-folder/8045/2 "2019-08-15T15:09:04Z")

</div>

You can use [`singleFile`](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#slicer.util.loadVolume) argument to force loading a single file. Example for recent Slicer Preview Release (`returnNode` argument is no longer needed):

```python
volume = slicer.util.loadVolume(filename = image_path_slicer, singleFile=True)

```
