Commit 298653e7 authored by Thomas Vincent's avatar Thomas Vincent

Set max default bin size to 100 + add tooltip with recommended max

parent f49d3238
......@@ -368,6 +368,16 @@ class ConversionParamsWidget(Qt.QWidget):
for edit, size in zip(self.__qDimEdits[coordinates], qspaceDims):
edit.setText(str(int(size)))
def setQSpaceRecommendedMaxDims(self, coordinates, qspaceDims):
"""Sets the recommended max qspace dimensions.
:param QSpaceCoordinates coordinates:
:param qspaceDims: A three integers array.
"""
self.__qDimWidgets[coordinates].setToolTip(
'Set the number of bins of the histogram for each dimension.\n'
'Recommended maximum values are: [%d, %d, %d]' % tuple(qspaceDims))
def getBeamEnergy(self):
"""Returns beam energy in eV or None if no input"""
if self.__acqParamWid.isBeamEnergyEnabled():
......@@ -644,7 +654,6 @@ class QSpaceWidget(Qt.QDialog):
entry = entries[0] # Get default config from first entry
for coordinates in QSpaceCoordinates.ALLOWED:
#if coordinates == QSpaceCoordinates.CARTESIAN or 1:
# Compute Qspace conversion
q_array = qspace_conversion(
img_size=xsocsH5.image_size(entry),
......@@ -666,11 +675,12 @@ class QSpaceWidget(Qt.QDialog):
bins = (abs(dim).max() - abs(dim).min()) / step
maxbin = min(maxbin, bins)
maxbins.append(int(maxbin) + 1)
# TODO estimate bins for spherical coordinates
# CR: it should just work?!
#maxbins = [0, 0, 0]
self.__paramsWid.setQSpaceDims(coordinates, maxbins)
# Set default number of bins to at most 100
self.__paramsWid.setQSpaceDims(
coordinates, [min(maxbin, 100) for maxbin in maxbins])
self.__paramsWid.setQSpaceRecommendedMaxDims(coordinates,
maxbins)
else: # Set to 0 by default
for coordinates in QSpaceCoordinates.ALLOWED:
......
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