# Proxy Node Attributes lost after scene load

**URL:** <https://discourse.slicer.org/t/proxy-node-attributes-lost-after-scene-load/31607>\
**Category:** Support\
**Tags:** sequences\
**Created:** [September 7, 2023, 6:16pm UTC](https://discourse.slicer.org/t/proxy-node-attributes-lost-after-scene-load/31607 "2023-09-07T18:16:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pfrwilson](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pfrwilson/32/66902_2.png) [@pfrwilson](https://discourse.slicer.org/u/pfrwilson)\
**Post date:** [September 7, 2023, 6:16pm UTC](https://discourse.slicer.org/t/proxy-node-attributes-lost-after-scene-load/31607/1 "2023-09-07T18:16:11Z")

</div>

I have created a sequence, sequence browser and proxy volume node. I gave the proxy volume node a whole bunch of attributes. However, after reloading the scene, the only attribute that is reloaded into the node is the Sequences.BaseName attribute.

Is this a bug? Is there a way to ensure that the node attributes will be preserved throughout scene save/reload?

Any help is greatly appreciated!

Here is how I initially set up the volume node:

```python
volume = slicer.mrmlScene.AddNewNodeByClass(
    "vtkMRMLScalarVolumeNode",
    f"BMode_volume_{cineloop_number}",
)
volume.SetSpacing(bimg_spacing)
for name, parameter in params.items():
    volume.SetAttribute(name, str(parameter))
    volume.SetAttribute('SlicerExactVu.loadedAsType', 'Volume')
    volume.SetAttribute('SlicerExactVu.loadedFromPath', bimg_path)
    volume.SetAttribute('cineloop_number', cineloop_number)

```

At each step I updated its data using `slicer.util.updateVolumeFromArray`.

Paul

---

<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:** [September 7, 2023, 6:29pm UTC](https://discourse.slicer.org/t/proxy-node-attributes-lost-after-scene-load/31607/2 "2023-09-07T18:29:08Z")

</div>

When a volume sequence is saved in .mrb format then all the attributes are preserved. However, currently saving of custom attributes is not implemented in the volume sequence reader, which saves the volume sequence in .seq.nrrd format. It would make sense to implement this - I’ve submitted a feature request to track this task:

> <https://github.com/Slicer/Slicer/issues/7218>
>
> \## Is your feature request related to a problem? Please describe.
> 
> When a volu…me sequence is saved in MRML sequence bundle (.seq.mrb) format then all the node attributes are preserved.
> 
> However, currently saving of custom attributes is not implemented in the volume sequence reader, which saves the volume sequence in .seq.nrrd format.
> 
> \## Describe the solution you'd like
> 
> When a sequence of volumes are saved, volume node attributes should be saved in the .nrrd file.
> 
> \## Additional context
> 
> See user error report here: https://discourse.slicer.org/t/proxy-node-attributes-lost-after-scene-load/31607

We’ll probably need this for one of the funded projects at some point, but if you can make any contributions (ideally implement attribute saving/reading in the storage node) then it can happen sooner.

In the meantime, you can force saving into .mrb format (zip file containing each volume as a separate file and a .mrml file storing the node attributes) like this:

```python
storageNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSequenceStorageNode')
getNode('Sequence').SetAndObserveStorageNodeID(storageNode.GetID())

```

---

<div class="post-metadata">

**Author:** ![pfrwilson](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pfrwilson/32/66902_2.png) [@pfrwilson](https://discourse.slicer.org/u/pfrwilson)\
**Post date:** [September 8, 2023, 5:30pm UTC](https://discourse.slicer.org/t/proxy-node-attributes-lost-after-scene-load/31607/3 "2023-09-08T17:30:34Z")

</div>

Thanks so much Andras, the suggested quick fix worked perfectly.

I unfortunately don’t have the bandwidth to help with the feature request right now, but i’ll pay attention in case I do get the time.

Paul
