def __init__(self, *args, **kwargs) -> None:
        super().__init__(__file__, *args, **kwargs)

        # Prepare UI elements
        self.configPanel.setModelType(PulseScheme)
        self.configPanel.setPresetsDirectory(PresetFileDirs.PulseScheme)
        self.configPanel.setStartDirectory(UserFileDirs.PulseScheme)
        self.configPanel.setValueGetter(self.value)
        self.configPanel.setValueSetter(self.setValue)

        self.plot.setMouseEnabled(x=False, y=False)
        self.plot.setMenuEnabled(False)
        self.plot.getAxis("left").setTicks([[(0, "OFF"), (1, "ON")]])

        # Connect own signal slots
        self.modifiedFlagSet.connect(self._onModifiedFlagSet)
        self.editProperties.modifiedFlagSet.connect(self._onModifiedFlagSet)
        self.configPanel.dataLoaded.connect(self._onLoadConfig)

        # Connect forwarded signals
        self.plot.scene().sigMouseClicked.connect(self.plotClicked)
        self.btnAddPulse.clicked.connect(self.addPulseClicked)
        self.btnRemovePulse.clicked.connect(self.removePulseClicked)
        self.configPanel.dataLoaded.connect(self.modifiedFlagSet)

        connectMulti(self.editProperties.wavelengthChangedByUser,
                     [float, Multivalue], self.pulseWavelengthChangedByUser)
        connectMulti(self.editProperties.durationChangedByUser,
                     [float, Multivalue], self.pulseDurationChangedByUser)
        self.editProperties.moveLeftClicked.connect(self.pulseMoveLeftClicked)
        self.editProperties.moveRightClicked.connect(
            self.pulseMoveRightClicked)

        # Initialize presenter
        self._presenter = PulseSchemePresenter(self)
Exemple #2
0
    def __init__(self, *args, **kwargs) -> None:
        super().__init__(__file__, *args, **kwargs)

        # Prepare UI elements
        self.configPanel.setModelType(SampleProperties)
        self.configPanel.setPresetsDirectory(PresetFileDirs.SampleProperties)
        self.configPanel.setStartDirectory(UserFileDirs.SampleProperties)
        self.configPanel.setValueGetter(self.value)
        self.configPanel.setValueSetter(self.setValue)

        self.updateStructureLoaded(False)

        setTabOrderForChildren(self, [
            self.configPanel, self.editInputPower, self.editDOrigin,
            self.btnLoadSampleStructure
        ])

        # Connect own signal slots
        self.modifiedFlagSet.connect(self._onModifiedFlagSet)

        # Connect forwarded signals
        connectMulti(self.editInputPower.valueChangedByUser,
                     [float, Multivalue], self.inputPowerChangedByUser)
        connectMulti(self.editDOrigin.valueChangedByUser, [float, Multivalue],
                     self.DOriginChangedByUser)
        self.configPanel.dataLoaded.connect(self.modifiedFlagSet)

        self.btnLoadSampleStructure.clicked.connect(
            self.loadSampleStructureClicked)

        # Initialize presenter
        self._presenter = SamplePropertiesPresenter(self)
Exemple #3
0
    def __init__(self, widget) -> None:
        super().__init__(ImagingSystemSettings(), widget)

        # Prepare UI events
        widget.opticalPsfChanged.connect(self._uiSetOpticalPsfModel)
        widget.pinholeFunctionChanged.connect(self._uiSetPinholeFunctionModel)
        connectMulti(widget.scanningStepSizeChanged, [float, Multivalue],
                     self._uiScanningStepSizeChange)
        widget.refractiveIndexChanged.connect(self._uiRefractiveIndexChange)
Exemple #4
0
    def __init__(self, widget) -> None:
        super().__init__(SampleProperties(), widget)

        # Prepare UI events
        connectMulti(widget.inputPowerChangedByUser, [float, Multivalue],
                     self._uiInputPowerChange)
        connectMulti(widget.DOriginChangedByUser, [float, Multivalue],
                     self._uiDOriginChange)

        widget.loadSampleStructureClicked.connect(
            self._uiClickLoadSampleStructure)
        widget.unloadSampleStructureClicked.connect(
            self._uiClickUnloadSampleStructure)
    def __init__(self, *args, **kwargs) -> None:
        super().__init__(__file__, *args, **kwargs)

        # Prepare UI elements
        self.configPanel.setModelType(ImagingSystemSettings)
        self.configPanel.setPresetsDirectory(
            PresetFileDirs.ImagingSystemSettings)
        self.configPanel.setStartDirectory(UserFileDirs.ImagingSystemSettings)
        self.configPanel.setValueGetter(self.value)
        self.configPanel.setValueSetter(self.setValue)

        self.editOpticalPsf.setFieldName("Optical PSF")
        self.editOpticalPsf.setAllowEditGenerationAmplitude(True)
        self.editOpticalPsf.setAvailableGenerationTypes(
            [PatternType.airy_from_NA])

        self.editPinholeFunction.setFieldName("Pinhole Function")
        self.editPinholeFunction.setAllowEditGenerationAmplitude(True)
        self.editPinholeFunction.setAvailableGenerationTypes(
            [PatternType.digital_pinhole, PatternType.physical_pinhole])

        for refractiveIndex in list(RefractiveIndex):
            self.editImmersionType.addItem(getEnumEntryName(refractiveIndex),
                                           refractiveIndex.value)

        setTabOrderForChildren(self, [
            self.configPanel, self.editOpticalPsf, self.editPinholeFunction,
            self.editScanningStepSize, self.editImmersionType
        ])

        # Connect own signal slots
        self.modifiedFlagSet.connect(self._onModifiedFlagSet)
        self.editImmersionType.currentIndexChanged.connect(
            self._onImmersionTypeChange)

        # Connect forwarded signals
        self.editOpticalPsf.valueChanged.connect(self.opticalPsfChanged)
        self.editPinholeFunction.valueChanged.connect(
            self.pinholeFunctionChanged)
        connectMulti(self.editScanningStepSize.valueChanged,
                     [float, Multivalue], self.scanningStepSizeChanged)
        self.configPanel.dataLoaded.connect(self.modifiedFlagSet)

        # Initialize presenter
        self._presenter = ImagingSystemSettingsPresenter(self)
