I want to creat a qMRMLNodeCombobox to choose one of fiducial node

I know this question may be stupid, but it has been already struggling me for several days.

as you see, there is a fiducial node in the CTA image.

and I created a standard intial extension, insert a label called ‘lowerpoint’ and a qMRMLNodeCombobox.

I want to use this qMRMLNodeCombobox to choose the fiducial node, but the combobox is gray and can’t to interact with mouse. So, how can I use the combobox to choose the fiducial node?

I suspect the qMRMLNodeComboBox doesn’t yet have the mrmlScene set for it. MRML widgets are grey like that when this is the case.

node_combobox.setMRMLScene(slicer.mrmlScene)

sincerely thank you for your anwser. Magic, with only one line of code, this problem is just sovled. Magic

If you created the UI with Qt designer, I think the step that you missed was making the connection between the parent widget’s mrmlSceneChanged signal and the combobox’ setMRMLScene function. You can do it by switching to Edit Signals/Slots mode (F4). Normally if we create a UI in designer, we do that instead of adding this line in the code (that way there is no question about when to call it exactly).

yes,these operation in Qt is same to add a line of code.

for example, to activate the qMRMLNodeCombobox in the extension.

i first change the nodetype of the new qMRMLNodeCombobox

and then press F4 as you say

finally link the edge of widget to this qMRMLNodeCombobox, and choose this option.

after reloading, the qMRMLNodeCombobox called upperpoint can also choose the fiducial points in markups.