def permissiveMask( self, volumeThres, gaussSigma = 5.0, gaussRethres = 0.07, smoothSigma=1.5 ):
"""
Given a (tight) volumeThres(hold) measured in Chimera or IMS, this function generates a
Gaussian dilated mask that is then smoothed. Everything is done with Gaussian operations
so the Fourier space representation of the mask should be relatively smooth as well,
and hence ring less.
Excepts self.mrc to be loaded. Populates self.mask.
"""
thres = self.mrc > volumeThres; thres = thres.astype('float32')
gaussThres = scipy.ndimage.gaussian_filter( thres, gaussSigma )
rethres = gaussThres > gaussRethres; rethres = rethres.astype('float32')
self.mask = scipy.ndimage.gaussian_filter( rethres, smoothSigma )
print( "permissive mask complete, use ioMRC.writeMRC(self.mrc, 'maskname.mrc') to save" )
pass
评论列表
文章目录