# Loading file into existing node

**URL:** <https://discourse.slicer.org/t/loading-file-into-existing-node/3037>\
**Category:** Development\
**Tags:** file-import\
**Created:** [June 1, 2018, 10:30am UTC](https://discourse.slicer.org/t/loading-file-into-existing-node/3037 "2018-06-01T10:30:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adelmo](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@adelmo](https://discourse.slicer.org/u/adelmo)\
**Post date:** [June 1, 2018, 10:30am UTC](https://discourse.slicer.org/t/loading-file-into-existing-node/3037/1 "2018-06-01T10:30:41Z")

</div>

Greetings slicer experts,

I was wondering is someone could help me solving my little problem.  
What I would like to do is loading a file directly into an existing node.

In this moment to load a file (.nii for example) the instruction I use is:  
\_, self.upNode = slicer.util.loadVolume(filepath, returnNode=True)

This creates a new node (upNode), with the same name as the filename, where I can explore my image.

Would it be possible to load filepath directly into an already existing node (a vtkMRMLScalarVolumeNode) ?  
Completely overriding what was already in it but leaving untouched the node name and ID.

Thank You,  
Alex

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [June 1, 2018, 1:53pm UTC](https://discourse.slicer.org/t/loading-file-into-existing-node/3037/2 "2018-06-01T13:53:07Z")

</div>

As long as the file is still compatible with the node type, you can try:

```auto
node = slicer.util.getNode("NODENAME")

storage = slicer.vtkMRMLNRRDStorageNode()
storage.SetFileName(filepath)
storage.ReadData(node)

```
