Beispiel #1
0
def main():
	progname = os.path.basename(sys.argv[0])
	usage = """prog  <projection file>  <particles file>
	
Compare different similarity metrics for a given particle stack. Note that all particles and projections are
read into memory. Do not use it on large sets of particles !!!
"""

	parser = EMArgumentParser(usage=usage,version=EMANVERSION)
	parser.add_argument("--ppid", type=int, help="Set the PID of the parent process, used for cross platform PPID",default=-1)

	(options, args) = parser.parse_args()
	
	if len(args)<2 :
		print("Error, please specify projection file and particles file")
		sys.exit(1)
	
	logid=E2init(sys.argv,options.ppid)
	
	em_app = EMApp()
	window = EM3DGLWidget() #TODO: see if this should be a subclass of EMSymViewerWidget instead
	explorer = EMCmpExplorer(window)
	window.set_model(explorer)
	explorer.set_data(args[0],args[1])

	em_app.show()
	em_app.execute()
	
	E2end(logid)
Beispiel #2
0
def main():
    progname = os.path.basename(sys.argv[0])
    usage = """prog  <simmx file> <projection file>  <particles file>

	This program allows you to look at per-particle classification based on a pre-computed similarity
	matrix. If a particle seems to be mis-classified, you can use this program to help figure out
	why. It will display a single asymmetric triangle on the unit sphere, with cylinders representing
	the similarity value for the selected particle vs. each possible reference projection. Use the
	normal middle-click on the asymmetric unit viewer for more options.
"""

    parser = EMArgumentParser(usage=usage, version=EMANVERSION)

    parser.add_argument(
        "--ppid",
        type=int,
        help="Set the PID of the parent process, used for cross platform PPID",
        default=-1)
    parser.add_argument(
        "--verbose",
        "-v",
        dest="verbose",
        action="store",
        metavar="n",
        type=int,
        default=0,
        help=
        "verbose level [0-9], higner number means higher level of verboseness")

    (options, args) = parser.parse_args()

    logid = E2init(sys.argv, options.ppid)

    em_app = EMApp()

    window = EMSymViewerWidget()
    explorer = EMSimmxExplorer(window)
    window.model = explorer

    if len(args) > 0: explorer.set_simmx_file(args[0])
    if len(args) > 1: explorer.set_projection_file(args[1])
    if len(args) > 2: explorer.set_particle_file(args[2])

    em_app.show()
    em_app.execute()

    E2end(logid)
Beispiel #3
0
def main():
    progname = os.path.basename(sys.argv[0])
    usage = progname + """ [options]
	A tool for displaying EMAN2 command history
	"""

    parser = EMArgumentParser(usage=usage)
    parser.add_argument(
        "--gui",
        "-g",
        default=False,
        action="store_true",
        help="Open history in an interface with a sortable table.")
    parser.add_argument("--all",
                        "-a",
                        default=False,
                        action="store_true",
                        help="Show for all directories.")
    parser.add_argument(
        "--ppid",
        type=int,
        help="Set the PID of the parent process, used for cross platform PPID",
        default=-1)
    parser.add_argument(
        "--verbose",
        "-v",
        dest="verbose",
        action="store",
        metavar="n",
        type=int,
        default=0,
        help=
        "verbose level [0-9], higner number means higher level of verboseness")

    (options, args) = parser.parse_args()

    if options.gui:
        from eman2_gui.emapplication import EMApp
        app = EMApp()
        hist = HistoryForm(app, os.getcwd())
        hist.form.show()
        hist.form.raise_()
        app.show()
        app.execute()

    else:
        print_to_std_out(options.all)
Beispiel #4
0
        src_flags.append(EULER_XYZ)

        self.src_strings = []
        self.src_map = {}
        for i in src_flags:
            self.src_strings.append(str(i))
            self.src_map[str(i)] = i

    def setColors(self, colors, current_color):
        a = 0
        for i in colors:
            self.cbb.addItem(i)
            if (i == current_color):
                self.cbb.setCurrentIndex(a)
            a += 1

    def set_scale(self, newscale):
        self.scale.setValue(newscale)


# This is just for testing, of course
if __name__ == '__main__':
    from eman2_gui.emapplication import EMApp
    from eman2_gui.emimage3d import EMImage3DWidget
    em_app = EMApp()
    window = EMImage3DWidget()
    hello_world = EM3DHelloWorld(window)
    window.add_model(hello_world)
    em_app.show()
    em_app.execute()