Ejemplo n.º 1
0
    def lineProfile2(self, slice):
        """ one slice

		Returns:

		x: ndarray, one point for each point in the profile (NOT images/slice in stack)
		"""
        if slice % 300 == 0:
            print('   worker lineProfile2() slice:', slice, 'of',
                  self.numImages)
        try:
            intensityProfile = profile.profile_line(self.data[slice, :, :],
                                                    self.src,
                                                    self.dst,
                                                    linewidth=self.linewidth)
            x = np.asarray([
                a for a in range(len(intensityProfile))
            ])  # make alist of x points (todo: should be um, not points!!!)
            yFit, FWHM, left_idx, right_idx = self.fitGaussian(
                x, intensityProfile)
        except ValueError as e:
            print(
                '!!!!!!!!!! *********** !!!!!!!!!!!!! my exception in lineProfile2() ... too many values to unpack (expected 2)'
            )
            print('e:', e)
            return (None, None, None, None, None, None)
        return (x, intensityProfile, yFit, FWHM, left_idx, right_idx)
Ejemplo n.º 2
0
    def lineProfile(self, slice, src, dst, linewidth=3, doFit=True):
        """ one slice

		Returns:

		x: ndarray, one point for each point in the profile (NOT images/slice in stack)
		"""
        '''
		print('!!!! lineProfile() slice:', slice, 'src:', src, 'dst:', dst)
		print('   slice:', slice)
		print('   src:', src, type(src))
		print('   dst:', dst, type(dst))
		print('   self.data.shape:', self.data.shape)
		print('   linewidth:', linewidth, type(linewidth))
		'''
        #channel = 0
        #intensityProfile = profile.profile_line(self.stack.stack[channel,slice,:,:], src, dst, linewidth=linewidth)
        try:
            #print('self.data[slice,:,:].shape', self.data[slice,:,:].shape)
            intensityProfile = profile.profile_line(self.data[slice, :, :],
                                                    src,
                                                    dst,
                                                    linewidth=linewidth)
            x = np.asarray([
                a for a in range(len(intensityProfile))
            ])  # make alist of x points (todo: should be um, not points!!!)
            yFit, FWHM, left_idx, right_idx = self.fitGaussian(
                x, intensityProfile)
        except ValueError as e:
            print(
                '!!!!!!!!!! *********** !!!!!!!!!!!!! my exception in lineProfile() ... too many values to unpack (expected 2)'
            )
            print('e:', e)
            return (None, None, None, None, None, None)
        '''
		print('lineProfile() slice:', slice)
		print('   x.shape:', x.shape)
		print('   intensityProfile.shape:', intensityProfile.shape)
		print('   yFit.shape:', yFit.shape)
		print('   FWHM:', FWHM, 'left_idx:', left_idx, 'right_idx:', right_idx)
		'''
        return (x, intensityProfile, yFit, FWHM, left_idx, right_idx)