Beispiel #1
0
	def setCombinedDataUnit(self, dataUnit):
		"""
		Set the dataunit used for the colocalization 
		"""
		TaskPanel.setCombinedDataUnit(self, dataUnit)
		# See if the dataunit has a stored colocalizationctf
		# then use that.
		sources = self.dataUnit.getSourceDataUnits()
		self.updateNames()
		
		minval, maxval = sources[0].getScalarRange()
		minval2, maxval2 = sources[1].getScalarRange()
		minval = min(minval, minval2)
		bitmax1 = (2**sources[0].getSingleComponentBitDepth())-1
		bitmax2 = (2**sources[0].getSingleComponentBitDepth())-1
		maxval = max(maxval, maxval2, bitmax1, bitmax2)
		self.lowerthreshold1.SetRange(minval, maxval)
		self.lowerthreshold1.SetValue((maxval - minval + 1) / 2)
		self.upperthreshold1.SetRange(minval, maxval)
		self.upperthreshold1.SetValue(maxval)
		self.lowerthreshold2.SetRange(minval, maxval)
		self.lowerthreshold2.SetValue((maxval - minval + 1) / 2)
		self.upperthreshold2.SetRange(minval, maxval)
		self.upperthreshold2.SetValue(maxval)
		self.updateThreshold(None)

		na = sources[1].getNumericalAperture()
		emission = sources[1].getEmissionWavelength()

		if na:
			self.NA.SetValue("%.4f" % na)
		if emission:
			self.Ch2Lambda.SetValue("%d" % emission)
			
		self.onUpdatePSF(None)

		ctf = self.dataUnit.getSettings().get("ColocalizationColorTransferFunction")
		if not ctf:
			ctf = self.dataUnit.getSettings().get("ColorTransferFunction")
		else:
			Logging.info("Using ColocalizationColorTransferFunction", kw = "task")
		if self.colorBtn:
			self.colorBtn.setColorTransferFunction(ctf)
		self.scatterPlot.setDataUnit(dataUnit)
		if self.scatterPlot:
			#self.scatterPlot.setZSlice(self.preview.z)
			self.scatterPlot.setZSlice(0)
			self.scatterPlot.setTimepoint(self.timePoint)
			self.scatterPlot.updatePreview()		
		
		self.colocalizationPanel.Layout()
    def setCombinedDataUnit(self, dataUnit):
        """
		Sets the processed dataunit that is to be processed.
					 It is then used to get the names of all the source data
					 units and they are added to the menu.
					 This is overwritten from TaskPanel since we only process
					 one dataunit here, not multiple source data units
		"""
        TaskPanel.setCombinedDataUnit(self, dataUnit)

        ctf = self.settings.get("ColorTransferFunction")
        if ctf and self.colorBtn:
            self.colorBtn.setColorTransferFunction(ctf)

            # We register a callback to be notified when the timepoint changes
            # We do it here because the timePointChanged() code requires the dataunit
            # self.Bind(EVT_TIMEPOINT_CHANGED,self.timePointChanged,id=ID_TIMEPOINT)

        tf = self.settings.getCounted("IntensityTransferFunctions", self.timePoint)
        self.iTFEditor.setIntensityTransferFunction(tf)
        self.iTFEditor.updateCallback = self.doPreviewCallback
        self.restoreFromCache()
        self.updateSettings()
Beispiel #3
0
    def setCombinedDataUnit(self, dataUnit):
        """
		Sets the processed dataunit that is to be processed.
					 It is then used to get the names of all the source data
					 units and they are added to the menu.
					 This is overwritten from TaskPanel since we only process
					 one dataunit here, not multiple source data units
		"""
        TaskPanel.setCombinedDataUnit(self, dataUnit)

        ctf = self.settings.get("ColorTransferFunction")
        if ctf and self.colorBtn:
            self.colorBtn.setColorTransferFunction(ctf)

        # We register a callback to be notified when the timepoint changes
        # We do it here because the timePointChanged() code requires the dataunit
        #self.Bind(EVT_TIMEPOINT_CHANGED,self.timePointChanged,id=ID_TIMEPOINT)

        tf = self.settings.getCounted("IntensityTransferFunctions",
                                      self.timePoint)
        self.iTFEditor.setIntensityTransferFunction(tf)
        self.iTFEditor.updateCallback = self.doPreviewCallback
        self.restoreFromCache()
        self.updateSettings()