本文整理匯總了Python中EMAN.ccmlOutputParm方法的典型用法代碼示例。如果您正苦於以下問題:Python EMAN.ccmlOutputParm方法的具體用法?Python EMAN.ccmlOutputParm怎麽用?Python EMAN.ccmlOutputParm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類EMAN
的用法示例。
在下文中一共展示了EMAN.ccmlOutputParm方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: import EMAN [as 別名]
# 或者: from EMAN import ccmlOutputParm [as 別名]
#.........這裏部分代碼省略.........
if (iniCenterOrientationMode != "iniparmfile") and (iniCenterOrientationMode != "headerfile") :
inputParm.initializeCenterAndOrientationFromRandom() # default is random orientation and physical center
if (refCenterOrientationMode != "iniparmfile") and (refCenterOrientationMode != "headerfile") :
inputParm.setRefCenterAndOrientationFromInitializedParms() # default is copy the initial center and orientation
numOfRun = numOfRun + 1
print "numOfRun = ", numOfRun
############################################################################
############ execute cross common line search for reference ################
############################################################################
outputParm = rawImage.crossCommonLineSearch(inputParm)
############################################################################
# pass criteria check
outputParmList.append(outputParm) #if passed criteria, e.g. zscore, residualThreshold, etc
############################################################################
outputParmList.sort(lambda x, y: cmp(x.residual, y.residual))
############################################################################
########################## consistency check ###############################
############################################################################
#passConsistencyCriteria = 0
finalOutputParmList = []
lowestResidualList = []
lengthOfList = len(outputParmList)
if lengthOfList < 2 : continue
for i in range(lengthOfList-1):
thisOutputParm = outputParmList[i]
numOfPairsPassConsistencyCheck = 0
for j in range(i+1,lengthOfList):
refOutputParm = outputParmList[j]
tmpOutputParm = EMAN.ccmlOutputParm() #create a new output parm object
tmpOutputParm.rawImageSN = thisOutputParm.rawImageSN #copy all paramenters
tmpOutputParm.residual = thisOutputParm.residual
tmpOutputParm.sigma = thisOutputParm.sigma
tmpOutputParm.verbose = thisOutputParm.verbose
tmpOutputParm.zScore = thisOutputParm.zScore
tmpOutputParm.zScoreCriterion = thisOutputParm.zScoreCriterion
tmpOutputParm.passAllCriteria = 0
tmpOutputParm.setCalculatedCenterAndOrientation(thisOutputParm.cx,thisOutputParm.cy,thisOutputParm.q)
tmpOutputParm.setRefCenterAndOrientation(refOutputParm.cx, refOutputParm.cy, refOutputParm.q)
tmpOutputParm.calculateDifferenceWithRefParm() #calculated the difference
centerDiff = tmpOutputParm.centerDiff
orientationDiff = tmpOutputParm.orientationDiff
##### FLIP CASE : if no consistency found, try flip this orientation
if ((centerDiff > solutionCenterDiffCriterion) or (orientationDiff > solutionOrientationDiffCriterion)) :
quatFlip = EMAN.Quaternion(refOutputParm.q.getEuler().alt(), refOutputParm.q.getEuler().az(), refOutputParm.q.getEuler().phi()+pi)
tmpOutputParm.setRefCenterAndOrientation(refOutputParm.cx, refOutputParm.cy, quatFlip)
tmpOutputParm.calculateDifferenceWithRefParm() #calculated the difference
centerDiff = tmpOutputParm.centerDiff
orientationDiff = tmpOutputParm.orientationDiff
tmpOutputParm.setRefCenterAndOrientation(refOutputParm.cx, refOutputParm.cy, refOutputParm.q) #set back the exact orientation of reference
#Save the configurations with lowest residuals
if (i<3) and (j==i+1) : lowestResidualList.append(tmpOutputParm)
#make the good/answers list
if ((centerDiff < solutionCenterDiffCriterion) and (orientationDiff < solutionOrientationDiffCriterion)) :
numOfPairsPassConsistencyCheck += 1
if numOfPairsPassConsistencyCheck == 1 : #save to the final list
tmpOutputParm.passAllCriteria = 1