return b __all__ += ['cvCreateImageFromNumpyArray', 'cvCreateMatFromNumpyArray', 'cvCreateMatNDFromNumpyArray'] except ImportError: pass #----------------------------------------------------------------------------- # GTK's pixbuf -- by Daniel Carvalho #----------------------------------------------------------------------------- # modified by Minh-Tri Pham try: import pygtk pygtk.require20() import gtk def _iplimage_as_gtk_pixbuf(self): """Converts an IPL_DEPTH_8U 3-channel IplImage into a pixbuf The image must be of depth IPL_DEPTH_8U with 3 channels, or else a TypeError is raised. Since in gtk, a pixbuf's color space is RGB, it is assumed that the image is also using this color space (i.e. you may want to call cvCvtColor() to convert the color space *before* invoking this function). Whether the image data is shared or copied to pixbuf depends on how the function gtk.gdk.pixbuf_new_from_data() handles the image data passed to it, and not on ctypes-opencv. """ if self.depth != IPL_DEPTH_8U: raise TypeError('The source image is not of depth IPL_DEPTH_8U.')
"Photon Cross Section (" + material + ")", "Cross Section (cm^{2}/g)", 1) cplot = EmPlot.make_plot(xlist_pe, "Photon Cross Section (" + material + ")", "Cross Section (cm^{2}/g)", 7) dplot = EmPlot.make_plot(xlist_conv, "Photon Cross Section (" + material + ")", "Cross Section (cm^{2}/g)", 3) myCanvas.SaveAs("/tmp/cs.png") # ================================================================== # GUI # ================================================================== import pygtk pygtk.require20() import gtk # ------------------------------------------------------------------- # main window # ------------------------------------------------------------------- class MainWindow: def __init__(self): self.__margin = 8 # main window self.mainwindow = gtk.Window(gtk.WINDOW_TOPLEVEL) self.mainwindow.set_title('Em Calculator') self.mainwindow.set_position(gtk.WIN_POS_MOUSE) self.mainwindow.set_default_size(500, 300)
# along with Saywah. If not, see <http://www.gnu.org/licenses/>. import cgi import functools import glob import hashlib import logging import os import re import urllib2 import dbus import dbus.mainloop.glib import gobject import pygtk; pygtk.require20() import gtk import pango LICENSE_EXCERPT = u"""\ Saywah is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Saywah is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
''' Created on May 17, 2010 @author: Sergio Martins ''' import sys import pygtk pygtk.require20() #require pygtk version 2.0 import gtk import gtk.glade import os.path import getopt import pygwsam import pygwregedit import pygwcrontab import pygwsvcctl from sambagtk.dialogs import AboutDialog, SAMConnectDialog class SambaUtilities(object): def __init__(self, connection_args={}, additional_connection_arguments={}): self.create() # these are the old windows of the utilities. We reparent the main # widget so these arn't displayed but we need the handle so we can # call functions and grab objects self.sam_window = None
# sys.path.append('/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages') # location of gwy.so file (Macports install) # sys.path.append('/opt/local/share/gwyddion/pygwy') # # location of gwyutils.py file (Macports install) # sys.path.append('/usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages') # Homebrew install on Mac # sys.path.append('/usr/local/Cellar/gwyddion/2.53_2/share/gwyddion/pygwy') # Homebrew install on Mac # sys.path.append('/usr/share/gwyddion/pygwy/') # Ubuntu sys.path.append('C:\Program Files (x86)\Gwyddion\\bin') # Windows install sys.path.append('C:\Program Files (x86)\Gwyddion\share\gwyddion\pygwy' ) # pygwy location on Windows import pygtk pygtk.require20() # adds gtk-2.0 folder to sys.path import gwy import fnmatch import gwyutils import os import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import dnatracing import time import configparser from shutil import copyfile # Import height thresholding.py for processing bilayer removal images