How to use function in module

i want to use a protected function in “openigtlinkif” module named “startCurrentIGTLConnector(bool)”,so i changed the source code to set it public and compile successfully, but my project still can’t find it, how to let this function open to my project,thanks

There is no need to change anything in the module’s code. You can add a vtkMRMLIGTLConnectorNode to the scene, set its type, port, hostname (if client), and call its Start() method:

connectorNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLIGTLConnectorNode")
connectorNode.SetTypeClient('localhost', 18944)

Thanks for your prompt reply, it works