本文整理汇总了Python中valslider.ValSlider类的典型用法代码示例。如果您正苦于以下问题:Python ValSlider类的具体用法?Python ValSlider怎么用?Python ValSlider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ValSlider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get_texture_tab
def get_texture_tab(self):
if ( self.texturetab == None ):
self.texturetab = QtGui.QWidget()
texturetab = self.texturetab
texturetab.vbl = QtGui.QVBoxLayout(self.texturetab)
texturetab.vbl.setMargin(0)
texturetab.vbl.setSpacing(6)
texturetab.vbl.setObjectName("Main")
self.contrast = ValSlider(texturetab,(0.0,20.0),"Cont:")
self.contrast.setObjectName("contrast")
self.contrast.setValue(10.0)
texturetab.vbl.addWidget(self.contrast)
self.bright = ValSlider(texturetab,(-5.0,5.0),"Brt:")
self.bright.setObjectName("bright")
self.bright.setValue(0.1)
self.bright.setValue(0.0)
texturetab.vbl.addWidget(self.bright)
#self.glcontrast = ValSlider(texturetab,(1.0,5.0),"GLShd:")
#self.glcontrast.setObjectName("GLShade")
#self.glcontrast.setValue(1.0)
#texturetab.vbl.addWidget(self.glcontrast)
#self.glbrightness = ValSlider(texturetab,(-1.0,0.0),"GLBst:")
#self.glbrightness.setObjectName("GLBoost")
#self.glbrightness.setValue(0.1)
#self.glbrightness.setValue(0.0)
#texturetab.vbl.addWidget(self.glbrightness)
return self.texturetab
开发者ID:cpsemmens,项目名称:eman2,代码行数:32,代码来源:emimage3diso.py
示例2: get_GL_tab
def get_GL_tab(self):
self.gltab = QtGui.QWidget()
gltab = self.gltab
gltab.vbl = QtGui.QVBoxLayout(self.gltab )
gltab.vbl.setMargin(0)
gltab.vbl.setSpacing(6)
gltab.vbl.setObjectName("Main")
self.hbl_color = QtGui.QHBoxLayout()
self.hbl_color.setMargin(0)
self.hbl_color.setSpacing(6)
gltab.vbl.addLayout(self.hbl_color)
self.color_label = QtGui.QLabel()
self.color_label.setText('Material')
self.hbl_color.addWidget(self.color_label)
self.cbb = QtGui.QComboBox(gltab)
self.hbl_color.addWidget(self.cbb)
self.glcontrast = ValSlider(gltab,(1.0,5.0),"GLShd:")
self.glcontrast.setObjectName("GLShade")
self.glcontrast.setValue(1.0)
gltab.vbl.addWidget(self.glcontrast)
self.glbrightness = ValSlider(gltab,(-1.0,0.0),"GLBst:")
self.glbrightness.setObjectName("GLBoost")
self.glbrightness.setValue(0.1)
self.glbrightness.setValue(0.0)
gltab.vbl.addWidget(self.glbrightness)
return gltab
开发者ID:CVL-dev,项目名称:StructuralBiology,代码行数:33,代码来源:emlights.py
示例3: get_GL_tab
def get_GL_tab(self):
self.gltab = QtGui.QWidget()
gltab = self.gltab
gltab.vbl = QtGui.QVBoxLayout(self.gltab )
gltab.vbl.setMargin(0)
gltab.vbl.setSpacing(6)
gltab.vbl.setObjectName("GL")
self.glcontrast = ValSlider(gltab,(1.0,5.0),"GLShd:")
self.glcontrast.setObjectName("GLShade")
self.glcontrast.setValue(1.0)
gltab.vbl.addWidget(self.glcontrast)
self.glbrightness = ValSlider(gltab,(-1.0,0.0),"GLBst:")
self.glbrightness.setObjectName("GLBoost")
self.glbrightness.setValue(0.1)
self.glbrightness.setValue(0.0)
gltab.vbl.addWidget(self.glbrightness)
self.material_tab_widget = QtGui.QTabWidget()
self.ambient_tab = self.get_RGB_tab("ambient")
self.material_tab_widget.addTab(self.ambient_tab, "Ambient")
self.diffuse_tab = self.get_RGB_tab("diffuse")
self.material_tab_widget.addTab(self.diffuse_tab, "Diffuse")
self.specular_tab = self.get_RGB_tab("specular")
self.material_tab_widget.addTab(self.specular_tab, "Specular")
self.emission_tab = self.get_RGB_tab("emission")
self.material_tab_widget.addTab(self.emission_tab, "Emission")
gltab.vbl.addWidget(self.material_tab_widget)
self.shininess = ValSlider(gltab,(0,128),"Shininess:")
self.shininess.setObjectName("Shininess")
self.shininess.setValue(64)
gltab.vbl.addWidget(self.shininess)
self.hbl_color = QtGui.QHBoxLayout()
self.hbl_color.setMargin(0)
self.hbl_color.setSpacing(6)
self.hbl_color.setObjectName("Material")
gltab.vbl.addLayout(self.hbl_color)
self.color_label = QtGui.QLabel()
self.color_label.setText('Material')
self.hbl_color.addWidget(self.color_label)
self.cbb = QtGui.QComboBox(gltab)
self.hbl_color.addWidget(self.cbb)
return gltab
开发者ID:cpsemmens,项目名称:eman2,代码行数:55,代码来源:emimage3diso.py
示例4: get_main_tab
def get_main_tab(self):
self.maintab = QtGui.QWidget()
maintab = self.maintab
maintab.vbl = QtGui.QVBoxLayout(self.maintab)
maintab.vbl.setMargin(0)
maintab.vbl.setSpacing(6)
maintab.vbl.setObjectName("Main")
self.hbl_slice = QtGui.QHBoxLayout()
self.hbl_slice.setMargin(0)
self.hbl_slice.setSpacing(6)
self.hbl_slice.setObjectName("Axis")
maintab.vbl.addLayout(self.hbl_slice)
self.slice = ValSlider(maintab,(0.0,10.0),"Slice:")
self.slice.setObjectName("slice")
self.slice.setValue(1.0)
self.hbl_slice.addWidget(self.slice)
self.axisCombo = QtGui.QComboBox(maintab)
self.axisCombo.addItem(' z ')
self.axisCombo.addItem(' y ')
self.axisCombo.addItem(' x ')
self.axisCombo.addItem(' track ')
self.hbl_slice.addWidget(self.axisCombo)
self.contrast = ValSlider(maintab,(0.0,20.0),"Cont:")
self.contrast.setObjectName("contrast")
self.contrast.setValue(1.0)
maintab.vbl.addWidget(self.contrast)
self.bright = ValSlider(maintab,(-5.0,5.0),"Brt:")
self.bright.setObjectName("bright")
self.bright.setValue(0.1)
self.bright.setValue(0.0)
maintab.vbl.addWidget(self.bright)
self.glcontrast = ValSlider(maintab,(1.0,5.0),"GLShd:")
self.glcontrast.setObjectName("GLShade")
self.glcontrast.setValue(1.0)
maintab.vbl.addWidget(self.glcontrast)
self.glbrightness = ValSlider(maintab,(-1.0,0.0),"GLBst:")
self.glbrightness.setObjectName("GLBoost")
self.glbrightness.setValue(0.1)
self.glbrightness.setValue(0.0)
maintab.vbl.addWidget(self.glbrightness)
self.transform_panel.addWidgets(maintab.vbl)
return maintab
开发者ID:cpsemmens,项目名称:eman2,代码行数:53,代码来源:emimage3dslice.py
示例5: __init__
def __init__(self,target) :
QtGui.QWidget.__init__(self,None)
self.target=target
self.vboxlayout = QtGui.QVBoxLayout(self)
self.vboxlayout.setMargin(0)
self.vboxlayout.setSpacing(6)
self.vboxlayout.setObjectName("vboxlayout")
self.hist = ImgHistogram(self)
self.hist.setObjectName("hist")
self.vboxlayout.addWidget(self.hist)
self.scale = ValSlider(self,(0.1,5.0),"Mag:")
self.scale.setObjectName("scale")
self.scale.setValue(1.0)
self.vboxlayout.addWidget(self.scale)
self.mins = ValSlider(self,label="Min:")
self.mins.setObjectName("mins")
self.vboxlayout.addWidget(self.mins)
self.combo = QtGui.QComboBox(self)
for i in range(0,10):
self.combo.addItem(str(i))
self.vboxlayout.addWidget(self.combo)
self.maxs = ValSlider(self,label="Max:")
self.maxs.setObjectName("maxs")
self.vboxlayout.addWidget(self.maxs)
self.brts = ValSlider(self,(-1.0,1.0),"Brt:")
self.brts.setObjectName("brts")
self.vboxlayout.addWidget(self.brts)
self.conts = ValSlider(self,(0.0,1.0),"Cont:")
self.conts.setObjectName("conts")
self.vboxlayout.addWidget(self.conts)
self.lowlim=0
self.highlim=1.0
self.busy=0
QtCore.QObject.connect(self.scale, QtCore.SIGNAL("valueChanged"), target.set_scale)
QtCore.QObject.connect(self.mins, QtCore.SIGNAL("valueChanged"), self.newMin)
QtCore.QObject.connect(self.maxs, QtCore.SIGNAL("valueChanged"), self.newMax)
QtCore.QObject.connect(self.brts, QtCore.SIGNAL("valueChanged"), self.newBrt)
QtCore.QObject.connect(self.conts, QtCore.SIGNAL("valueChanged"), self.newCont)
QtCore.QObject.connect(self.combo, QtCore.SIGNAL("currentIndexChanged(QString)"), self.setCombo)
开发者ID:CVL-dev,项目名称:StructuralBiology,代码行数:50,代码来源:emfximage.py
示例6: __init__
class ErasingPanel: # copied for ideas for the morph panel
def __init__(self,target,erase_radius=128):
self.busy = True
self.erase_radius = erase_radius
self.target = weakref.ref(target)
self.erase_rad_edit = None
self.widget = None
self.busy = False
def set_erase_radius(self, erase_rad_edit):
self.busy=True
self.erase_radius = erase_rad_edit
if self.erase_rad_edit != None: self.erase_rad_edit.setValue(erase_rad_edit)
self.busy=False
def get_widget(self):
if self.widget == None:
from PyQt4 import QtCore, QtGui, Qt
self.widget = QtGui.QWidget()
vbl = QtGui.QVBoxLayout(self.widget)
vbl.setMargin(0)
vbl.setSpacing(6)
vbl.setObjectName("vbl")
hbl = QtGui.QHBoxLayout()
hbl.addWidget(QtGui.QLabel("Erase Radius:"))
from valslider import ValSlider
self.erase_rad_edit = ValSlider(None,(0.0,1000.0),"")
self.erase_rad_edit.setValue(int(self.erase_radius))
self.erase_rad_edit.setEnabled(True)
hbl.addWidget(self.erase_rad_edit)
self.unerase = QtGui.QCheckBox("Unerase")
self.unerase.setChecked(False)
vbl.addLayout(hbl)
vbl.addWidget(self.unerase)
QtCore.QObject.connect(self.erase_rad_edit,QtCore.SIGNAL("sliderReleased"),self.new_erase_radius)
QtCore.QObject.connect(self.unerase,QtCore.SIGNAL("clicked(bool)"),self.unerase_checked)
return self.widget
def new_erase_radius(self, erase_rad_edit):
if self.busy: return
self.target().set_erase_radius(erase_rad_edit)
def unerase_checked(self,val):
if self.busy: return
self.target().toggle_unerase(val)
开发者ID:cpsemmens,项目名称:eman2,代码行数:50,代码来源:morphboxer.py
示例7: get_widget
def get_widget(self):
if self.widget == None:
from PyQt4 import QtCore, QtGui, Qt
self.widget = QtGui.QWidget()
vbl = QtGui.QVBoxLayout(self.widget)
vbl.setMargin(0)
vbl.setSpacing(6)
vbl.setObjectName("vbl")
hbl = QtGui.QHBoxLayout()
hbl.addWidget(QtGui.QLabel("Erase Radius:"))
from valslider import ValSlider
self.erase_rad_edit = ValSlider(None,(0.0,1000.0),"")
self.erase_rad_edit.setValue(int(self.erase_radius))
self.erase_rad_edit.setEnabled(True)
hbl.addWidget(self.erase_rad_edit)
self.unerase = QtGui.QCheckBox("Unerase")
self.unerase.setChecked(False)
vbl.addLayout(hbl)
vbl.addWidget(self.unerase)
QtCore.QObject.connect(self.erase_rad_edit,QtCore.SIGNAL("sliderReleased"),self.new_erase_radius)
QtCore.QObject.connect(self.unerase,QtCore.SIGNAL("clicked(bool)"),self.unerase_checked)
return self.widget
开发者ID:cpsemmens,项目名称:eman2,代码行数:26,代码来源:morphboxer.py
示例8: get_main_tab
def get_main_tab(self):
if ( self.maintab == None ):
self.maintab = QtGui.QWidget()
maintab = self.maintab
maintab.vbl = QtGui.QVBoxLayout(self.maintab)
maintab.vbl.setMargin(0)
maintab.vbl.setSpacing(6)
maintab.vbl.setObjectName("Main")
self.thr = ValSlider(maintab,(0.0,4.0),"Thr:")
self.thr.setObjectName("thr")
self.thr.setValue(0.5)
maintab.vbl.addWidget(self.thr)
self.hbl_smp = QtGui.QHBoxLayout()
self.hbl_smp.setMargin(0)
self.hbl_smp.setSpacing(6)
self.hbl_smp.setObjectName("Sample")
maintab.vbl.addLayout(self.hbl_smp)
self.smp_label = QtGui.QLabel()
self.smp_label.setText('Sample Level')
self.hbl_smp.addWidget(self.smp_label)
self.smp = QtGui.QSpinBox(maintab)
self.smp.setValue(1)
self.hbl_smp.addWidget(self.smp)
self.rotation_sliders.addWidgets(maintab.vbl)
return self.maintab
开发者ID:cpsemmens,项目名称:eman2,代码行数:31,代码来源:emimage3diso.py
示例9: addControls
def addControls(self, gridbox):
""" Construct all the widgets in this Item Inspector """
super(EMInspectorControlShape, self).addControls(gridbox)
colorframe = QtGui.QFrame()
colorframe.setFrameShape(QtGui.QFrame.StyledPanel)
colorvbox = QtGui.QVBoxLayout()
lfont = QtGui.QFont()
lfont.setBold(True)
colorlabel = QtGui.QLabel("Color",colorframe)
colorlabel.setFont(lfont)
colorlabel.setAlignment(QtCore.Qt.AlignCenter)
# These boxes are a pain maybe I should use a Grid?
cdialoghbox = QtGui.QHBoxLayout()
cabox = QtGui.QHBoxLayout()
self.ambcolorbox = EMQTColorWidget(parent=colorframe)
cabox.addWidget(self.ambcolorbox)
cabox.setAlignment(QtCore.Qt.AlignCenter)
cdbox = QtGui.QHBoxLayout()
self.diffusecolorbox = EMQTColorWidget(parent=colorframe)
cdbox.addWidget(self.diffusecolorbox)
cdbox.setAlignment(QtCore.Qt.AlignCenter)
csbox = QtGui.QHBoxLayout()
self.specularcolorbox = EMQTColorWidget(parent=colorframe)
csbox.addWidget(self.specularcolorbox)
csbox.setAlignment(QtCore.Qt.AlignCenter)
cdialoghbox.addLayout(cabox)
cdialoghbox.addLayout(cdbox)
cdialoghbox.addLayout(csbox)
colorhbox = QtGui.QHBoxLayout()
self.ambient = QtGui.QLabel("Ambient", colorframe)
self.ambient.setAlignment(QtCore.Qt.AlignCenter)
self.diffuse = QtGui.QLabel("Diffuse", colorframe)
self.diffuse.setAlignment(QtCore.Qt.AlignCenter)
self.specular = QtGui.QLabel("Specular", colorframe)
self.specular.setAlignment(QtCore.Qt.AlignCenter)
colorhbox.addWidget(self.ambient)
colorhbox.addWidget(self.diffuse)
colorhbox.addWidget(self.specular)
self.shininess = ValSlider(colorframe, (0.0, 50.0), "Shine")
self.shininess.setValue(self.item3d().shininess)
colorvbox.addWidget(colorlabel)
colorvbox.addLayout(cdialoghbox)
colorvbox.addLayout(colorhbox)
colorvbox.addWidget(self.shininess)
colorframe.setLayout(colorvbox)
colorframe.setMaximumWidth(350)
gridbox.addWidget(colorframe, 3, 0, 1, 1)
# Set to default, but do not run if being inherited
if type(self) == EMInspectorControlShape: self.updateItemControls()
QtCore.QObject.connect(self.ambcolorbox,QtCore.SIGNAL("newcolor(QColor)"),self._on_ambient_color)
QtCore.QObject.connect(self.diffusecolorbox,QtCore.SIGNAL("newcolor(QColor)"),self._on_diffuse_color)
QtCore.QObject.connect(self.specularcolorbox,QtCore.SIGNAL("newcolor(QColor)"),self._on_specular_color)
QtCore.QObject.connect(self.shininess,QtCore.SIGNAL("valueChanged"),self._on_shininess)
开发者ID:CVL-dev,项目名称:StructuralBiology,代码行数:59,代码来源:emshapeitem3d.py
示例10: get_main_tab
def get_main_tab(self):
self.maintab = QtGui.QWidget()
maintab = self.maintab
maintab.vbl = QtGui.QVBoxLayout(self.maintab)
maintab.vbl.setMargin(0)
maintab.vbl.setSpacing(6)
maintab.vbl.setObjectName("Main")
self.contrast = ValSlider(maintab,(0.0,20.0),"Cont:")
self.contrast.setObjectName("contrast")
self.contrast.setValue(1.0)
maintab.vbl.addWidget(self.contrast)
self.bright = ValSlider(maintab,(-5.0,5.0),"Brt:")
self.bright.setObjectName("bright")
self.bright.setValue(0.1)
self.bright.setValue(0.0)
maintab.vbl.addWidget(self.bright)
self.hbl_smp = QtGui.QHBoxLayout()
self.hbl_smp.setMargin(0)
self.hbl_smp.setSpacing(6)
self.hbl_smp.setObjectName("Texture Oversampling")
maintab.vbl.addLayout(self.hbl_smp)
self.smp_label = QtGui.QLabel()
self.smp_label.setText('Texture Oversampling')
self.hbl_smp.addWidget(self.smp_label)
self.smp = QtGui.QSpinBox(maintab)
self.smp.setMaximum(10)
self.smp.setMinimum(1)
self.smp.setValue(1)
self.hbl_smp.addWidget(self.smp)
self.lowlim=0
self.highlim=1.0
self.busy=0
self.rotation_sliders.addWidgets(maintab.vbl)
return maintab
开发者ID:cpsemmens,项目名称:eman2,代码行数:43,代码来源:emimage3dvol.py
示例11: get_GL_tab
def get_GL_tab(self):
self.gltab = QtGui.QWidget()
gltab = self.gltab
gltab.vbl = QtGui.QVBoxLayout(self.gltab )
gltab.vbl.setMargin(0)
gltab.vbl.setSpacing(6)
gltab.vbl.setObjectName("Main")
self.glcontrast = ValSlider(gltab,(1.0,5.0),"GLShd:")
self.glcontrast.setObjectName("GLShade")
self.glcontrast.setValue(1.0)
gltab.vbl.addWidget(self.glcontrast)
self.glbrightness = ValSlider(gltab,(-1.0,0.0),"GLBst:")
self.glbrightness.setObjectName("GLBoost")
self.glbrightness.setValue(0.1)
self.glbrightness.setValue(0.0)
gltab.vbl.addWidget(self.glbrightness)
return gltab
开发者ID:CVL-dev,项目名称:StructuralBiology,代码行数:21,代码来源:emglplot.py
示例12: get_bgRGB_tab
def get_bgRGB_tab(self):
self.bgRGBtab = QtGui.QWidget()
bgRGBtab = self.bgRGBtab
bgRGBtab.vbl2 = QtGui.QVBoxLayout(self.bgRGBtab)
bgRGBtab.vbl2.setMargin(0)
bgRGBtab.vbl2.setSpacing(6)
bgRGBtab.vbl2.setObjectName("BG RGB")
self.hbl2 = QtGui.QHBoxLayout()
self.bgR = ValSlider(self,(0,1),"R:")
self.bgR.setObjectName("R")
self.bgR.setValue(0.5)
self.hbl2.addWidget(self.bgR)
bgRGBtab.vbl2.addLayout(self.hbl2)
self.hbl2 = QtGui.QHBoxLayout()
self.bgG = ValSlider(self,(0,1),"G:")
self.bgG.setObjectName("G")
self.bgG.setValue(0.5)
self.hbl2.addWidget(self.bgG)
bgRGBtab.vbl2.addLayout(self.hbl2)
self.hbl2 = QtGui.QHBoxLayout()
self.bgB = ValSlider(self,(0,1),"B:")
self.bgB.setObjectName("B")
self.bgB.setValue(0.5)
self.hbl2.addWidget(self.bgB)
bgRGBtab.vbl2.addLayout(self.hbl2)
self.hbl2 = QtGui.QHBoxLayout()
self.bg_a = ValSlider(self,(0,1),"Alpha:")
self.bg_a.setObjectName("Alpha")
self.bg_a.setValue(1.0)
self.hbl2.addWidget(self.bg_a)
bgRGBtab.vbl2.addLayout(self.hbl2)
return bgRGBtab
开发者ID:CVL-dev,项目名称:StructuralBiology,代码行数:37,代码来源:em3Dfonts.py
示例13: set_src
def set_src(self, val):
t3d = self.get_current_rotation()
if (self.n3_showing) :
self.parent().get_transform_layout().removeWidget(self.n3)
self.n3.deleteLater()
self.n3_showing = False
self.az.setRange(-360,360)
self.alt.setRange(-180,180)
self.phi.setRange(-360,660)
if ( self.src_map[str(val)] == "spider" ):
self.az.setLabel('phi')
self.alt.setLabel('theta')
self.phi.setLabel('psi')
elif ( self.src_map[str(val)] == "eman" ):
self.az.setLabel('az')
self.alt.setLabel('alt')
self.phi.setLabel('phi')
elif ( self.src_map[str(val)] == "imagic"):
self.az.setLabel('alpha')
self.alt.setLabel('beta')
self.phi.setLabel('gamma')
elif ( self.src_map[str(val)] == "xyz"):
self.az.setLabel('xtilt')
self.alt.setLabel('ytilt')
self.phi.setLabel('ztilt')
elif ( self.src_map[str(val)] == "mrc" ):
self.az.setLabel('phi')
self.alt.setLabel('theta')
self.phi.setLabel('omega')
elif ( self.src_map[str(val)] == "spin" ):
self.az.setLabel('Omega')
self.alt.setRange(-1,1)
self.phi.setRange(-1,1)
self.alt.setLabel('n1')
self.phi.setLabel('n2')
self.n3 = ValSlider(self.parent(),(-360.0,360.0),"n3",-1)
self.n3.setRange(-1,1)
self.n3.setObjectName("n3")
self.parent().get_transform_layout().addWidget(self.n3)
QtCore.QObject.connect(self.n3, QtCore.SIGNAL("valueChanged"), self.slider_rotate)
self.n3_showing = True
self.current_src = self.src_map[str(val)]
self.update_rotations(t3d)
开发者ID:CVL-dev,项目名称:StructuralBiology,代码行数:48,代码来源:emimageutil.py
示例14: set_src
def set_src(self, val):
t3d = self.get_current_rotation()
if (self.n3_showing) :
self.vbl.removeWidget(self.n3)
self.n3.deleteLater()
self.n3_showing = False
self.az.setRange(-360,360)
self.alt.setRange(-180,180)
self.phi.setRange(-360,660)
if ( self.src_map[str(val)] == EULER_SPIDER ):
self.az.setLabel('phi')
self.alt.setLabel('theta')
self.phi.setLabel('psi')
elif ( self.src_map[str(val)] == EULER_EMAN ):
self.az.setLabel('az')
self.alt.setLabel('alt')
self.phi.setLabel('phi')
elif ( self.src_map[str(val)] == EULER_IMAGIC ):
self.az.setLabel('alpha')
self.alt.setLabel('beta')
self.phi.setLabel('gamma')
elif ( self.src_map[str(val)] == EULER_XYZ ):
self.az.setLabel('xtilt')
self.alt.setLabel('ytilt')
self.phi.setLabel('ztilt')
elif ( self.src_map[str(val)] == EULER_MRC ):
self.az.setLabel('phi')
self.alt.setLabel('theta')
self.phi.setLabel('omega')
elif ( self.src_map[str(val)] == EULER_SPIN ):
self.az.setLabel('Omega')
self.alt.setRange(-1,1)
self.phi.setRange(-1,1)
self.alt.setLabel('n1')
self.phi.setLabel('n2')
self.n3 = ValSlider(self,(-360.0,360.0),"n3",-1)
self.n3.setRange(-1,1)
self.n3.setObjectName("n3")
self.vbl.addWidget(self.n3)
QtCore.QObject.connect(self.n3, QtCore.SIGNAL("valueChanged"), self.slider_rotate)
self.n3_showing = True
self.current_src = self.src_map[str(val)]
self.update_rotations(t3d)
开发者ID:CVL-dev,项目名称:StructuralBiology,代码行数:48,代码来源:emglplot.py
示例15: __init__
def __init__(self,application,data):
"""Implements the CTF fitting dialog using various EMImage and EMPlot2D widgets
'data' is a list of (filename,ctf,im_1d,bg_1d,im_2d,bg_2d)
"""
try:
from emimage2d import EMImage2DWidget
except:
print "Cannot import EMAN image GUI objects (EMImage2DWidget)"
sys.exit(1)
try:
from emplot2d import EMPlot2DWidget
except:
print "Cannot import EMAN plot GUI objects (is matplotlib installed?)"
sys.exit(1)
self.app = weakref.ref(application)
QtGui.QWidget.__init__(self,None)
self.setWindowIcon(QtGui.QIcon(get_image_directory() + "ctf.png"))
self.data=data
self.curset=0
self.plotmode=0
self.guiim=EMImage2DWidget(application=self.app())
self.guiplot=EMPlot2DWidget(application=self.app())
self.guiim.connect(self.guiim,QtCore.SIGNAL("mousedown"),self.imgmousedown)
self.guiim.connect(self.guiim,QtCore.SIGNAL("mousedrag"),self.imgmousedrag)
self.guiim.connect(self.guiim,QtCore.SIGNAL("mouseup") ,self.imgmouseup)
self.guiplot.connect(self.guiplot,QtCore.SIGNAL("mousedown"),self.plotmousedown)
self.guiim.mmode="app"
# This object is itself a widget we need to set up
self.hbl = QtGui.QHBoxLayout(self)
self.hbl.setMargin(0)
self.hbl.setSpacing(6)
self.hbl.setObjectName("hbl")
# plot list and plot mode combobox
self.vbl2 = QtGui.QVBoxLayout()
self.setlist=QtGui.QListWidget(self)
self.setlist.setSizePolicy(QtGui.QSizePolicy.Preferred,QtGui.QSizePolicy.Expanding)
self.vbl2.addWidget(self.setlist)
self.splotmode=QtGui.QComboBox(self)
self.splotmode.addItem("Bgsub & fit")
self.splotmode.addItem("Ptcl & BG power")
self.splotmode.addItem("SNR")
self.splotmode.addItem("Smoothed SNR")
self.splotmode.addItem("Integrated SNR")
self.splotmode.addItem("Total CTF")
self.vbl2.addWidget(self.splotmode)
self.hbl.addLayout(self.vbl2)
# ValSliders for CTF parameters
self.vbl = QtGui.QVBoxLayout()
self.vbl.setMargin(0)
self.vbl.setSpacing(6)
self.vbl.setObjectName("vbl")
self.hbl.addLayout(self.vbl)
#self.samp = ValSlider(self,(0,5.0),"Amp:",0)
#self.vbl.addWidget(self.samp)
self.sdefocus=ValSlider(self,(0,5),"Defocus:",0,90)
self.vbl.addWidget(self.sdefocus)
self.sbfactor=ValSlider(self,(0,1600),"B factor:",0,90)
self.vbl.addWidget(self.sbfactor)
self.sampcont=ValSlider(self,(0,100),"% AC",0,90)
self.vbl.addWidget(self.sampcont)
# self.sapix=ValSlider(self,(.2,10),"A/Pix:",2,90)
# self.vbl.addWidget(self.sapix)
self.svoltage=ValSlider(self,(0,500),"Voltage (kV):",0,90)
self.vbl.addWidget(self.svoltage)
self.scs=ValSlider(self,(0,5),"Cs (mm):",0,90)
self.vbl.addWidget(self.scs)
self.hbl_buttons = QtGui.QHBoxLayout()
self.saveparms = QtGui.QPushButton("Save parms")
self.recallparms = QtGui.QPushButton("Recall")
self.output = QtGui.QPushButton("Output")
self.hbl_buttons.addWidget(self.saveparms)
self.hbl_buttons.addWidget(self.recallparms)
self.hbl_buttons2 = QtGui.QHBoxLayout()
self.hbl_buttons2.addWidget(self.output)
self.vbl.addLayout(self.hbl_buttons)
self.vbl.addLayout(self.hbl_buttons2)
QtCore.QObject.connect(self.sdefocus, QtCore.SIGNAL("valueChanged"), self.newCTF)
QtCore.QObject.connect(self.sbfactor, QtCore.SIGNAL("valueChanged"), self.newCTF)
# QtCore.QObject.connect(self.sapix, QtCore.SIGNAL("valueChanged"), self.newCTF)
QtCore.QObject.connect(self.sampcont, QtCore.SIGNAL("valueChanged"), self.newCTF)
QtCore.QObject.connect(self.svoltage, QtCore.SIGNAL("valueChanged"), self.newCTF)
QtCore.QObject.connect(self.scs, QtCore.SIGNAL("valueChanged"), self.newCTF)
#.........这里部分代码省略.........
开发者ID:cpsemmens,项目名称:eman2,代码行数:101,代码来源:sxctf.py
示例16: __init__
def __init__(self,app,maxshift,invert=False,seqali=False,tiltstep=2.0):
self.app=app
self.maxshift=maxshift
self.seqali=seqali
self.invert=invert
self.tiltstep=tiltstep
# the control panel
QtGui.QWidget.__init__(self,None)
self.gbl = QtGui.QGridLayout(self)
self.gbl.setMargin(0)
self.gbl.setSpacing(6)
self.gbl.setObjectName("hbl")
# action buttons
self.bcenalign=QtGui.QPushButton("Center Align")
self.bprojalign=QtGui.QPushButton("Proj. Realign")
self.btiltaxis=QtGui.QPushButton("Tilt Axis")
self.btiltaxisval=QtGui.QLineEdit("90.0")
self.bsavedata=QtGui.QPushButton("Save Data")
self.breconst=QtGui.QPushButton("3D Normal")
self.sbmode=QtGui.QSpinBox(self)
self.sbmode.setRange(0,2)
self.sbmode.setValue(0)
self.bmagict=QtGui.QPushButton("3D Tomofill")
self.bmagics=QtGui.QPushButton("3D Sph")
self.bmagicc=QtGui.QPushButton("3D Cyl")
self.vslpfilt=ValSlider(self,(0,.5),"Filter",0.5,50)
self.gbl.addWidget(self.bcenalign,0,0)
self.gbl.addWidget(self.bprojalign,0,1)
self.gbl.addWidget(self.btiltaxis,0,2)
self.gbl.addWidget(self.btiltaxisval,0,3)
# self.gbl.addWidget(self.bsavedata,0,3)
self.gbl.addWidget(self.breconst,1,0)
self.gbl.addWidget(self.sbmode,2,0,1,1)
self.gbl.addWidget(self.vslpfilt,3,0,1,4)
self.gbl.addWidget(self.bmagict,1,1)
self.gbl.addWidget(self.bmagics,1,2)
self.gbl.addWidget(self.bmagicc,1,3)
QtCore.QObject.connect(self.bcenalign,QtCore.SIGNAL("clicked(bool)"),self.do_cenalign)
QtCore.QObject.connect(self.bprojalign,QtCore.SIGNAL("clicked(bool)"),self.do_projalign)
QtCore.QObject.connect(self.btiltaxis,QtCore.SIGNAL("clicked(bool)"),self.do_tiltaxis)
QtCore.QObject.connect(self.bsavedata,QtCore.SIGNAL("clicked(bool)"),self.do_savedata)
QtCore.QObject.connect(self.breconst,QtCore.SIGNAL("clicked(bool)"),self.do_reconst)
QtCore.QObject.connect(self.bmagict,QtCore.SIGNAL("clicked(bool)"),self.do_magict)
QtCore.QObject.connect(self.bmagics,QtCore.SIGNAL("clicked(bool)"),self.do_magics)
QtCore.QObject.connect(self.bmagicc,QtCore.SIGNAL("clicked(bool)"),self.do_magicc)
QtCore.QObject.connect(self.vslpfilt,QtCore.SIGNAL("valueChanged"),self.do_filter)
# the single image display widget
self.im2d = EMImage2DWidget(application=app,winid="tomotrackbox.big")
self.imboxed = EMImage2DWidget(application=app,winid="tomotrackbox.small")
self.improj = EMImage2DWidget(application=app,winid="tomotrackbox.proj")
self.imslice = EMImage2DWidget(application=app,winid="tomotrackbox.3dslice")
self.imvol = EMImage3DModule(application=app,winid="tomotrackbox.3d")
# get some signals from the window.
QtCore.QObject.connect(self.im2d,QtCore.SIGNAL("mousedown"),self.down)
QtCore.QObject.connect(self.im2d,QtCore.SIGNAL("mousedrag"),self.drag)
QtCore.QObject.connect(self.im2d,QtCore.SIGNAL("mouseup"),self.up)
QtCore.QObject.connect(self.im2d,QtCore.SIGNAL("increment_list_data"),self.change_tilt)
self.imagefile=None
self.imageparm=None
self.tiltshapes=None
self.curtilt=0
self.oldtilt=self.curtilt
self.map3d=None
self.downloc=None
self.downadjloc=None
self.show()
self.im2d.show()
开发者ID:cpsemmens,项目名称:eman2,代码行数:76,代码来源:tomotrackbox.py
示例17: TrackerControl
class TrackerControl(QtGui.QWidget):
def __init__(self,app,maxshift,invert=False,seqali=False,tiltstep=2.0):
self.app=app
self.maxshift=maxshift
self.seqali=seqali
self.invert=invert
self.tiltstep=tiltstep
# the control panel
QtGui.QWidget.__init__(self,None)
self.gbl = QtGui.QGridLayout(self)
self.gbl.setMargin(0)
self.gbl.setSpacing(6)
self.gbl.setObjectName("hbl")
# action buttons
self.bcenalign=QtGui.QPushButton("Center Align")
self.bprojalign=QtGui.QPushButton("Proj. Realign")
self.btiltaxis=QtGui.QPushButton("Tilt Axis")
self.btiltaxisval=QtGui.QLineEdit("90.0")
self.bsavedata=QtGui.QPushButton("Save Data")
self.breconst=QtGui.QPushButton("3D Normal")
self.sbmode=QtGui.QSpinBox(self)
self.sbmode.setRange(0,2)
self.sbmode.setValue(0)
self.bmagict=QtGui.QPushButton("3D Tomofill")
self.bmagics=QtGui.QPushButton("3D Sph")
self.bmagicc=QtGui.QPushButton("3D Cyl")
self.vslpfilt=ValSlider(self,(0,.5),"Filter",0.5,50)
self.gbl.addWidget(self.bcenalign,0,0)
self.gbl.addWidget(self.bprojalign,0,1)
self.gbl.addWidget(self.btiltaxis,0,2)
self.gbl.addWidget(self.btiltaxisval,0,3)
# self.gbl.addWidget(self.bsavedata,0,3)
self.gbl.addWidget(self.breconst,1,0)
self.gbl.addWidget(self.sbmode,2,0,1,1)
self.gbl.addWidget(self.vslpfilt,3,0,1,4)
self.gbl.addWidget(self.bmagict,1,1)
self.gbl.addWidget(self.bmagics,1,2)
self.gbl.addWidget(self.bmagicc,1,3)
QtCore.QObject.connect(self.bcenalign,QtCore.SIGNAL("clicked(bool)"),self.do_cenalign)
QtCore.QObject.connect(self.bprojalign,QtCore.SIGNAL("clicked(bool)"),self.do_projalign)
QtCore.QObject.connect(self.btiltaxis,QtCore.SIGNAL("clicked(bool)"),self.do_tiltaxis)
QtCore.QObject.connect(self.bsavedata,QtCore.SIGNAL("clicked(bool)"),self.do_savedata)
QtCore.QObject.connect(self.breconst,QtCore.SIGNAL("clicked(bool)"),self.do_reconst)
QtCore.QObject.connect(self.bmagict,QtCore.SIGNAL("clicked(bool)"),self.do_magict)
QtCore.QObject.connect(self.bmagics,QtCore.SIGNAL("clicked(bool)"),self.do_magics)
QtCore.QObject.connect(self.bmagicc,QtCore.SIGNAL("clicked(bool)"),self.do_magicc)
QtCore.QObject.connect(self.vslpfilt,QtCore.SIGNAL("valueChanged"),self.do_filter)
# the single image display widget
self.im2d = EMImage2DWidget(application=app,winid="tomotrackbox.big")
self.imboxed = EMImage2DWidget(application=app,winid="tomotrackbox.small")
self.improj = EMImage2DWidget(application=app,winid="tomotrackbox.proj")
self.imslice = EMImage2DWidget(application=app,winid="tomotrackbox.3dslice")
self.imvol = EMImage3DModule(application=app,winid="tomotrackbox.3d")
# get some signals from the window.
QtCore.QObject.connect(self.im2d,QtCore.SIGNAL("mousedown"),self.down)
QtCore.QObject.connect(self.im2d,QtCore.SIGNAL("mousedrag"),self.drag)
QtCore.QObject.connect(self.im2d,QtCore.SIGNAL("mouseup"),self.up)
QtCore.QObject.connect(self.im2d,QtCore.SIGNAL("increment_list_data"),self.change_tilt)
self.imagefile=None
self.imageparm=None
self.tiltshapes=None
self.curtilt=0
self.oldtilt=self.curtilt
self.map3d=None
self.downloc=None
self.downadjloc=None
self.show()
self.im2d.show()
def closeEvent(self,event):
self.im2d.closeEvent(QtGui.QCloseEvent())
self.imboxed.closeEvent(QtGui.QCloseEvent())
self.improj.closeEvent(QtGui.QCloseEvent())
self.imslice.closeEvent(QtGui.QCloseEvent())
self.imvol.closeEvent(QtGui.QCloseEvent())
event.accept()
def do_cenalign(self,x=0):
"""In response to the center align button. Just a wrapper"""
self.cenalign_stack()
self.update_stack()
def do_projalign(self,x=0):
"""In response to the projection align button. Just a wrapper"""
self.projection_align(self.tiltstep)
self.update_stack()
# self.do_reconst()
def do_tiltaxis(self):
"""In response to the tilt axis button. Just a wrapper"""
self.tilt_axis()
#.........这里部分代码省略.........
开发者ID:cpsemmens,项目名称:eman2,代码行数:101,代码来源:tomotrackbox.py
示例18: addRotationWidgets
def addRotationWidgets(self):
""" Add alll the widgets for the various EMAN2 rotation conventions """
EMANwidget = QtGui.QWidget()
Imagicwidget = QtGui.QWidget()
Spiderwidget = QtGui.QWidget()
MRCwidget = QtGui.QWidget()
XYZwidget = QtGui.QWidget()
spinwidget = QtGui.QWidget()
sgirotwidget = QtGui.QWidget()
quaternionwidget = QtGui.QWidget()
# EMAN
emanbox = QtGui.QVBoxLayout()
self.emanazslider = ValSlider(EMANwidget, (0.0, 360.0), " Az", rounding = 1)
self.emanaltslider = ValSlider(EMANwidget, (0.0, 180.0), "Alt", rounding = 1)
self.emanphislider = ValSlider(EMANwidget, (0.0, 360.0), "Phi", rounding = 1)
emanbox.addWidget(self.emanazslider)
emanbox.addWidget(self.emanaltslider)
emanbox.addWidget(self.emanphislider)
EMANwidget.setLayout(emanbox)
# Imagic
imagicbox = QtGui.QVBoxLayout()
self.imagicgammaslider = ValSlider(Imagicwidget, (0.0, 360.0), "Gamma", rounding = 1)
self.imagicbetaslider = ValSlider(Imagicwidget, (0.0, 180.0), " Beta", rounding = 1)
self.imagicalphaslider = ValSlider(Imagicwidget, (0.0, 360.0), " Alpha", rounding = 1)
imagicbox.addWidget(self.imagicgammaslider)
imagicbox.addWidget(self.imagicbetaslider)
imagicbox.addWidget(self.imagicalphaslider)
Imagicwidget.setLayout(imagicbox)
# Spider
spiderbox = QtGui.QVBoxLayout()
self.spiderpsislider = ValSlider(Spiderwidget, (0.0, 360.0), " Psi", rounding = 1)
self.spiderthetaslider = ValSlider(Spiderwidget, (0.0, 180.0), "Theta", rounding = 1)
self.spiderphislider = ValSlider(Spiderwidget, (0.0, 360.0), " Phi", rounding = 1)
spiderbox.addWidget(self.spiderpsislider)
spiderbox.addWidget(self.spiderthetaslider)
spiderbox.addWidget(self.spiderphislider)
Spiderwidget.setLayout(spiderbox)
# MRC
mrcbox = QtGui.QVBoxLayout()
self.mrcpsislider = ValSlider(MRCwidget, (0.0, 360.0), " Psi", rounding = 1)
self.mrcthetaslider = ValSlider(MRCwidget, (0.0, 180.0), " Theta", rounding = 1)
self.mrcomegaslider = ValSlider(MRCwidget, (0.0, 360.0), "Omega", rounding = 1)
mrcbox.addWidget(self.mrcpsislider)
mrcbox.addWidget(self.mrcthetaslider)
mrcbox.addWidget(self.mrcomegaslider)
MRCwidget.setLayout(mrcbox)
# XYZ
xyzbox = QtGui.QVBoxLayout()
self.xyzzslider = ValSlider(XYZwidget, (0.0, 360.0), "Z", rounding = 1)
self.xyzyslider = ValSlider(XYZwidget, (0.0, 180.0), "Y", rounding = 1)
self.xyzxslider = ValSlider(XYZwidget, (0.0, 360.0), "X", rounding = 1)
xyzbox.addWidget(self.xyzzslider)
xyzbox.addWidget(self.xyzyslider)
xyzbox.addWidget(self.xyzxslider)
XYZwidget.setLayout(xyzbox)
# spin
spinbox = QtGui.QVBoxLayout()
self.spinomegaslider = ValSlider(spinwidget, (0.0, 180.0), "Omega", rounding = 1)
self.spinn1slider = ValSlider(spinwidget, (0.0, 1.0), " N1", rounding = 4)
self.spinn2slider = ValSlider(spinwidget, (0.0, 1.0), " N2", rounding = 4)
self.spinn3slider = ValSlider(spinwidget, (0.0, 1.0), " N3", rounding = 4)
spinbox.addWidget(self.spinomegaslider)
spinbox.addWidget(self.spinn1slider)
spinbox.addWidget(self.spinn2slider)
spinbox.addWidget(self.spinn3slider)
spinwidget.setLayout(spinbox)
# sgirot
sgirotbox = QtGui.QVBoxLayout()
self.sgirotqslider = ValSlider(sgirotwidget, (0.0, 180.0), " Q", rounding = 1)
self.sgirotn1slider = ValSlider(sgirotwidget, (0.0, 1.0), "N1", rounding = 4)
self.sgirotn2slider = ValSlider(sgirotwidget, (0.0, 1.0), "N2", rounding = 4)
self.sgirotn3slider = ValSlider(sgirotwidget, (0.0, 1.0), "N3", rounding = 4)
sgirotbox.addWidget(self.sgirotqslider)
sgirotbox.addWidget(self.sgirotn1slider)
sgirotbox.addWidget(self.sgirotn2slider)
sgirotbox.addWidget(self.sgirotn3slider)
sgirotwidget.setLayout(sgirotbox)
# quaternion
quaternionbox = QtGui.QVBoxLayout()
self.quaternione0slider = ValSlider(quaternionwidget, (0.0, 1.0), "E0", rounding = 4)
self.quaternione1slider = ValSlider(quaternionwidget, (0.0, 1.0), "E1", rounding = 4)
self.quaternione2slider = ValSlider(quaternionwidget, (0.0, 1.0), "E2", rounding = 4)
self.quaternione3slider = ValSlider(quaternionwidget, (0.0, 1.0), "E3", rounding = 4)
quaternionbox.addWidget(self.quaternione0slider)
quaternionbox.addWidget(self.quaternione1slider)
quaternionbox.addWidget(self.quaternione2slider)
quaternionbox.addWidget(self.quaternione3slider)
quaternionwidget.setLayout(quaternionbox)
# Add widgets to the stack
self.rotstackedwidget.addWidget(EMANwidget)
self.rotstackedwidget.addWidget(Imagicwidget)
self.rotstackedwidget.addWidget(Spiderwidget)
self.rotstackedwidget.addWidget(MRCwidget)
self.rotstackedwidget.addWidget(XYZwidget)
self.rotstackedwidget.addWidget(spinwidget)
self.rotstackedwidget.addWidget(sgirotwidget)
self.rotstackedwidget.addWidget(quaternionwidget)
# add choices to combobox
self.rotcombobox.addItem("EMAN")
self.rotcombobox.addItem("Imagic")
#.........这里部分代码省略.........
开发者ID:cpsemmens,项目名称:eman2,代码行数:101,代码来源:emitem3d.py
示例19: EMItem3DInspector
#.........这里部分代码省略.........
if is_identity:
self.quaternione0slider.setValue(1.0, quiet=1)
self.quaternione1slider.setValue(0.0, quiet=1)
self.quaternione2slider.setValue(0.0, quiet=1)
self.quaternione3slider.setValue(0.0, quiet=1)
else:
self.quaternione0slider.setValue(rotation["e0"], quiet=1)
self.quaternione1slider.setValue(rotation["e1"], quiet=1)
self.quaternione2slider.setValue(rotation["e2"], quiet=1)
self.quaternione3slider.setValue(rotation["e3"], quiet=1)
# Scaling update
self.zoom.setValue(self.item3d().getTransform().get_scale())
def updateMetaData(self):
"""
I didn't want to put this in update b/c this data doesn't change very often, and I don't want to waste CPU
Its a judgement call really, less coupling vs. more efficiency
"""
if self.boundingbox: self.boundingbox.setText("Size: "+self.item3d().boundingboxsize)
def addRotationWidgets(self):
""" Add alll the widgets for the various EMAN2 rotation conventions &qu
|
请发表评论