Exemple #6
0
    def __init__(self, *args, **kwargs) -> None:
        self._hasSetMinimumHeight = False
        super().__init__(__file__, *args, **kwargs)

        # Prepare UI elements
        self.configPanel.setModelType(DetectorProperties)
        self.configPanel.setPresetsDirectory(PresetFileDirs.DetectorProperties)
        self.configPanel.setStartDirectory(UserFileDirs.DetectorProperties)
        self.configPanel.setValueGetter(self.value)
        self.configPanel.setValueSetter(self.setValue)

        setTabOrderForChildren(self, [
            self.configPanel, self.rdoPointDetector, self.rdoCamera,
            self.editReadoutNoise, self.editCameraPixelSize,
            self.editQuantumEfficiency
        ])

        # Connect own signal slots
        self.modifiedFlagSet.connect(self._onModifiedFlagSet)

        # Connect forwarded signals
        self.rdoPointDetector.toggled.connect(self.typePointDetectorToggled)
        self.rdoCamera.toggled.connect(self.typeCameraToggled)
        connectMulti(self.editReadoutNoise.valueChanged, [float, Multivalue],
                     self.readoutNoiseChanged)
        connectMulti(self.editQuantumEfficiency.valueChanged,
                     [float, Multivalue], self.quantumEfficiencyChanged)
        connectMulti(self.editCameraPixelSize.valueChanged,
                     [float, Multivalue], self.cameraPixelSizeChanged)
        self.configPanel.dataLoaded.connect(self.modifiedFlagSet)

        # Initialize presenter
        self._presenter = DetectorPropertiesPresenter(self)
    def __init__(self, widget) -> None:
        super().__init__(IlluminationResponse(), widget)

        # Prepare UI events
        widget.wavelengthChanged.connect(self._uiWavelengthChange)
        connectMulti(widget.offToOnChanged, [float, Multivalue], self._uiOffToOnChange)
        connectMulti(widget.onToOffChanged, [float, Multivalue], self._uiOnToOffChange)
        connectMulti(widget.emissionChanged, [float, Multivalue], self._uiEmissionChange)
Exemple #8
0
    def __init__(self, *args, **kwargs) -> None:
        super().__init__(__file__, *args, **kwargs)

        # Prepare UI elements
        self.editIlluminationPattern.setFieldName("Illumination Pattern")
        self.editIlluminationPattern.setAllowEditGenerationAmplitude(False)
        self.editIlluminationPattern.setAvailableGenerationTypes([
            PatternType.gaussian, PatternType.doughnut,
            PatternType.airy_from_FWHM
        ])

        # Prepare UI elements
        setTabOrderForChildren(self, [
            self.editWavelength, self.editDuration, self.editMaxIntensity,
            self.btnMoveLeft, self.btnMoveRight, self.editIlluminationPattern
        ])

        # Connect forwarded signals
        connectMulti(self.editWavelength.valueChanged, [float, Multivalue],
                     self.wavelengthChanged)
        connectMulti(self.editWavelength.valueChangedByUser,
                     [float, Multivalue], self.wavelengthChangedByUser)
        connectMulti(self.editDuration.valueChanged, [float, Multivalue],
                     self.durationChanged)
        connectMulti(self.editDuration.valueChangedByUser, [float, Multivalue],
                     self.durationChangedByUser)
        connectMulti(self.editMaxIntensity.valueChanged, [float, Multivalue],
                     self.maxIntensityChanged)
        self.editIlluminationPattern.valueChanged.connect(
            self.illuminationPatternChanged)

        self.btnMoveLeft.clicked.connect(self.moveLeftClicked)
        self.btnMoveRight.clicked.connect(self.moveRightClicked)

        # Initialize presenter
        self._presenter = PulsePropertiesPresenter(self)
    def __init__(self, widget) -> None:
        super().__init__(DetectorProperties(), widget)

        # Prepare UI events
        widget.typePointDetectorToggled.connect(self._uiPointDetectorToggle)
        widget.typeCameraToggled.connect(self._uiCameraToggle)
        connectMulti(widget.readoutNoiseChanged, [float, Multivalue],
                     self._uiReadoutNoiseChange)
        connectMulti(widget.quantumEfficiencyChanged, [float, Multivalue],
                     self._uiQuantumEfficiencyChange)
        connectMulti(widget.cameraPixelSizeChanged, [float, Multivalue],
                     self._uiCameraPixelSizeChange)
Exemple #10
0
    def __init__(self, *args, **kwargs) -> None:
        super().__init__(__file__, *args, **kwargs)

        # Prepare UI elements
        setTabOrderForChildren(self, [
            self.editWavelength, self.editOffToOn, self.editOnToOff,
            self.editEmission
        ])

        # Connect forwarded signals
        self.editWavelength.valueChanged.connect(self.wavelengthChanged)
        connectMulti(self.editOffToOn.valueChanged, [float, Multivalue],
                     self.offToOnChanged)
        connectMulti(self.editOnToOff.valueChanged, [float, Multivalue],
                     self.onToOffChanged)
        connectMulti(self.editEmission.valueChanged, [float, Multivalue],
                     self.emissionChanged)

        # Initialize presenter
        self._presenter = ResponsePropertiesPresenter(self)