def on_form_ok(self,params):	
		if  params.has_key("filenames") and len(params["filenames"]) == 0:
			self.run_select_files_msg()
			return
		
		error_message = self.check_params(params)
		if len(error_message) >0: 
			self.show_error_message(error_message)
			return
		
		if params["alt"] != 0 or params["az"] != 0 or params["phi"] != 0:
			params["rotate"] = "%.2f,%.2f,%.2f" %(params["az"],params["alt"],params["phi"])

		if params.has_key("rotate") or params.has_key("filter_processor"):
			success,cmd = self.process_all(params)
			if not success:
				error("Command failed:"+cmd)
				return
		else:
			error("You have to supply a filter or a non zero rotation for any filtering to occur")
			return
		
		self.emit(QtCore.SIGNAL("task_idle"))
		self.form.close()
		self.form = None
	
		self.write_db_entries(params)	
示例#2
0
    def on_form_ok(self, params):
        if params.has_key("filenames") and len(params["filenames"]) == 0:
            self.run_select_files_msg()
            return

        error_message = self.check_params(params)
        if len(error_message) > 0:
            self.show_error_message(error_message)
            return

        if params["alt"] != 0 or params["az"] != 0 or params["phi"] != 0:
            params["rotate"] = "%.2f,%.2f,%.2f" % (params["az"], params["alt"],
                                                   params["phi"])

        if params.has_key("rotate") or params.has_key("filter_processor"):
            success, cmd = self.process_all(params)
            if not success:
                error("Command failed:" + cmd)
                return
        else:
            error(
                "You have to supply a filter or a non zero rotation for any filtering to occur"
            )
            return

        self.emit(QtCore.SIGNAL("task_idle"))
        self.form.close()
        self.form = None

        self.write_db_entries(params)
示例#3
0
	def au_selected(self,refine_dir,cls):
		self.refine_dir = refine_dir
		get_application().setOverrideCursor(Qt.BusyCursor)
		data = []
		for d in self.au_data[refine_dir]:
			if d[0] == cls:
				data = d;
				break

		if len(data) == 0:
			error("error, no data for %s %s, returning" %(refine_dir,cls))
#			print "error, no data for",au,cls,"returning"
			self.events_handlers["inspect"].reset()
			get_application().setOverrideCursor(Qt.ArrowCursor)
			return
		
		if not self.readfrom:
			try :
				self.particle_file=js_open_dict(refine_dir+"/0_refine_parms.json")["input"]
			except:
				error("No data in "+refine_dir )
				self.events_handlers["inspect"].reset()
				get_application().setOverrideCursor(Qt.ArrowCursor)
				return

		self.average_file = cls
		self.projection_file = data[4]
		self.alignment_file = data[2]
		self.clsdb = data[1]

		self.dx = None
		self.dy = None
		self.da = None
		self.dflip = None
		self.classes = None

		eulers = get_eulers_from(self.average_file)
		#s = Symmetries.get("d7")
		#eulers = s.gen_orientations("rand",{"n":EMUtil.get_image_count(self.average_file)})

		self.specify_eulers(eulers)
		#from emimagemx import EMDataListCache
		#a = EMData.read_images(self.average_file)
		#a = [test_image() for i in range(EMUtil.get_image_count(self.average_file))]
		#print len(a),len(eulers)
		#b = [a[i].set_attr("xform.projection",eulers[i]) for i in range(len(eulers))]
		#b = [a[i].set_attr("ptcl_repr",1) for i in range(len(eulers))]

		self.set_emdata_list_as_data(EMLightWeightParticleCache.from_file(self.average_file),"ptcl_repr")
		#self.set_emdata_list_as_data(EMDataListCache(self.average_file),"ptcl_repr")
#		self.set_emdata_list_as_data(a,"ptcl_repr")
		self.force_update = True
		self.au_point_selected(self.class_idx,None)
		# if we have the same number of Eulers we can update everything
#		if self.previous_len == len(eulers) : self.events_handlers["inspect"].repeat_event()
#		else:self.events_handlers["inspect"].reset()
		self.previous_len = len(eulers)
		if not self.init_lock:self.updateGL()
		get_application().setOverrideCursor(Qt.ArrowCursor)
