def createPeakJpeg(imgdata, peaktree, params, procimgarray=None): if 'templatelist' in params: count = len(params['templatelist']) else: count = 1 bin = int(params["bin"]) diam = float(params["diam"]) apix = float(params["apix"]) binpixrad = diam/apix/2.0/float(bin) imgname = imgdata['filename'] jpegdir = os.path.join(params['rundir'],"jpgs") apParam.createDirectory(jpegdir, warning=False) if params['uncorrected']: imgarray = apImage.correctImage(imgdata, params) else: imgarray = imgdata['image'] if procimgarray is not None: #instead of re-processing image use one that is already processed... imgarray = procimgarray else: imgarray = apImage.preProcessImage(imgarray, bin=bin, planeReg=False, params=params) outfile = os.path.join(jpegdir, imgname+".prtl.jpg") msg = not params['background'] subCreatePeakJpeg(imgarray, peaktree, binpixrad, outfile, bin, msg) return
def createPeakJpeg(imgdata, peaktree, params, procimgarray=None): if 'templatelist' in params: count = len(params['templatelist']) else: count = 1 bin = int(params["bin"]) diam = float(params["diam"]) apix = float(params["apix"]) binpixrad = diam / apix / 2.0 / float(bin) imgname = imgdata['filename'] jpegdir = os.path.join(params['rundir'], "jpgs") apParam.createDirectory(jpegdir, warning=False) if params['uncorrected']: imgarray = apImage.correctImage(imgdata, params) else: imgarray = imgdata['image'] if procimgarray is not None: #instead of re-processing image use one that is already processed... imgarray = procimgarray else: imgarray = apImage.preProcessImage(imgarray, bin=bin, planeReg=False, params=params) outfile = os.path.join(jpegdir, imgname + ".prtl.jpg") msg = not params['background'] subCreatePeakJpeg(imgarray, peaktree, binpixrad, outfile, bin, msg) return
def processAndSaveImage(imgdata, params): imgpath = os.path.join(params['rundir'], imgdata['filename'] + ".dwn.mrc") if os.path.isfile(imgpath): return False #downsize and filter leginon image if params['uncorrected']: imgarray = apImage.correctImage(imgdata, params) else: imgarray = imgdata['image'] imgarray = apImage.preProcessImage(imgarray, params=params, msg=False) apImage.arrayToMrc(imgarray, imgpath, msg=False) return True
def processAndSaveImage(imgdata, params): imgpath = os.path.join(params['rundir'], imgdata['filename']+".dwn.mrc") if os.path.isfile(imgpath): return False #downsize and filter leginon image if params['uncorrected']: imgarray = apImage.correctImage(imgdata, params) else: imgarray = imgdata['image'] imgarray = apImage.preProcessImage(imgarray, params=params, msg=False) apImage.arrayToMrc(imgarray, imgpath, msg=False) return True