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


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

            >> t =getNode('LinearTransform_1')
            >> t
            >> tname = t.GetName()
                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()
>>> n.SetName('hoot')
>>> n.GetName()

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