# How to select a model and highlight both the model and the items on the qMRMLSubjectHierarchyTreeView

**URL:** <https://discourse.slicer.org/t/how-to-select-a-model-and-highlight-both-the-model-and-the-items-on-the-qmrmlsubjecthierarchytreeview/25602>\
**Category:** Development\
**Created:** [October 8, 2022, 9:35am UTC](https://discourse.slicer.org/t/how-to-select-a-model-and-highlight-both-the-model-and-the-items-on-the-qmrmlsubjecthierarchytreeview/25602 "2022-10-08T09:35:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![miniminic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/miniminic/32/16647_2.png) [@miniminic](https://discourse.slicer.org/u/miniminic)\
**Post date:** [October 8, 2022, 9:35am UTC](https://discourse.slicer.org/t/how-to-select-a-model-and-highlight-both-the-model-and-the-items-on-the-qmrmlsubjecthierarchytreeview/25602/1 "2022-10-08T09:35:50Z")

</div>

I want to realize the function that clicking on a model can locate the corresponding item. The current problem is that I can’t seem to select a model, and when the model is selected, how can I know which model is selected. Thanks.

---

<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:** [October 8, 2022, 3:55pm UTC](https://discourse.slicer.org/t/how-to-select-a-model-and-highlight-both-the-model-and-the-items-on-the-qmrmlsubjecthierarchytreeview/25602/2 "2022-10-08T15:55:35Z")

</div>

If you mean clicking on the slice views or 3D views and selecting the picked model or segmentation, I heard recently that @Sunderlandkyl may have an implementation in the works. I’m not sure when it will be available.

---

<div class="post-metadata">

**Author:** ![miniminic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/miniminic/32/16647_2.png) [@miniminic](https://discourse.slicer.org/u/miniminic)\
**Post date:** [October 9, 2022, 2:22am UTC](https://discourse.slicer.org/t/how-to-select-a-model-and-highlight-both-the-model-and-the-items-on-the-qmrmlsubjecthierarchytreeview/25602/3 "2022-10-09T02:22:50Z")

</div>

Ok, I see. So currently slicer doesn’t have a way to select models by clicking on them. Thanks for your answer

---

<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:** [November 24, 2022, 3:05am UTC](https://discourse.slicer.org/t/how-to-select-a-model-and-highlight-both-the-model-and-the-items-on-the-qmrmlsubjecthierarchytreeview/25602/4 "2022-11-24T03:05:51Z")

</div>

Right now the easiest way to achieve this is to click to place a markup point to get a 3D position, and then use the [model displayable manager](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-displayable-manager-of-a-certain-type-for-a-certain-view) to get the model node that is visible at that position using its `Pick3D` and `GetPickedNodeID` methods.

---

<div class="post-metadata">

**Author:** ![miniminic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/miniminic/32/16647_2.png) [@miniminic](https://discourse.slicer.org/u/miniminic)\
**Post date:** [November 24, 2022, 3:09am UTC](https://discourse.slicer.org/t/how-to-select-a-model-and-highlight-both-the-model-and-the-items-on-the-qmrmlsubjecthierarchytreeview/25602/5 "2022-11-24T03:09:44Z")

</div>

Thanks for the help. I’ll give it a try
