def addInput(self, dataunit, data): """ Adds an input for the color merging filter """ settings = dataunit.getSettings() if not settings.get("PreviewChannel"): Logging.info("Not including ", dataunit, "in merging", kw="processing") return Module.addInput(self, dataunit, data) self.n += 1 ctf = settings.get("ColorTransferFunction") # Logging.info("ctf=",ctf,kw="processing") self.ctfs.append(ctf) self.alphaTF = settings.get("AlphaTransferFunction") self.alphaMode = settings.get("AlphaMode") #print "n=",self.n,"self.settings=",self.settings #itf=self.settings.getCounted("IntensityTransferFunction",self.n) itf = settings.get("IntensityTransferFunction") if not itf: Logging.info("Didn't get iTF", kw="processing") self.intensityTransferFunctions.append(itf)
def addInput(self, dataunit, data): """ Adds an input for the color merging filter """ settings = dataunit.getSettings() if not settings.get("PreviewChannel"): Logging.info("Not including ", dataunit, "in merging", kw="processing") return Module.addInput(self, dataunit, data) self.n += 1 ctf = settings.get("ColorTransferFunction") # Logging.info("ctf=",ctf,kw="processing") self.ctfs.append(ctf) self.alphaTF = settings.get("AlphaTransferFunction") self.alphaMode = settings.get("AlphaMode") # print "n=",self.n,"self.settings=",self.settings # itf=self.settings.getCounted("IntensityTransferFunction",self.n) itf = settings.get("IntensityTransferFunction") if not itf: Logging.info("Didn't get iTF", kw="processing") self.intensityTransferFunctions.append(itf)
def __init__(self, **kws): """ Initialization """ Module.__init__(self, **kws) self.running = 0 self.depth = 8 self.reset()
def addInput(self, dataunit, data): """ Adds an input for the single dataunit processing filter """ Module.addInput(self, dataunit, data) settings = dataunit.getSettings() tf = settings.getCounted("IntensityTransferFunctions", self.timepoint) if not tf: raise ("No Intensity Transfer Function given for Single DataUnit " "to be processed") self.intensityTransferFunctions.append(tf)
def reset(self): """ Resets the module to initial state. This method is used mainly when doing previews, when the parameters that control the colocalization are changed and the preview data becomes invalid. """ Module.reset(self) self.preview = None self.intensityTransferFunctions = [] self.extent = None
def addInput(self, dataunit, data): """ Adds an input for the colocalization filter """ Module.addInput(self, dataunit, data) settings = dataunit.getSettings() self.settingsLst.append(settings) th0 = settings.get("ColocalizationLowerThreshold") th1 = settings.get("ColocalizationUpperThreshold") self.thresholds.append((th0, th1)) self.depth = self.settings.get("ColocalizationDepth")
def __init__(self, **kws): """ Initialization """ Module.__init__(self, **kws) self.doAlpha = 1 self.extent = [] self.thresholds = [] self.merge = None self.running = False self.reset()
def __init__(self, **kws): """ Initialization """ Module.__init__(self, **kws) # TODO: remove attributes that already exist in base class! self.images = [] self.x, self.y, self.z = 0, 0, 0 self.extent = None self.running = 0 self.depth = 8 self.reset()
def add_module(course_name, module_short_title): """ Link a course and a module """ from lib.CourseModule import CourseModule course_ref = Course.get_by_key_name(course_name) module_ref = Module.get_by_key_name(module_short_title) new_course_module = CourseModule(course=course_ref, module=module_ref) new_course_module.put()
def reset(self): """ Resets the module to initial state. This method is used mainly when doing previews, when the parameters that control the colocalization are changed and the preview data becomes invalid. """ Module.reset(self) self.colocFilter = vtkbxd.vtkImageColocalizationFilter() self.colocFilter.AddObserver('ProgressEvent', lib.messenger.send) lib.messenger.connect(self.colocFilter, "ProgressEvent", self.updateProgress) self.colocAutoThreshold = vtkbxd.vtkImageAutoThresholdColocalization() self.colocAutoThreshold.GetOutput().ReleaseDataFlagOn() self.colocAutoThreshold.AddObserver('ProgressEvent', lib.messenger.send) lib.messenger.connect(self.colocAutoThreshold, "ProgressEvent", self.updateProgress) self.thresholds = [] self.settingsLst = [] self.preview = None self.n = -1
def remove_module(course_name, module_short_title): """ Remove a module from a course """ course_ref = Course.get_by_key_name(course_name) module_ref = Module.get_by_key_name(module_short_title) course_module_ref = db.GqlQuery("SELECT * FROM CourseModule WHERE " +\ "course = :1 AND " +\ "module = :2", course_ref, module_ref) db.delete(course_module_ref)
def list_modules(course_name): """ List all modules associated with a course """ from lib.CourseModule import CourseModule modules = [] course_ref = Course.get_by_key_name(course_name) course_module_ref = db.GqlQuery("SELECT * FROM CourseModule WHERE " +\ "course = :1", course_ref) for module_ref in course_module_ref.run(): module_key = CourseModule.module.get_value_for_datastore(module_ref) module_res = Module.get(module_key) modules.append(module_res) return modules
def list_modules(course_name): """ List all modules associated with a course """ from lib.CourseModule import CourseModule modules = [] course_ref = Course.get_by_key_name(course_name) course_module_ref = db.GqlQuery("SELECT * FROM CourseModule WHERE " +\ "course = :1", course_ref) for module_ref in course_module_ref.run(): module_key = CourseModule.module.get_value_for_datastore( module_ref) module_res = Module.get(module_key) modules.append(module_res) return modules