示例#4
0
	def au_selected(self,refine_dir,cls):
		self.refine_dir = refine_dir
		get_application().setOverrideCursor(Qt.BusyCursor)
		data = []
		for d in self.au_data[refine_dir]:
			if d[0] == cls:
				data = d;
				break

		if len(data) == 0:
			error("error, no data for %s %s, returning" %(refine_dir,cls))
#			print "error, no data for",au,cls,"returning"
			self.events_handlers["inspect"].reset()
			get_application().setOverrideCursor(Qt.ArrowCursor)
			return
		
		if not self.readfrom:
			try :
				self.particle_file=js_open_dict(refine_dir+"/0_refine_parms.json")["input"]
			except:
				error("No data in "+refine_dir )
				self.events_handlers["inspect"].reset()
				get_application().setOverrideCursor(Qt.ArrowCursor)
				return

		self.average_file = cls
		self.projection_file = data[4]
		self.alignment_file = data[2]
		self.clsdb = data[1]

		self.dx = None
		self.dy = None
		self.da = None
		self.dflip = None
		self.classes = None

		eulers = get_eulers_from(self.average_file)
		#s = Symmetries.get("d7")
		#eulers = s.gen_orientations("rand",{"n":EMUtil.get_image_count(self.average_file)})

		self.specify_eulers(eulers)
		#from emimagemx import EMDataListCache
		#a = EMData.read_images(self.average_file)
		#a = [test_image() for i in range(EMUtil.get_image_count(self.average_file))]
		#print len(a),len(eulers)
		#b = [a[i].set_attr("xform.projection",eulers[i]) for i in range(len(eulers))]
		#b = [a[i].set_attr("ptcl_repr",1) for i in range(len(eulers))]

		self.set_emdata_list_as_data(EMLightWeightParticleCache.from_file(self.average_file),"ptcl_repr")
		#self.set_emdata_list_as_data(EMDataListCache(self.average_file),"ptcl_repr")
#		self.set_emdata_list_as_data(a,"ptcl_repr")
		self.force_update = True
		self.au_point_selected(self.class_idx,None)
		# if we have the same number of Eulers we can update everything
#		if self.previous_len == len(eulers) : self.events_handlers["inspect"].repeat_event()
#		else:self.events_handlers["inspect"].reset()
		self.previous_len = len(eulers)
		if not self.init_lock:self.updateGL()
		get_application().setOverrideCursor(Qt.ArrowCursor)
	def on_form_ok(self,params):
		if not params.has_key("tomo_filt_choice") or params["tomo_filt_choice"] == None:
			error("Please choose some data")
			return
		choice = params["tomo_filt_choice"]
		task = EMTomoBootstrapTask(self.particles_map[self.particles_name_map[choice]],self.name_map)
		self.emit(QtCore.SIGNAL("replace_task"),task,"Filter Tomo Particles")
		self.form.close()
		self.form = None
		
		self.write_db_entries(params)
示例#6
0
	def on_form_ok(self,params):
		if "tomo_filt_choice" not in params or params["tomo_filt_choice"] == None:
			error("Please choose some data")
			return
		choice = params["tomo_filt_choice"]
		task = EMTomoBootstrapTask(self.particles_map[self.particles_name_map[choice]],self.name_map)
		self.emit(QtCore.SIGNAL("replace_task"),task,"Filter Tomo Particles")
		self.form.close()
		self.form = None
		
		self.write_db_entries(params)
示例#7
0
    def on_form_ok(self, params):
        if not params.has_key(
                "tomo_filt_choice") or params["tomo_filt_choice"] == None:
            error("Please choose some data")
            return
        choice = params["tomo_filt_choice"]

        task = self.task_type(
            self.particles_map[self.particles_name_map[choice]], self.name_map)
        self.emit(QtCore.SIGNAL("replace_task"), task, "Filter Tomo Particles")
        self.form.close()
        self.form = None

        self.write_db_entries(params)