# Passing hierarchies to CLIs

**URL:** https://discourse.slicer.org/t/passing-hierarchies-to-clis/11706
**Category:** Development
**Tags:** cli
**Created:** [May 26, 2020, 9:20am UTC](https://discourse.slicer.org/t/passing-hierarchies-to-clis/11706 "2020-05-26T09:20:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)
#### Post date: [May 26, 2020, 9:20am UTC](https://discourse.slicer.org/t/passing-hierarchies-to-clis/11706/1 "2020-05-26T09:20:57Z")

</div>

Hello.

I’m trying to develop a CLI module which takes a set of models as input and gives a set of models as output. It seems to be possible to use vtkMRMLModelHierarchy nodes for this, but is it possible to use vtkMRMLSubjectHierarchy nodes instead?

Thanks in advance.

---

<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 26, 2020, 11:19am UTC](https://discourse.slicer.org/t/passing-hierarchies-to-clis/11706/2 "2020-05-26T11:19:34Z")

</div>

First, I’d like to clarify something from the question that is incorrect. We cannot use vtkMRMLSubjectHierarchy nodeS, because subject hierarchy node is (now in its 2.0 form) a singleton, and contains the whole hierarchy. The elements in subject hierarchy are called items, and are internal to the one node. So making it work with CLIs the same way the old fashioned hierarchy nodes worked is not possible.

Unfortunately CLI support of subject hierarchy in this sense is not implemented yet (what is implemented is that it can put outputs to the same folder as the input was). One solution I can imagine for now is adding an application setting for skipping the auto-conversion from hierarchy nodes to SH items. What do you think @lassoan @pieper @jcfr ?

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [May 26, 2020, 1:39pm UTC](https://discourse.slicer.org/t/passing-hierarchies-to-clis/11706/3 "2020-05-26T13:39:26Z")

</div>

I added this as a discussion topic for the upcoming hangout, see [2020.05.26 Hangout](https://discourse.slicer.org/t/2020-05-26-hangout/11700)
