# Selecting input nodes in Slicer RT's Segment Comparison

**URL:** <https://discourse.slicer.org/t/selecting-input-nodes-in-slicer-rts-segment-comparison/37149>\
**Category:** Development\
**Tags:** segmentation, python\
**Created:** [July 2, 2024, 3:04pm UTC](https://discourse.slicer.org/t/selecting-input-nodes-in-slicer-rts-segment-comparison/37149 "2024-07-02T15:04:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zehret](https://avatars.discourse-cdn.com/v4/letter/z/bb73d2/32.png) [@zehret](https://discourse.slicer.org/u/zehret)\
**Post date:** [July 2, 2024, 3:04pm UTC](https://discourse.slicer.org/t/selecting-input-nodes-in-slicer-rts-segment-comparison/37149/1 "2024-07-02T15:04:53Z")

</div>

Hi,

I am trying to use a python script to run the Slicer RT Segment Comparison module. I am able to load the module and create buttons to compute the Hausdorff Distance and DICE metrics. I am struggling to set the structure set and segment for the reference and compare inputs. What is the general form of using python to select these inputs?  
Thanks!

---

<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:** [July 3, 2024, 11:53am UTC](https://discourse.slicer.org/t/selecting-input-nodes-in-slicer-rts-segment-comparison/37149/2 "2024-07-03T11:53:49Z")

</div>

The recommended way is via MRML. The module has a parameter node that you can set up in Python

> <https://github.com/SlicerRt/SlicerRT/blob/master/SegmentComparison/Logic/vtkMRMLSegmentComparisonNode.h>

It defines all the selections and options. Then you can use this parameter node with the logic functions to do the computation.
