I used the Slicer Extension Wizard to create two modules for my custom Slicer application. Instead of the inputSelector (qMRMLNodeComboBox), outputSelector (qMRMLNodeComboBox), imageThresholdSliderWidget (ctkSliderWidget), invertOutputCheckBox (QCheckBox), and invertedOutputSelector (qMRMLNodeComboBox). which are supplied as examples, I will have DataDirectory (ctkPathLineEdit) and PatientPrefix (QLineEdit).
I have some pretty good ideas on how to modify the MyNewModule.ui file accordingly. However, I am having trouble with the MyNewModule.py file. For example, what should the self.ui.DataDirectory.connect(...) call look like? (I am not that clear on what this does which likely is a big part of my problem.) Likewise what should the arguments for self.ui.PatientPrefix.connect(...) be? Thanks!
It creates a connection between a Qt signal and a Python method. When the Qt object emits the signal then it calls the connected Python method. You can find the specification of signals in the header files or the generated documentation. Unfortunately, CTK documentation site is down, so you need to look up the signal parameters in source code:
google for ctkPathLineEdit, click on the first hit
Since Slicer is open-source and there are about 200 open-source extensions, mostly developed in Python, hosted on github, an alternative approach is to learn from working examples. You can find example for most API calls, for example you can search for ctkPathLineEdit currentPathChanged in Python code in entire github. One of the hits show how to create the connection: