def __init__(self, imageDisplay): ImageTool.__init__(self, imageDisplay) self._refImg = None pa = self.setParameterMenu() self.createResultInDisplayParam(pa) self.pSide = pa.addChild({ 'name': 'Side', 'type': 'list', 'value': 'bottom', 'limits': ['bottom', 'top', 'left', 'right']}) pImgChoose = pa.addChild({ 'name': 'add to image', 'value': 'from display', 'type': 'menu'}) self.pImg = pImgChoose.addChild({ 'name': 'chosen', 'value': '-', 'type': 'str', 'readonly': True}) pImgChoose.aboutToShow.connect(self.buildImgMenu) self.pBgColor = pa.addChild({ 'name': 'Background colour', 'type': 'list', 'value': '0', 'limits': ['-', '0', 'np.nan']}) self.pOverlap = pa.addChild({ 'name': 'Overlap', 'type': 'int', 'value': 250, 'limits': [0, 2000]}) self.pOverlapDev = self.pOverlap.addChild({ 'name': 'Deviation', 'type': 'int', 'value': 50, 'limits': [0, 2000]}) self.pRot = pa.addChild({ 'name': 'Rotation [DEG]', 'type': 'float', 'value': 0, 'limits': [-45, 45]}) self.pRotDev = self.pRot.addChild({ 'name': 'Deviation', 'type': 'float', 'value': 0, 'limits': [0, 20]}) self.pSet = pa.addChild({ 'name': 'Set parameters to result', 'type': 'bool', 'value': False, 'tip': 'Activate, to set overlap and rotation to found result'})
def __init__(self, imageDisplay): ImageTool.__init__(self, imageDisplay) self.calFileTool = self.showGlobalTool(CalibrationFile) self.pa = self.setParameterMenu() self.createResultInDisplayParam(self.pa) self._bg = None self._method = None self.pMethod = self.pa.addChild({ 'name':'Method', 'type':'list', 'value':'as function', 'limits':['average', 'as function']}) self.pa.addChild({ 'name':'Exposure times [s]', 'type':'str', 'value':'... are taken from layer value', 'readonly':True}) self.pUpdate = self.pa.addChild({ 'name':'Update calibration', 'type':'action', 'visible':False}) self.pUpdate.sigActivated.connect(self.updateCalibration)
def __init__(self, imageDisplay): ImageTool.__init__(self, imageDisplay) self.outDisplay = None self.calFileTool = self.showGlobalTool(CalibrationFile) self._bg = None pa = self.setParameterMenu() pMeasure = pa.addChild({ 'name': 'Calculate calibration array ...', 'type': 'empty'}) self.createResultInDisplayParam(pMeasure) self.pMethod = pMeasure.addChild({ 'name': 'Method', 'type': 'list', 'value': 'from calibration images', 'limits': ['from calibration images', 'from normal images'], 'tip': ''''from calibration images' %s 'from normal images' %s''' % (flatFieldFromCalibration.__doc__, FlatFieldFromImgFit.__doc__)}) self.pFitMethod = pMeasure.addChild({ 'name': 'Fit method', 'type': 'list', 'value': 'fit vignetting function', 'limits': ['fit vignetting function', 'fit polynomial'], 'visible': False}) self.pMethod.sigValueChanged.connect(lambda p, v: self.pFitMethod.show(p.value() == 'from normal images')) self.pBg = pMeasure.addChild({ 'name': 'Background image(s)', 'value': '-', 'type': 'menu', 'tip': '''either one averaged or multiple RAW background images of the same exposure time'''}) self.pBg.aboutToShow.connect(self._buildRefImgMenu) pa.addChild({ 'name': 'Load calibration array ...', 'type': 'menu', 'value': 'from display'}).aboutToShow.connect( lambda m, fn=self._fromDisplay: self.buildOtherDisplayLayersMenu(m, fn, includeThisDisplay=True)) self.pUpdate = pa.addChild({ 'name': 'Update calibration', 'type': 'action', 'visible': False}) self.pUpdate.sigActivated.connect(self.updateCalibration)
def __init__(self, imageDisplay): ImageTool.__init__(self, imageDisplay) self.calFileTool = self.showGlobalTool(CalibrationFile) self.pa = self.setParameterMenu() self._bg = None self._method = None self._inter, self._slope = None, None pMeasure = self.pa.addChild({ 'name':'Calculate calibration array ...', 'type':'empty'}) self.createResultInDisplayParam(pMeasure) self.pMethod = pMeasure.addChild({ 'name':'Method', 'type':'list', 'value':'as function', 'limits':['average', 'as function']}) pMeasure.addChild({ 'name':'Exposure times [s]', 'type':'str', 'value':'... are taken from layer value', 'readonly':True}) pFromDisplay = self.pa.addChild({ 'name':'Load calibration array ...', 'type':'empty'}) pFromDisplay.addChild({ 'name':'Intercept', 'type':'menu', 'value':'from display'}).aboutToShow.connect( lambda m, fn=self._interceptfromDisplay: self.buildOtherDisplayLayersMenu(m,fn, includeThisDisplay=True)) pFromDisplay.addChild({ 'name':'Slope', 'type':'menu', 'value':'from display'}).aboutToShow.connect( lambda m, fn=self._slopefromDisplay: self.buildOtherDisplayLayersMenu(m,fn, includeThisDisplay=True)) self.pUpdate = self.pa.addChild({ 'name':'Update calibration', 'type':'action', 'visible':False}) self.pUpdate.sigActivated.connect(self.updateCalibration)
def __init__(self, imageDisplay): ImageTool.__init__(self, imageDisplay) self.calFileTool = self.showGlobalTool(CalibrationFile) self.pa = self.setParameterMenu() self._bg = None self._method = None self._inter, self._slope = None, None pMeasure = self.pa.addChild({ 'name': 'Calculate calibration array ...', 'type': 'empty'}) self.createResultInDisplayParam(pMeasure) self.pMethod = pMeasure.addChild({ 'name': 'Method', 'type': 'list', 'value': 'as function', 'limits': ['average', 'as function']}) pMeasure.addChild({ 'name': 'Exposure times [s]', 'type': 'str', 'value': '... are taken from layer value', 'readonly': True}) pFromDisplay = self.pa.addChild({ 'name': 'Load calibration array ...', 'type': 'empty'}) pFromDisplay.addChild({ 'name': 'Intercept', 'type': 'menu', 'value': 'from display'}).aboutToShow.connect( lambda m, fn=self._interceptfromDisplay: self.buildOtherDisplayLayersMenu(m, fn, includeThisDisplay=True)) pFromDisplay.addChild({ 'name': 'Slope', 'type': 'menu', 'value': 'from display'}).aboutToShow.connect( lambda m, fn=self._slopefromDisplay: self.buildOtherDisplayLayersMenu(m, fn, includeThisDisplay=True)) self.pUpdate = self.pa.addChild({ 'name': 'Update calibration', 'type': 'action', 'visible': False}) self.pUpdate.sigActivated.connect(self.updateCalibration)
def __init__(self, imageDisplay): ImageTool.__init__(self, imageDisplay) self.outDisplay = None self.calFileTool = self.showGlobalTool(CalibrationFile) self._bg = None pa = self.setParameterMenu() pMeasure = pa.addChild({ 'name': 'Calculate calibration array ...', 'type': 'empty' }) self.createResultInDisplayParam(pMeasure) self.pMethod = pMeasure.addChild({ 'name': 'Method', 'type': 'list', 'value': 'from calibration images', 'limits': ['from calibration images', 'from normal images'], 'tip': ''''from calibration images' %s 'from normal images' %s''' % (flatFieldFromCalibration.__doc__, FlatFieldFromImgFit.__doc__) }) self.pFitMethod = pMeasure.addChild({ 'name': 'Fit method', 'type': 'list', 'value': 'fit vignetting function', 'limits': ['fit vignetting function', 'fit polynomial'], 'visible': False }) self.pMethod.sigValueChanged.connect(lambda p, v: self.pFitMethod.show( p.value() == 'from normal images')) self.pBg = pMeasure.addChild({ 'name': 'Background image(s)', 'value': '-', 'type': 'menu', 'tip': '''either one averaged or multiple RAW background images of the same exposure time''' }) self.pBg.aboutToShow.connect(self._buildRefImgMenu) pa.addChild({ 'name': 'Load calibration array ...', 'type': 'menu', 'value': 'from display' }).aboutToShow.connect( lambda m, fn=self._fromDisplay: self.buildOtherDisplayLayersMenu( m, fn, includeThisDisplay=True)) self.pUpdate = pa.addChild({ 'name': 'Update calibration', 'type': 'action', 'visible': False }) self.pUpdate.sigActivated.connect(self.updateCalibration)
def __init__(self, imageDisplay): ImageTool.__init__(self, imageDisplay) self._refImg = None pa = self.setParameterMenu() self.createResultInDisplayParam(pa) self.pSide = pa.addChild({ 'name': 'Side', 'type': 'list', 'value': 'bottom', 'limits': ['bottom', 'top', 'left', 'right'] }) pImgChoose = pa.addChild({ 'name': 'add to image', 'value': 'from display', 'type': 'menu' }) self.pImg = pImgChoose.addChild({ 'name': 'chosen', 'value': '-', 'type': 'str', 'readonly': True }) pImgChoose.aboutToShow.connect(self.buildImgMenu) self.pBgColor = pa.addChild({ 'name': 'Background colour', 'type': 'list', 'value': '0', 'limits': ['-', '0', 'np.nan'] }) self.pOverlap = pa.addChild({ 'name': 'Overlap', 'type': 'int', 'value': 250, 'limits': [0, 2000] }) self.pOverlapDev = self.pOverlap.addChild({ 'name': 'Deviation', 'type': 'int', 'value': 50, 'limits': [0, 2000] }) self.pRot = pa.addChild({ 'name': 'Rotation [DEG]', 'type': 'float', 'value': 0, 'limits': [-45, 45] }) self.pRotDev = self.pRot.addChild({ 'name': 'Deviation', 'type': 'float', 'value': 0, 'limits': [0, 20] }) self.pSet = pa.addChild({ 'name': 'Set parameters to result', 'type': 'bool', 'value': False, 'tip': 'Activate, to set overlap and rotation to found result' })