# Trouble loading a sequence programatically

**URL:** <https://discourse.slicer.org/t/trouble-loading-a-sequence-programatically/16835>\
**Category:** Support\
**Tags:** sequences, python\
**Created:** [March 29, 2021, 9:48pm UTC](https://discourse.slicer.org/t/trouble-loading-a-sequence-programatically/16835 "2021-03-29T21:48:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teresa\_Gadda](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/teresa_gadda/32/9663_2.png) [@Teresa\_Gadda](https://discourse.slicer.org/u/Teresa_Gadda)\
**Post date:** [March 29, 2021, 9:48pm UTC](https://discourse.slicer.org/t/trouble-loading-a-sequence-programatically/16835/1 "2021-03-29T21:48:52Z")

</div>

Operating system: Windows 10  
Slicer version: 4.11.20200930  
Expected behavior: Sequence loaded from python interactor  
Actual behavior: RuntimeError: Failed to load node from file

I have a tracked ultrasound file (generated using Plus) that I would like to load from the python interactor window with the eventual goal of being able to batch process similar files. When I drag and drop this file into Slicer and select Sequence Metafile it loads up great and I can do all kinds of things with it. However trying to load it with slicer.util.loadSequence results in an error (shown below). I’ve triple checked that the file actually exists and my spelling is correct. Anyone have thoughts or ideas?

Thanks

```
>>>yo = slicer.util.loadSequence('C:\\Users\\teres\\OneDrive\\Desktop\\TIS_0317_rayTraced.mha')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Program Files\Slicer 4.11.20200930\bin\Python\slicer\util.py", line 818, in loadSequence
    return loadNodeFromFile(filename, filetype, properties)
  File "C:\Program Files\Slicer 4.11.20200930\bin\Python\slicer\util.py", line 598, in loadNodeFromFile
    raise RuntimeError(errorMessage)
RuntimeError: Failed to load node from file: C:\Users\teres\OneDrive\Desktop\TIS_0317_rayTraced.mha
```

---

<div class="post-metadata">

**Author:** ![Teresa\_Gadda](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/teresa_gadda/32/9663_2.png) [@Teresa\_Gadda](https://discourse.slicer.org/u/Teresa_Gadda)\
**Post date:** [March 29, 2021, 10:13pm UTC](https://discourse.slicer.org/t/trouble-loading-a-sequence-programatically/16835/2 "2021-03-29T22:13:14Z")

</div>

Nevermind. Solved it myself.  
`yo = slicer.util.loadNodeFromFile('C:\\Users\\teres\\OneDrive\\Desktop\\TIS_0317_rayTraced.mha','Sequence Metafile')`
