Skip to content

Commit

Permalink
fixing pivot points
Browse files Browse the repository at this point in the history
  • Loading branch information
cudmore committed Jan 14, 2025
1 parent 28501c2 commit 8009911
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/pymapmanager.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Metadata-Version: 2.2
Name: pymapmanager
Version: 0.0.7.dev335+gf256346.d20250104
Version: 0.0.7.dev342+g28501c2
Requires-Python: >=3.11
License-File: LICENSE
Requires-Dist: mapmanagercore
Expand Down
1 change: 1 addition & 0 deletions src/pymapmanager.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ src/pymapmanager/interface2/mapWidgets/mmMapPlot_mpl.py
src/pymapmanager/interface2/stackWidgets/__init__.py
src/pymapmanager/interface2/stackWidgets/analysisParamWidget2.py
src/pymapmanager/interface2/stackWidgets/annotationListWidget2.py
src/pymapmanager/interface2/stackWidgets/channelEditor.py
src/pymapmanager/interface2/stackWidgets/dendrogramWidget.py
src/pymapmanager/interface2/stackWidgets/histogramWidget2.py
src/pymapmanager/interface2/stackWidgets/imagePlotWidget2.py
Expand Down
4 changes: 2 additions & 2 deletions src/pymapmanager/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '0.0.7.dev335+gf256346.d20250104'
__version_tuple__ = version_tuple = (0, 0, 7, 'dev335', 'gf256346.d20250104')
__version__ = version = '0.0.7.dev342+g28501c2.d20250114'
__version_tuple__ = version_tuple = (0, 0, 7, 'dev342', 'g28501c2.d20250114')
4 changes: 3 additions & 1 deletion src/pymapmanager/annotations/baseAnnotationsCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ def getPivotPoint(self):

returnPointX = []
returnPointY = []
returnPointZ = []
for rowLabel, row in self._summaryDf.iterrows():
segmentID = rowLabel # row["Segment"]
pivotDistance = row["Pivot Distance"]
Expand All @@ -832,8 +833,9 @@ def getPivotPoint(self):

returnPointX.append(_point.x)
returnPointY.append(_point.y)
returnPointZ.append(_point.z)

return returnPointX, returnPointY
return returnPointX, returnPointY, returnPointZ

def getLeftRadiusPlot(self, sliceNumber, zPlusMinus):
# segmentLines = self._df
Expand Down
40 changes: 24 additions & 16 deletions src/pymapmanager/interface2/core/scatter_plot_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,29 +745,37 @@ def getMainLayout(self):
return self.layout

def setScatterPlot(self, xStat, yStat, xyStatIndex):
logger.info('self._df')
# print(self._df.columns)
# print(self._df)
# print(xyStatIndex)

hueColumn = str(self.dict["hueColumn"])
myColorMap = []
# myColorMap = [] # abb how is this used?
if hueColumn == "None" and self.dict["plotType"] == "Scatter":
for id in xyStatIndex:
if self.acceptCheckbox.isChecked() and not self._df["accept"].iloc[id]:
myColorMap.append("white")
else:
myColorMap.append(self.color[0])
# for id in xyStatIndex:
# if self.acceptCheckbox.isChecked() and not self._df["accept"].iloc[id]:
# myColorMap.append("white")
# else:
# myColorMap.append(self.color[0])

self.scatterPoints = self.axScatter.scatter(xStat, yStat, s = self._markerSize, c = myColorMap,
# self.scatterPoints = self.axScatter.scatter(xStat, yStat, s = self._markerSize, c = myColorMap,
# picker=False)
self.scatterPoints = self.axScatter.scatter(xStat, yStat, s = self._markerSize, c = self.filteredDF['markerColor'],
picker=False)
else: # hue is selected
for id in xyStatIndex:
if self.acceptCheckbox.isChecked() and not self._df["accept"].iloc[id]:
myColorMap.append("white")
else:
if hueColumn != "None":
logger.info(f'hueColumn: "{hueColumn}" id:{id}')
hueId = self._df[hueColumn].iloc[id]
myColorMap.append(self.color[hueId])
# for id in xyStatIndex:
# if self.acceptCheckbox.isChecked() and not self._df["accept"].iloc[id]:
# myColorMap.append("white")
# else:
# if hueColumn != "None":
# logger.info(f'hueColumn: "{hueColumn}" id:{id}')
# hueId = self._df[hueColumn].iloc[id]
# myColorMap.append(self.color[hueId])

if self.dict["plotType"] == "Scatter":
self.scatterPoints = self.axScatter.scatter(xStat, yStat, s = 12, c = myColorMap,
# self.scatterPoints = self.axScatter.scatter(xStat, yStat, s = 12, c = myColorMap,
self.scatterPoints = self.axScatter.scatter(xStat, yStat, s = 12, c = self.filteredDF['markerColor'],
picker=False)
elif self.dict["plotType"] == "Histogram":
if hueColumn == "None":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ def slot_setSlice(self, sliceNumber: int):

# TODO add option to show/hide
# TODO add a z and mask if not in view (just like core points)
pivotPointXs, pivotPointYs = self._annotations.getPivotPoint()
pivotPointXs, pivotPointYs, pivotPointZs = self._annotations.getPivotPoint()
self._pivotPoints.setData(pivotPointXs, pivotPointYs)

def selectedEvent(self, event: pmmEvent):
Expand Down

0 comments on commit 8009911

Please sign in to comment.