@@ -36,7 +36,13 @@ def __init__(self, stackWidget : stackWidget2):
3636
3737 # The columns values that are displayed
3838 # self.infoList = ["index", "segmentID", "note", 'accept', 'userType', 'spineLength']
39- self ._displayList = ["index" , "segmentID" , 'spineLength' , 'roiType' ]
39+ self ._displayList = ["index" ,
40+ "segmentID" ,
41+ 'spineLength' ,
42+ 'spineAngle' ,
43+ 'spineSide' ,
44+ 'roiType' ]
45+ # this list can be edited by user
4046 self .infoList = self ._displayList + ["note" , 'accept' , 'userType' ]
4147
4248 # Maintain different widgets that display information
@@ -84,9 +90,9 @@ def _selectionInfoUI(self):
8490 vLayout .addWidget (aLabel , row , col , rowSpan , colSpan )
8591 col += 1
8692
87- # if itemName == 'index':
93+ # if itemName in [ 'index', 'roiType', 'segmentID', 'spineLength'] :
8894 # aWidget = QtWidgets.QLabel()
89- if itemName in [ 'index' , 'roiType' , 'segmentID' , 'spineLength' ] :
95+ if itemName in self . _displayList :
9096 aWidget = QtWidgets .QLabel ()
9197 elif itemName == 'note' :
9298 aWidget = QtWidgets .QLineEdit ('' )
@@ -192,13 +198,15 @@ def _updateUI(self, rowIdx : List[int]):
192198 self ._enableAllWidgets (True )
193199
194200 # just the first row selection
195- rowIdx = rowIdx [0 ]
201+ firstRowIndex = rowIdx [0 ]
202+ self ._pointRowSelection = firstRowIndex
196203
197- self . _pointRowSelection = rowIdx
204+ logger . info ( f'firstRowIndex: { firstRowIndex } ' )
198205
199206 # keys are all possible columns, we only show columns in infoList
200207 # values are, well, the values
201- rowDict = self .pa .getRow (rowIdx )
208+ rowDict = self .pa .getRow (firstRowIndex )
209+ logger .info (f'rowDict:{ rowDict } ' )
202210
203211 for index , itemName in enumerate (self .infoList ):
204212 if itemName not in self .widgetDict .keys ():
@@ -208,6 +216,7 @@ def _updateUI(self, rowIdx : List[int]):
208216
209217 if itemName not in rowDict .keys ():
210218 # our itemName we want to display is not in the backend
219+ logger .warning (f'item name "{ itemName } " is not in backend keys' )
211220 continue
212221
213222 backendValue = rowDict [itemName ]
@@ -217,9 +226,16 @@ def _updateUI(self, rowIdx : List[int]):
217226 # self.blockSignals(True)
218227 self .blockSlotsOn ()
219228
229+ # abb do not hard code items, use the self._displayList
220230 # ["index", "segmentID", "note", 'accept', 'userType']
221- if itemName in ['index' , 'segmentID' , 'note' , 'spineLength' ]:
231+ # if itemName in ['index', 'segmentID', 'note', 'spineLength']:
232+ # itemWidget.setText(str(backendValue))
233+ if itemName in self ._displayList :
234+ # labels
222235 itemWidget .setText (str (backendValue ))
236+ elif itemName == 'note' :
237+ logger .warning (f'setting note { firstRowIndex } to "{ backendValue } "' )
238+ itemWidget .setText (backendValue ) # QLineEdit
223239 elif itemName == 'accept' :
224240 # logger.info(f'backendValue: {backendValue} {type(backendValue)}')
225241 itemWidget .setChecked (bool (backendValue ))
0 commit comments