Skip to content

Commit

Permalink
Fix missed imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pjpjq committed Aug 27, 2019
1 parent cfd385a commit 956fa7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions aitom/filter/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
functions for gaussian filtering
'''

import scipy.ndimage as SN
import gc as GC
import aitom.model.util as MU
import numpy as N
from numpy.fft import fftn, ifftn, fftshift, ifftshift
from ..classify.deep.unsupervised.autoencoder.autoencoder_util import difference_of_gauss_function
from ..image.vol.util import paste_to_whole_map

# smoothing using scipy.ndimage.gaussian_filter
def smooth(v, sigma):
assert sigma > 0
Expand Down Expand Up @@ -35,11 +41,11 @@ def dog_smooth__large_map(v, s1, s2=None):
del v; GC.collect()


g_small = MU.difference_of_gauss_function(size=N.array([int(N.round(s2 * 4))]*3), sigma1=s1, sigma2=s2)
g_small = difference_of_gauss_function(size=N.array([int(N.round(s2 * 4))]*3), sigma1=s1, sigma2=s2)
assert N.all(N.array(g_small.shape) <= N.array(vp.shape)) # make sure we can use CV.paste_to_whole_map()

g = N.zeros(vp.shape)
CV.paste_to_whole_map(whole_map=g, vol=g_small, c=None)
paste_to_whole_map(whole_map=g, vol=g_small, c=None)

g_fft_conj = N.conj( fftn(ifftshift(g)).astype(N.complex64) ) # use ifftshift(g) to move center of gaussian to origin
del g; GC.collect()
Expand Down
2 changes: 1 addition & 1 deletion tutorials/008_particle_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def main():
# Download from: http://ftp.ebi.ac.uk/pub/databases/empiar/archive/10227/data/US1363_G1/14nov13a_tilt/14nov13a__001.mrc.bz2
# Can first reduce its size through bining
result=picking('/ldap_shared/home/v_zhenxi_zhu/14nov13a__001_bin2.mrc', s1=7, s2=7.7, t=3, find_maxima=True, partition_op=None, multiprocessing_process_num=100)
print("%d particles deteced" %len(result))
print("%d particles detected" %len(result))
print(result[0])

if __name__ == '__main__':
Expand Down

0 comments on commit 956fa7e

Please sign in to comment.