Commit 7fe68903 authored by Thomas Vincent's avatar Thomas Vincent

use right axis names in ROI intensity tooltip

parent a97ff419
......@@ -91,8 +91,10 @@ class ROIPlotIntensityMap(PlotIntensityMap):
"""Plot ROI intensities with an update button to compute it in a thread"""
_DEFAULT_TOOLTIP = 'Intensity Map: sum of the whole QSpace'
_ROI_TOOLTIP = ('ROI Intensity Map: sum of the Region of Interest:\n' +
'qx = [%f, %f]\nqy = [%f, %f]\nqz = [%f, %f]') # TODO
_ROI_TOOLTIP = 'ROI Intensity Map: sum of the Region of Interest:\n' \
'{dim0} = [{d0_min}, {d0_max}]\n' \
'{dim1} = [{d1_min}, {d1_max}]\n' \
'{dim2} = [{d2_min}, {d2_max}]'
def __init__(self, parent, qspaceH5):
# TODO
......@@ -181,12 +183,21 @@ class ROIPlotIntensityMap(PlotIntensityMap):
sampleX = qsp.sample_x
sampleY = qsp.sample_y
self.setPlotData(sampleX, sampleY, intensities)
axis_names = qsp.qspace_dimension_names
if self.__roiQRange is None:
self.setToolTip(self._DEFAULT_TOOLTIP)
else:
self.setToolTip(
self._ROI_TOOLTIP % tuple(self.__roiQRange.ravel()))
self.setToolTip(self._ROI_TOOLTIP.format(
dim0=axis_names[0],
d0_min=self.__roiQRange[0, 0],
d0_max=self.__roiQRange[0, 1],
dim1=axis_names[1],
d1_min=self.__roiQRange[1, 0],
d1_max=self.__roiQRange[1, 1],
dim2=axis_names[2],
d2_min=self.__roiQRange[2, 0],
d2_max=self.__roiQRange[2, 1]))
class CutPlanePlotWindow(PlotWidget):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment