SegmentationUnet

Hi,
I am trying to automate the SegmentationUNet module with Python (using the logic and widget commands).
I am trying to code the following buttons so that I can choose an input volume and prediction volume with python.

I want to set the following values for input Volume (image) and Prediction volume (Create new Volume as… and a name).

I found the following command in logic but it doesn’t work to set the input volume as desired:

setInputImage(self, inputImageNode)
| Sets input image node
| :param inputImageNode: vtkMRMLScalarVolumeNode
| :return: None

In general, updating the logic doesn’t update the UI. If you are looking to update the UI, you can access the UI’s “Input Volume” qMRMLNodeComboBox using widget.ui.inputSelector (where widget is the widget object).

In general for Python modules, you can access the UI elements using the .ui section of the widget object. By looking at SegmentationUNet.ui, you can determine the names of the elements, like here.

Here is a reference to qMRMLNodeComboBox so you can see how to set the node programmatically.

Thank you so much for your answer. I am going to try it now and let you know how it goes.