예제 #1
0
    def _evaluateImage(self):

        signalImage = self._signalImage
        contrastImage = self._signalImage if self._contrastImage is None else self._contrastImage

        spot_size = contrastImage.shape[0] * _rel_spot_size

        spots = detectSpots(contrastImage, spot_size).astype(float)

        # Rescale the coordinates and radii of the spots since 'contrastImage' might have another resolution than 'signalImage'.
        spots[:, 0] *= signalImage.shape[0] / contrastImage.shape[0]
        spots[:, 1] *= signalImage.shape[1] / contrastImage.shape[1]
        spots[:, 2] *= signalImage.shape[1] / contrastImage.shape[1]

        spots = np.round(spots)
        spots = spots.astype(int)

        self._spots = spots

        self._values = measure_raw(signalImage, self._spots)
예제 #2
0
	def _evaluateImage(self):
		
		signalImage = self._signalImage
		contrastImage = self._signalImage if self._contrastImage is None else self._contrastImage
		
		spot_size = contrastImage.shape[0] * _rel_spot_size
		
		spots = detectSpots(contrastImage, spot_size).astype(float)
		
		# Rescale the coordinates and radii of the spots since 'contrastImage' might have another resolution than 'signalImage'.
		spots[:,0] *= signalImage.shape[0]/contrastImage.shape[0]
		spots[:,1] *= signalImage.shape[1]/contrastImage.shape[1]
		spots[:,2] *= signalImage.shape[1]/contrastImage.shape[1]
		
		spots = np.round(spots)
		spots = spots.astype(int)
	
		
		self._spots = spots
		
		self._values = measure_raw(signalImage, self._spots)
예제 #3
0
    else:
        if (not os.path.isfile(args["image"])):
            print("not a file")
            exit()

        # read image as grayscale
        image = imread(args["image"], as_grey=True)

    #image = rescale(image, scale=0.5)
    # remove noise
    #image = gaussian_filter(image, 1)

    inspectionMask = np.zeros(image.shape)

    spot_size = image.shape[0] * 0.05
    locations = detectSpots(image, spot_size)
    rawValues = measure_raw(image, locations, inspectionMask=inspectionMask)

    values = [v.mean for v in rawValues]
    stdDevs = [v.std for v in rawValues]

    print("raw measurement: ", rawValues)

    # plot results

    fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(8, 4.5))

    ax1.imshow(image, cmap='gray')
    ax1.set_title('Original')

    ax2.imshow(image, cmap='gray')
예제 #4
0
	else:	
		if(not os.path.isfile(args["image"])):
			print("not a file")
			exit()

		# read image as grayscale
		image = imread(args["image"], as_grey=True)
	
	#image = rescale(image, scale=0.5)
	# remove noise
	#image = gaussian_filter(image, 1)
	
	inspectionMask = np.zeros(image.shape)
	
	spot_size=image.shape[0] * 0.05
	locations = detectSpots(image, spot_size)
	rawValues = measure_raw(image, locations, inspectionMask=inspectionMask)
	
	values = [v.mean for v in rawValues]
	stdDevs = [v.std for v in rawValues]
	
	print("raw measurement: ", rawValues)
	
	# plot results
	
	fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(8, 4.5))
	
	ax1.imshow(image, cmap='gray')
	ax1.set_title('Original')
	
	ax2.imshow(image, cmap='gray')