コード例 #1
0
	def readImage(self, filename):
		imagedata = None
		if filename:
			imagedata = self.getImageFromDB(filename)
		if imagedata is None:
			if filename == '':
				if self.name in ['Hole Targeting','Subsquare Targeting']:
					filename = os.path.join(version.getInstalledLocation(),'sq_example.jpg')
				elif self.name in ['Square Targeting']:
					filename = os.path.join(version.getInstalledLocation(),'gr_example.jpg')
				else:
					filename = os.path.join(version.getInstalledLocation(),'hl_example.jpg')
			try:
				orig = mrc.read(filename)
			except Exception, e:
				try:
					orig = numpil.read(filename)
				except:
					self.logger.exception('Read image failed: %s' % e[-1])
					return
			self.currentimagedata = {'image':orig} 
コード例 #2
0
 def readImage(self, filename):
         imagedata = None
         if filename:
                 imagedata = self.getImageFromDB(filename)
         if imagedata is None:
                 if filename == '':
                         if self.name in ['Hole Targeting','Subsquare Targeting']:
                                 filename = os.path.join(version.getInstalledLocation(),'sq_example.jpg')
                         elif self.name in ['Square Targeting']:
                                 filename = os.path.join(version.getInstalledLocation(),'gr_example.jpg')
                         else:
                                 filename = os.path.join(version.getInstalledLocation(),'hl_example.jpg')
                 try:
                         orig = mrc.read(filename)
                 except Exception, e:
                         try:
                                 orig = numpil.read(filename)
                         except:
                                 self.logger.exception('Read image failed: %s' % e[-1])
                                 return
                 self.currentimagedata = {'image':orig} 
コード例 #3
0
from optparse import OptionParser
import sys

parser = OptionParser()

parser.add_option('-v', '--version', action='store_true', dest='version',
                  help="get version information")
parser.add_option('-s', '--session', action='store', dest='session',
                  help="name of existing session to continue")
parser.add_option('-c', '--clients', action='store', dest='clients',
                  help="comma separated list of clients")
parser.add_option('-p', '--prevapp', action='store_true', dest='prevapp',
                  help="restart previous application")

(options, args) = parser.parse_args()

if options.version:
        import version
        print 'Leginon version: %s' % (version.getVersion(),)
        print '   Installed in: %s' % (version.getInstalledLocation(),)
        sys.exit()

コード例 #4
0
#       For terms of the license agreement
#       see  http://ami.scripps.edu/software/leginon-license
#

from leginon import leginondata
import targetfinder
from pyami import ordereddict
import threading
import os.path
import math
import gui.wx.NewTargetFinder
import version
import targetingsteps

invsqrt2 = math.sqrt(2.0)/2.0
default_template = os.path.join(version.getInstalledLocation(),'holetemplate.mrc')

newworkflow = targetingsteps.templatefinder
newsettingsclass = targetingsteps.makeSettingsClass('NewTargetFinderSettingsData', newworkflow)
newdefaultsettings = targetingsteps.makeDefaultSettings(newworkflow)

class NewTargetFinder(targetfinder.TargetFinder):
	panelclass = gui.wx.NewTargetFinder.Panel
	settingsclass = newsettingsclass
	defaultsettings = dict(targetfinder.TargetFinder.defaultsettings)
	defaultsettings.update(newdefaultsettings)
	#targetnames = targetfinder.TargetFinder.targetnames + ['Blobs']
	workflow = newworkflow
	def __init__(self, id, session, managerlocation, **kwargs):
		targetfinder.TargetFinder.__init__(self, id, session, managerlocation, **kwargs)
import threading
import time
import manualacquisition
import gui.wx.ManualImageLoader
import player
import instrument
import os
import re
import calibrationclient
import copy
from pyami import arraystats, imagefun, mrc
import numpy
import version
import cameraclient

default_batch = os.path.join(version.getInstalledLocation(),'upload_example.txt')
class AcquireError(Exception):
        pass

class ManualImageLoader(manualacquisition.ManualAcquisition):
        panelclass = gui.wx.ManualImageLoader.Panel
        settingsclass = leginondata.ManualImageLoaderSettingsData
        eventoutputs = node.Node.eventoutputs + [event.AcquisitionImagePublishEvent]
        defaultsettings = {
                'instruments': {'tem': None, 'ccdcamera': None},
                'save image': False,
                'batch script': default_batch,
                'tilt group': 1,
                'camera settings': cameraclient.default_settings,
        }
コード例 #6
0
#       For terms of the license agreement
#       see  http://ami.scripps.edu/software/leginon-license
#

from leginon import leginondata
import targetfinder
from pyami import ordereddict
import threading
import os.path
import math
import gui.wx.NewTargetFinder
import version
import targetingsteps

invsqrt2 = math.sqrt(2.0) / 2.0
default_template = os.path.join(version.getInstalledLocation(),
                                'holetemplate.mrc')

newworkflow = targetingsteps.templatefinder
newsettingsclass = targetingsteps.makeSettingsClass(
    'NewTargetFinderSettingsData', newworkflow)
newdefaultsettings = targetingsteps.makeDefaultSettings(newworkflow)


class NewTargetFinder(targetfinder.TargetFinder):
    panelclass = gui.wx.NewTargetFinder.Panel
    settingsclass = newsettingsclass
    defaultsettings = dict(targetfinder.TargetFinder.defaultsettings)
    defaultsettings.update(newdefaultsettings)
    #targetnames = targetfinder.TargetFinder.targetnames + ['Blobs']
    workflow = newworkflow
コード例 #7
0
import threading
import time
import manualacquisition
import gui.wx.ManualImageLoader
import player
import instrument
import os
import re
import calibrationclient
import copy
from pyami import arraystats, imagefun, mrc
import numpy
import version
import cameraclient

default_batch = os.path.join(version.getInstalledLocation(),
                             'upload_example.txt')


class AcquireError(Exception):
    pass


class ManualImageLoader(manualacquisition.ManualAcquisition):
    panelclass = gui.wx.ManualImageLoader.Panel
    settingsclass = leginondata.ManualImageLoaderSettingsData
    eventoutputs = node.Node.eventoutputs + [
        event.AcquisitionImagePublishEvent
    ]
    defaultsettings = {
        'instruments': {
コード例 #8
0
parser = OptionParser()

parser.add_option('-v',
                  '--version',
                  action='store_true',
                  dest='version',
                  help="get version information")
parser.add_option('-s',
                  '--session',
                  action='store',
                  dest='session',
                  help="name of existing session to continue")
parser.add_option('-c',
                  '--clients',
                  action='store',
                  dest='clients',
                  help="comma separated list of clients")
parser.add_option('-p',
                  '--prevapp',
                  action='store_true',
                  dest='prevapp',
                  help="restart previous application")

(options, args) = parser.parse_args()

if options.version:
    import version
    print 'Leginon version: %s' % (version.getVersion(), )
    print '   Installed in: %s' % (version.getInstalledLocation(), )
    sys.exit()