TypeError: 'NoneType' object is not callable

LuisaDantas
Wed, 04 Jan 2023 14:26:18 +0000
Support

Hey all,

I’m developing a module to Slicer and I’m facing some issues. One of the functionalities is to place a control point and get its coordinates through a button that calls a method. I put a print on the beggining of this method and it’s called right when I start the module, but when I place de control point and click the button it gives this error: TypeError: 'NoneType' object is not callable

def setup(self):

        ScriptedLoadableModuleWidget.setup(self)

        uiWidget = slicer.util.loadUI(self.resourcePath('UI/Module.ui'))
        self.layout.addWidget(uiWidget)
        self.ui = slicer.util.childWidgetVariables(uiWidget)

        markupsNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsFiducialNode")
        self.ui.PontoCentralButton.setCurrentNode(markupsNode)
        self.ui.PontoCentralButton.buttonsVisible=False
        self.ui.PontoCentralButton.placeButton().show()
        self.ui.PontoCentralButton.placeMultipleMarkups = slicer.qSlicerMarkupsPlaceWidget.ForcePlaceSingleMarkup

        uiWidget.setMRMLScene(slicer.mrmlScene)

# [...]

        # Buttons
        self.ui.CoordsButton.connect("clicked(bool)", self.logic.coordCentral(self.ui.MRMLNodeComboBox_frame.currentNode(),markupsNode))

def coordCentral(self, inputFrame, markupsNode):
        print("method called ")

13 posts - 4 participants