transformNode.SetName('some_string') gives TypeError: 'str' object is not callable

Hi,

while getName works, why setName does not work? how can one change the transform node name from script.

            >> t =getNode('LinearTransform_1')
            >> t
            (vtkCommonCorePython.vtkMRMLLinearTransformNode)0x7f7686c06188
            >> tname = t.GetName()
            'LinearTransform_1'              
            >>t.SetName(tname)
                Traceback (most recent call last):
                 File "<console>", line 1, in <module>
                 TypeError: 'str' object is not callable

The workaround I found is using SubjectHierarchy:

   >> shn = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)
   >> sii = shn.GetSceneItemID()
   >> t = shn.GetItemChildWithName(sii,'LinearTransform_1')
   >> shn.SetItemName(t, 'NewName')

Doublecheck your steps. This works:

>>> n = getNode('MRH*')
>>> n.GetName()
'MRHead'
>>> n.SetName('hoot')
>>> n.GetName()
'hoot'

Thanks for your comment. Yes it works but I had to restart Slicer. It seems there where variable conflicts. in the python interactor