Skip to content

Commit 3f16dcb

Browse files
committed
phoenix 2/2
1 parent 40cc704 commit 3f16dcb

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

src/pymapmanager/annotations/baseAnnotationsCore.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def getSegmentPlot(self,
135135
return df
136136

137137
def getRow(self, rowIdx : int):
138-
"""Get columns and values for one row index.
138+
"""Get columns and values for one row label index.
139139
"""
140140
df = self.getDataFrame()
141141
row = df.loc[rowIdx]
@@ -463,15 +463,15 @@ def editSpine(self, editSpineProperty : List[dict]):
463463

464464
def spineID_Exists(self, spineID : int) -> bool:
465465
if not isinstance(spineID, int):
466-
logger.error(f'got bad spineID:{spineID}, expecting int')
466+
logger.error(f'got bad spineID:{spineID} {type(spineID)}, expecting int')
467467
return False
468468
if spineID not in self.singleTimepoint.points.index:
469469
logger.error(f'spineID:{spineID} does not exists')
470470
# print(self.singleTimepoint.points.index)
471471
return False
472472

473-
logger.info(f'spineID:{spineID}')
474-
print(self.singleTimepoint.points.index)
473+
# logger.info(f'spineID:{spineID}')
474+
# print(self.singleTimepoint.points.index)
475475
return True
476476

477477
def moveSpine(self, spineID :int, x, y, z):

src/pymapmanager/interface2/runInterfaceBob.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def run():
2727
# path = '/Users/cudmore/Desktop/multi_timepoint_map_seg_spine_connected.mmap'
2828
# path = mapmanagercore.data.getMultiTimepointMap()
2929

30+
path = '/Users/cudmore/Desktop/olsen_example.mmap'
31+
3032
app = PyMapManagerApp(sys.argv)
3133
# mw will be map widget if path has multiple timepoints, otherwise mw is a stackwidget2
3234
mw = app.loadStackWidget(path)

src/pymapmanager/interface2/stackWidgets/spineInfoWidget.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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))

src/pymapmanager/timeseriesCore.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def __init__(self, path : str):
149149
# if path.endswith('.mmap') or path.endswith('.mmap/') or path.endswith('.mmap.zip'):
150150
if _ext in LOAD_SAVE_EXTENSIONS:
151151
self._load_zarr()
152-
elif path.endswith('.tif'):
152+
elif path.endswith('.tif') or path.endswith('.nd2'):
153153
self._import_tiff()
154154
# elif path.endswith('.ome.zarr'):
155155
# elif path.endswith('.zarr') or path.endswith('.zarr/'):
@@ -331,22 +331,10 @@ def _import_tiff(self):
331331
loader = MultiImageLoader()
332332
loader.read(path, channel=0)
333333

334-
# TEMPORARY, fake second channel, to debug single channel stack
335-
# loader.read(path, channel=1)
336-
337-
# map = MapAnnotations(loader.build(),
338334
map = MapAnnotations(loader,
339335
lineSegments=pd.DataFrame(),
340336
points=pd.DataFrame())
341337

342-
# abb trying to figure out tree
343-
from pprint import pprint
344-
logger.info('dataTree???')
345-
pprint(loader.dataTree())
346-
347-
# map.points[:]
348-
# map.segments[:]
349-
350338
self._fullMap : MapAnnotations = map
351339

352340
def _import_ome_zarr(self):

0 commit comments

Comments
 (0)