Ejemplo n.º 1
0
def apply_enhancement(avg, B_start, pixel_size, user_defined_Bfactor):
	from sp_filter       import filt_gaussinv
	from sp_fundamentals import rot_avg_table
	from sp_morphology   import compute_bfactor
	from EMAN2        import periodogram
	if user_defined_Bfactor>0.0:
		global_b = user_defined_Bfactor
	else:
		guinierline = rot_avg_table(power(periodogram(fft(avg)),.5))
		freq_max    =  1./(2.*pixel_size)
		freq_min    =  1./B_start
		b, junk, ifreqmin, ifreqmax = compute_bfactor(guinierline, freq_min, freq_max, pixel_size)
		#print(ifreqmin, ifreqmax)
		global_b = b*4. #
	return filt_gaussinv(fft(avg), sqrt(2./global_b)), global_b
Ejemplo n.º 2
0
def apply_enhancement(avg, B_start, pixel_size, user_defined_Bfactor):
    if user_defined_Bfactor > 0.0:
        global_b = user_defined_Bfactor
    else:
        guinierline = sp_fundamentals.rot_avg_table(
            sp_morphology.power(
                EMAN2_cppwrap.periodogram(sp_fundamentals.fft(avg)), 0.5))
        freq_max = old_div(1.0, (2.0 * pixel_size))
        freq_min = old_div(1.0, B_start)
        b, junk, ifreqmin, ifreqmax = sp_morphology.compute_bfactor(
            guinierline, freq_min, freq_max, pixel_size)
        # print(ifreqmin, ifreqmax)
        global_b = b * 4.0  #
    return (
        sp_filter.filt_gaussinv(sp_fundamentals.fft(avg),
                                numpy.sqrt(old_div(2.0, global_b))),
        global_b,
    )
Ejemplo n.º 3
0
def apply_enhancement(avg, B_start, pixel_size, user_defined_Bfactor):
    pass  #IMPORTIMPORTIMPORT from sp_filter       import filt_gaussinv
    pass  #IMPORTIMPORTIMPORT from sp_fundamentals import rot_avg_table
    pass  #IMPORTIMPORTIMPORT from sp_morphology   import compute_bfactor
    pass  #IMPORTIMPORTIMPORT from EMAN2        import periodogram
    if user_defined_Bfactor > 0.0:
        global_b = user_defined_Bfactor
    else:
        guinierline = sp_fundamentals.rot_avg_table(
            sp_morphology.power(
                EMAN2_cppwrap.periodogram(sp_fundamentals.fft(avg)), .5))
        freq_max = 1. / (2. * pixel_size)
        freq_min = 1. / B_start
        b, junk, ifreqmin, ifreqmax = sp_morphology.compute_bfactor(
            guinierline, freq_min, freq_max, pixel_size)
        #print(ifreqmin, ifreqmax)
        global_b = b * 4.  #
    return sp_filter.filt_gaussinv(sp_fundamentals.fft(avg),
                                   numpy.sqrt(2. / global_b)), global_b