# Save subject hierarchy

**URL:** https://discourse.slicer.org/t/save-subject-hierarchy/8488
**Category:** Support
**Created:** [September 18, 2019, 10:33pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488 "2019-09-18T22:33:57Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![tabildskov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tabildskov/32/6245_2.png) [@tabildskov](https://discourse.slicer.org/u/tabildskov)
#### Post date: [September 18, 2019, 10:33pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/1 "2019-09-18T22:33:57Z")

</div>

Hello,

I am trying to save the subject hierarchy

 ![screen-grab-slicer](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/5/c5645d0becc42809bba8c5f500ba68a10f6346e2.jpeg) . The problem is, when I use the normal save command, it does not save the organization as I have it now.

Do I need to do something different in order to preserve the organization?

Thanks,

Tracy

---

<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 18, 2019, 10:37pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/2 "2019-09-18T22:37:04Z")

</div>

Subject hierarchy is saved in the scene file (.mrml) which is an XML file that can be parsed quote easily. You can also write a short Python script that iterates through the subject hierarchy node and writes it into any format you prefer.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [September 18, 2019, 10:50pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/3 "2019-09-18T22:50:01Z")

</div>

> [@tabildskov](#):
>
> The problem is, when I use the normal save command, it does not save the organization as I have it now.
> 
> Do I need to do something different in order to preserve the organization?

Are you saying it doesn’t reload in Slicer the way you saved it? It’s should. Or are you saying you want to access the hierarchy from external software?

---

<div class="post-metadata">

### Author: ![tabildskov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tabildskov/32/6245_2.png) [@tabildskov](https://discourse.slicer.org/u/tabildskov)
#### Post date: [September 18, 2019, 10:51pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/4 "2019-09-18T22:51:30Z")

</div>

Hi Sir,

When I open up the .mrml file many of the .vtk models do not open up in the folders I put them into.

 ![screen-grab-slicer-problem](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/b/9bfb1bec79bf421f827e61e0ec9d1f2d2cc16f7a.jpeg)

This is why I thought I was doing something wrong.

Thanks,

Tracy

---

<div class="post-metadata">

### Author: ![tabildskov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tabildskov/32/6245_2.png) [@tabildskov](https://discourse.slicer.org/u/tabildskov)
#### Post date: [September 18, 2019, 11:13pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/5 "2019-09-18T23:13:57Z")

</div>

Hi Mr. Pieper,

Thank you for your reply.

Yes. It does not reload into Slicer the way that I thought it would, based on the Subject hierarchy that I have.

I want to get this working right in Slicer before I do anything else.

Thanks,

Tracy

---

<div class="post-metadata">

### Author: ![tabildskov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tabildskov/32/6245_2.png) [@tabildskov](https://discourse.slicer.org/u/tabildskov)
#### Post date: [September 18, 2019, 11:25pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/6 "2019-09-18T23:25:15Z")

</div>

Hello,

If anyone is curious they can go to my filemail link below and download a zip file of may’s files. The link will stop working Oct 17 2019.

Link to scene data.

> **[TJ's Biomedical Imaging - may zip file](https://tj-s-biomedical-imaging.filemail.com/d/guwlyybqdfttits)**
>
> Click here to view and download these shared files from Filemail.com

Thanks,  
Tracy

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [September 18, 2019, 11:48pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/7 "2019-09-18T23:48:51Z")

</div>

Which Slicer version did you use to save the scene?  
Did you make a model hierarchy in the Models module, or folders in Data module / Subject hierarchy?

Please note that I basically reimplemented the way folders work with models, which includes an updated model hierarchy import from scene. This should be integrated in Slicer tonight or tomorrow, so it will be in Friday’s preview version. I’ll try to load your scene tomorrow and let you know if it’s different from your screenshot.

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [September 19, 2019, 3:10pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/8 "2019-09-19T15:10:58Z")

</div>

I tried to load the scene in the latest version, I got a good-looking hierarchy. Please download the preview version tomorrow and try with that.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/3/53ad879869de414329b95e0b02ef2f57b8403fd7.png)

---

<div class="post-metadata">

### Author: ![tabildskov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tabildskov/32/6245_2.png) [@tabildskov](https://discourse.slicer.org/u/tabildskov)
#### Post date: [September 19, 2019, 11:29pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/9 "2019-09-19T23:29:02Z")

</div>

Hi Pinter,

I downloaded and installed the preview version and while I greatly appreciate your work unfortunately the preview version has other problems for me.

Here are a few of the abnormalities in the preview version.

1. It has duplicate instances of the same model. Both instances have the same MRML ID.
2. One instance, I can rename the other instance I cannot rename.
3. If I try to delete one instance the geometry is deleted from the scene but the other instance remains (sometimes).

Sorry about the bad news. I am sure you and the Slicer team will eventually get it right.

Thanks,

Tracy

---

<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 20, 2019, 12:21am UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/10 "2019-09-20T00:21:54Z")

</div>

@cpinter asked you to download the preview version _tomorrow_ or later. Today’s version does not contain any of his fixes.

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [September 20, 2019, 1:42pm UTC](https://discourse.slicer.org/t/save-subject-hierarchy/8488/11 "2019-09-20T13:42:55Z")

</div>

Yes, please try it today ([here’s the MacOS link](http://slicer.kitware.com/midas3/api/rest?method=midas.bitstream.download&name=Slicer-4.11.0-2019-09-19-macosx-amd64.dmg&checksum=d7f7de624e0684410e209152ca17e872)). After integrating someone it takes one night for the changes to appear in the downloaded installer.

If you find any errors in today’s preview or later, don’t hesitate to report it. It’s still fresh, so I’m happy to fix arising issues.
