# How to change the name of a folder in the subject hierarchy

**URL:** <https://discourse.slicer.org/t/how-to-change-the-name-of-a-folder-in-the-subject-hierarchy/23360>\
**Category:** Support\
**Created:** [May 10, 2022, 2:47pm UTC](https://discourse.slicer.org/t/how-to-change-the-name-of-a-folder-in-the-subject-hierarchy/23360 "2022-05-10T14:47:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![koeglfryderyk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/koeglfryderyk/32/14638_2.png) [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)\
**Post date:** [May 10, 2022, 2:47pm UTC](https://discourse.slicer.org/t/how-to-change-the-name-of-a-folder-in-the-subject-hierarchy/23360/1 "2022-05-10T14:47:55Z")

</div>

I want to change the name of a folder in the Subject hierarchy in the ‘Data’ module.

I tried using `SetItemName()` like this:  
`subject_hierarchy_node.SetItemName(296, 'new_name')`  
but this only changed the name in the ‘Subject hierarchy item information’ and not in the folder name in the hierarchy tree.

Here you can see that I wanted to change the name of the ‘NewFolder’ folder to ‘new\_name’ but the name ‘NewFolder’ did not change:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/6/d653ea7c0577a824d3a298924ce66494ceb9786c.png)

Slicer 5.10-2022-05-08 MacOS

---

<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:** [May 10, 2022, 3:46pm UTC](https://discourse.slicer.org/t/how-to-change-the-name-of-a-folder-in-the-subject-hierarchy/23360/2 "2022-05-10T15:46:15Z")

</div>

I just checked and this call works for me in Slicer 5.1 on Windows. I call `shNode.SetItemName(18, 'NewName')` and `NewName` appears in the tree.

Can someone else using MacOS try it?

---

<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:** [May 12, 2022, 12:08pm UTC](https://discourse.slicer.org/t/how-to-change-the-name-of-a-folder-in-the-subject-hierarchy/23360/3 "2022-05-12T12:08:11Z")

</div>

This should work well. Could your provide the complete list of steps that reproduces the issue? (start Slicer, go to Data module, right-click on…)

---

<div class="post-metadata">

**Author:** ![koeglfryderyk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/koeglfryderyk/32/14638_2.png) [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)\
**Post date:** [May 12, 2022, 2:13pm UTC](https://discourse.slicer.org/t/how-to-change-the-name-of-a-folder-in-the-subject-hierarchy/23360/4 "2022-05-12T14:13:30Z")

</div>

I tried it again today and it worked - maybe I have made a mistake before that I didn’t realise. Thanks for your responses!
