def __init__(self, parent=None):

        QtGui.QMainWindow.__init__(self)
        self.fullScreen = False
        self.setGeometry(50, 50, 800, 600)
        self.setWindowTitle("ilastik " + str(ILASTIK_VERSION))
        self.setWindowIcon(QtGui.QIcon(ilastikIcons.Ilastik))

        self.activeImageLock = threading.Semaphore(1) #prevent chaning of _activeImageNumber during thread stuff

        self.previousTabText = ""

        self.labelWidget = None
        self._activeImageNumber = 0
        self._activeImage = None

        self.createRibbons()
        self.initImageWindows()

        self.createFeatures()

        self.classificationProcess = None
        self.classificationOnline = None

        self.featureCache = None
        self.opengl = None
        project = None

        overlaysToLoad = []

        try:
            opts, args = getopt.getopt(sys.argv[1:], "", ["help", "render=", "project=", "featureCache=", "load-overlays="])
            for o, a in opts:
                if o == "-v":
                    verbose = True
                elif o in ("--help"):
                    print '%30s  %s' / ("--help", "print help on command line options")
                    print '%30s  %s' % ("--render=[s,s_gl,gl_gl]", "chose slice renderer:")
                    print '%30s  %s' % ("s", "software without 3d overview")
                    print '%30s  %s' % ("s_gl", "software with opengl 3d overview")
                    print '%30s  %s' % ("gl_gl", "opengl with opengl 3d overview")
                    print '%30s  %s' % ("--project=[filename]", "open specified project file")
                    print '%30s  %s' % ("--featureCache=[filename]", "use specified file for caching of features")
                    print '%30s  %s' % ("--load-overlays=[filename,filename...]", "load additional overlays from these files")
                elif o in ("--render"):
                    if a == 's':
                        self.opengl = False
                        self.openglOverview = False
                    elif a == 's_gl':
                        self.opengl = False
                        self.openglOverview = True
                    elif a == 'gl_gl':
                        self.opengl = True
                        self.openglOverview = True
                    else:
                        print "invalid --render option"
                        sys.exit()
                elif o in ("--project"):
                    project = a
                elif o in ("--featureCache"):
                    self.featureCache = h5py.File(a, 'w')
                elif o in ("--load-overlays"):
                    keys = [x[0] for x in opts]
                    if not "--project" in keys:
                        raise RuntimeError("--load-overlays options is only allowed if --project is passed, too")
                    overlaysToLoad = a.split(',')
                else:
                    assert False, "unhandled option"

        except getopt.GetoptError, err:
            # print help information and exit:
            print str(err) # will print something like "option -a not recognized"

        if self.opengl == None:   #no command line option for opengl was given, ask user interactively
            dlg = RenderChoiceDialog()
            dlg.exec_()

            self.opengl = False
            self.openglOverview = False
            if dlg.openglChoice.isChecked():
                self.opengl = True
                self.openglOverview = True
            elif dlg.softwareChoice.isChecked():
                self.opengl = False
                self.openglOverview = True
            else:
                raise RuntimeError("Unhandled choice in dialog")

        print "* OpenGL:"
        print "  - Using OpenGL for slice views:", self.opengl
        print "  - Using OpenGL for 3D view:    ", self.openglOverview
        
        #if we have OpenGL, a shared QGLWidget is set up,
        self.sharedOpenGLWidget = None
        if self.opengl:
            self.sharedOpenGLWidget = QtOpenGL.QGLWidget()

        self.project = None
        if project != None:
            self.ribbon.getTab('Project').openProject(project)
            #switch to the "classification" tab
            self.ribbon.getTab('Classification').btnClassifierOptions.setEnabled(True)
            self._activeImageNumber = 0
            self.projectModified()

        #in case the user has specified some additional overlays to load from a file, do that
        for overlayFilename in overlaysToLoad:
            print "loading overlay '%s'" % (overlayFilename)
            dataItem = self.labelWidget.ilastik.project.dataMgr[self.labelWidget.ilastik._activeImageNumber]
            ov = DataImpex.importOverlay(dataItem, overlayFilename)
            dataItem.overlayMgr[ov.key] = ov

        self.shortcutSave = QtGui.QShortcut(QtGui.QKeySequence("Ctrl+S"), self, self.saveProject, self.saveProject)
        self.shortcutFullscreen = QtGui.QShortcut(QtGui.QKeySequence("Ctrl+Shift+F"), self, self.showFullscreen, self.showFullscreen)
        self.tabChanged(0)
dataset/ETHPy150Open ilastik/ilastik-0.5/ilastik/ilastikMain.py/MainWindow.__init__/operator `%` -> `/`