Skip to content

Commit 85865d3

Browse files
committed
xxx
1 parent 7d74d19 commit 85865d3

File tree

2 files changed

+40
-21
lines changed

2 files changed

+40
-21
lines changed

pymapmanager/annotations/baseAnnotationsCore.py

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -291,27 +291,46 @@ def _buildDataFrame(self):
291291
logger.error(f'error getting x/y allSpinesDf is: {type(allSpinesDf)}')
292292
print(allSpinesDf)
293293

294-
allSpinesDf['roiType'] = 'spineROI'
295294
allSpinesDf.insert(0,'index', allSpinesDf.index) # index is first column (use this as row label)
295+
296+
addTheseColumns = ['roiType', 'markerColor', 'mplMarker']
297+
for aColumn in addTheseColumns:
298+
allSpinesDf[aColumn] = None
299+
300+
# logger.info('allSpinesDf is:')
301+
# print(allSpinesDf.columns)
302+
# print(allSpinesDf.index)
303+
# print(allSpinesDf)
304+
305+
allSpinesDf['roiType'] = 'spineROI'
306+
307+
if len(allSpinesDf) > 0:
308+
allSpinesDf['markerColor'] = 'm'
309+
try:
310+
_notAcceptRowLabels = allSpinesDf[ ~allSpinesDf['accept'] ]
311+
# logger.warning(f'_notAcceptRowLabels:{_notAcceptRowLabels}')
312+
# ValueError: The truth value of a Series is ambiguous.
313+
# Use a.empty, a.bool(), a.item(), a.any() or a.all().
314+
if len(_notAcceptRowLabels)>0:
315+
allSpinesDf.loc[_notAcceptRowLabels.index, 'markerColor'] = 'w'
316+
except (KeyError) as e:
317+
logger.error(f'{e}')
318+
logger.error(f'available columns are: {allSpinesDf.columns}')
319+
logger.info('_notAcceptRowLabels is:')
320+
print(_notAcceptRowLabels)
321+
logger.error('allSpinesDf is:')
322+
print(allSpinesDf)
296323

297-
# if len(allSpinesDf) > 0:
298-
# TODO make this work
299-
# marker color
300-
# allSpinesDf['markerColor'] = 'm'
301-
# try:
302-
# _notAcceptRowLabels = allSpinesDf[ not allSpinesDf['accept'] ]
303-
# allSpinesDf.loc[_notAcceptRowLabels, 'markerColor'] = 'w'
304-
# except (KeyError) as e:
305-
# logger.error(f'{e}')
306-
# logger.error(f'available columns are: {allSpinesDf.columns}')
307-
308-
# TODO make this work
309-
# _userTypeMarkers = getUserTypeMarkers_mpl()
310-
# allSpinesDf['mplMarker'] = 'o'
311-
# for userType in range(10):
312-
# # 10 user types
313-
# _userTypeRowLabels = allSpinesDf[ allSpinesDf['userType'] == userType]
314-
# allSpinesDf.loc[_userTypeRowLabels, 'mplMarker'] = _userTypeMarkers[userType]
324+
_userTypeMarkers = getUserTypeMarkers_mpl()
325+
# logger.info(f'_userTypeMarkers:{_userTypeMarkers}')
326+
allSpinesDf['mplMarker'] = 'o'
327+
for userType in range(10):
328+
# 10 user types
329+
_userTypeRowLabels = allSpinesDf[ allSpinesDf['userType'] == userType]
330+
# logger.info(f'userType:{userType}')
331+
# logger.info('_userTypeRowLabels.index:')
332+
# print(_userTypeRowLabels.index)
333+
allSpinesDf.loc[_userTypeRowLabels.index, 'mplMarker'] = _userTypeMarkers[userType]
315334

316335
self._df = allSpinesDf
317336

pymapmanager/interface2/runInterfaceBob.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def run():
3535
# random ome zarr file (local)
3636
# path = '/Users/cudmore/Dropbox/data/ome-zarr/6001240.ome.zarr'
3737

38-
# a single timepoint tif file
38+
# a single timepoint tif file (import)
3939
# path = mapmanagercore.data.getTiffChannel_1()
4040

4141
# map with segments and spines (no segments connected)
@@ -53,7 +53,7 @@ def run():
5353

5454
# a mmap with multiple timepoints, connects segments and spines
5555
# path = '/Users/cudmore/Desktop/multi_timepoint_map_seg_spine_connected.mmap'
56-
path = mapmanagercore.data.getMultiTimepointMap()
56+
# path = mapmanagercore.data.getMultiTimepointMap()
5757

5858
# mw will be map widget if path has multiple timepoints, otherwise mw is a stackwidget2
5959
mw = app.loadStackWidget(path)

0 commit comments

Comments
 (0)