Hi, i used this function to display a table node on the layout but it only works on the first table display, and not when the table is updated (same function as in SegmentStatistics module):
def showTable(table):
currentLayout = slicer.app.layoutManager().layout
layoutWithTable = slicer.modules.tables.logic().GetLayoutWithTable(currentLayout)
slicer.app.layoutManager().setLayout(layoutWithTable)
slicer.app.applicationLogic().GetSelectionNode().SetActiveTableID(table.GetID())
slicer.app.applicationLogic().PropagateTableSelection()
table = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLTableNode")
table.AddColumn()
table.AddEmptyRow()
table.AddEmptyRow()
table.GetTable().GetColumn(0).SetValue(0, str(58))
table.GetTable().GetColumn(0).SetValue(1, str(20))
showTable(table)
Up to now it displays fine, then when i update the table there is no response (until i hide and show the table on hiearchy, leading me to think the table is properly updated but doesen’t show up due to some refreshing problem?):
table.GetTable().GetColumn(0).SetValue(0, str(150))
table.GetTable().GetColumn(0).SetValue(1, str(190))
showTable(table)