def importPicks(self, picks1, picks2, tight=False, msg=True):
		t0 = time.time()
		#print picks1
		#print self.currentpicks1
		curpicks1 = numpy.asarray(self.currentpicks1)
		curpicks2 = numpy.asarray(self.currentpicks2)
		#print curpicks1

		# get picks
		apTiltTransform.setPointsFromArrays(curpicks1, curpicks2, self.data)
		pixdiam = self.data['pixdiam']
		if tight is True:
			pixdiam /= 4.0
		#print self.data, pixdiam
		list1, list2 = apTiltTransform.alignPicks2(picks1, picks2, self.data, limit=pixdiam, msg=msg)
		if list1.shape[0] == 0 or list2.shape[0] == 0:
			apDisplay.printWarning("No new picks were found")

		# merge picks
		newpicks1, newpicks2 = apTiltTransform.betterMergePicks(curpicks1, list1, curpicks2, list2, msg=msg)
		newparts = newpicks1.shape[0] - curpicks1.shape[0]

		# copy over picks
		self.currentpicks1 = newpicks1
		self.currentpicks2 = newpicks2

		if msg is True:
			apDisplay.printMsg("Inserted "+str(newparts)+" new particles in "+apDisplay.timeString(time.time()-t0))

		return True
    def importPicks(self, picks1, picks2, tight=False, msg=True):
        t0 = time.time()
        #print picks1
        #print self.currentpicks1
        curpicks1 = numpy.asarray(self.currentpicks1)
        curpicks2 = numpy.asarray(self.currentpicks2)
        #print curpicks1

        # get picks
        apTiltTransform.setPointsFromArrays(curpicks1, curpicks2, self.data)
        pixdiam = self.data['pixdiam']
        if tight is True:
            pixdiam /= 4.0
        #print self.data, pixdiam
        list1, list2 = apTiltTransform.alignPicks2(picks1,
                                                   picks2,
                                                   self.data,
                                                   limit=pixdiam,
                                                   msg=msg)
        if list1.shape[0] == 0 or list2.shape[0] == 0:
            apDisplay.printWarning("No new picks were found")

        # merge picks
        newpicks1, newpicks2 = apTiltTransform.betterMergePicks(curpicks1,
                                                                list1,
                                                                curpicks2,
                                                                list2,
                                                                msg=msg)
        newparts = newpicks1.shape[0] - curpicks1.shape[0]

        # copy over picks
        self.currentpicks1 = newpicks1
        self.currentpicks2 = newpicks2

        if msg is True:
            apDisplay.printMsg("Inserted " + str(newparts) +
                               " new particles in " +
                               apDisplay.timeString(time.time() - t0))

        return True
	def getAlignedArray1(self):
		apTiltTransform.setPointsFromArrays(self.currentpicks1, self.currentpicks2, self.data)
		a1b = apTiltTransform.a1Toa2Data(self.currentpicks1, self.data)
		return a1b
	def getAlignedArray2(self):
		apTiltTransform.setPointsFromArrays(self.currentpicks1, self.currentpicks2, self.data)
		a2b = apTiltTransform.a2Toa1Data(self.currentpicks2, self.data)
		a2c = numpy.asarray(a2b, dtype=numpy.float32)
		return a2c
 def getAlignedArray1(self):
     apTiltTransform.setPointsFromArrays(self.currentpicks1,
                                         self.currentpicks2, self.data)
     a1b = apTiltTransform.a1Toa2Data(self.currentpicks1, self.data)
     return a1b
 def getAlignedArray2(self):
     apTiltTransform.setPointsFromArrays(self.currentpicks1,
                                         self.currentpicks2, self.data)
     a2b = apTiltTransform.a2Toa1Data(self.currentpicks2, self.data)
     a2c = numpy.asarray(a2b, dtype=numpy.float32)
     return a2c
Ejemplo n.º 7
0
 def getAlignedArray2(self):
     apTiltTransform.setPointsFromArrays(self.currentpicks1,
                                         self.currentpicks2, self.data)
     a2b = apTiltTransform.a2Toa1Data(self.currentpicks2, self.data)
     return a2b
	def getAlignedArray2(self):
		apTiltTransform.setPointsFromArrays(self.currentpicks1, self.currentpicks2, self.data)
		a2b = apTiltTransform.a2Toa1Data(self.currentpicks2, self.data)
		return a2b