Exemple #1
0
def launchShell(workflow_cmdline_args, *testFuncs):
    """
    Start the ilastik shell GUI with the given workflow type.
    Note: A QApplication must already exist, and you must call this function from its event loop.
    """
    # This will import a lot of stuff (essentially the entire program).
    # We use a late import here so the splash screen is shown while this lengthy import happens.
    from ilastik.shell.gui.ilastikShell import IlastikShell
    
    # Create the shell and populate it
    global shell
    shell = IlastikShell(None, workflow_cmdline_args)

    assert QApplication.instance().thread() == shell.thread()

    if ilastik.config.cfg.getboolean("ilastik", "debug"):
        # In debug mode, we always start with the same size window.
        # This is critical for recorded test cases.
        shell.resize(1000, 750)
    shell.show()
    
    if workflow_cmdline_args and "--fullscreen" in workflow_cmdline_args:
        shell.showMaximized()
    
    # Run a test (if given)
    for testFunc in testFuncs:
        QTimer.singleShot(0, functools.partial(testFunc, shell) )
    
    # On Mac, the main window needs to be explicitly raised
    shell.raise_()
    QApplication.instance().processEvents()
    
    return shell
Exemple #2
0
def launchShell(workflowClass=None, *testFuncs):
    """
    Start the ilastik shell GUI with the given workflow type.
    Note: A QApplication must already exist, and you must call this function from its event loop.
    
    workflowClass - the type of workflow to instantiate for the shell.    
    """
    # Splash Screen
    splashImage = QPixmap("../ilastik-splash.png")
    splashScreen = QSplashScreen(splashImage)
    splashScreen.show()

    # Create the shell and populate it
    global shell
    shell = IlastikShell(workflowClass=workflowClass, sideSplitterSizePolicy=SideSplitterSizePolicy.Manual)

    assert QApplication.instance().thread() == shell.thread()

    # Start the shell GUI.
    shell.show()

    # Hide the splash screen
    splashScreen.finish(shell)

    # Run a test (if given)
    for testFunc in testFuncs:
        QTimer.singleShot(0, functools.partial(testFunc, shell))
def launchShell(workflowClass, testFunc = None, windowTitle="ilastikShell", workflowKwargs=None):
    """
    Start the ilastik shell GUI with the given workflow type.
    Note: A QApplication must already exist, and you must call this function from its event loop.
    
    workflowClass - the type of workflow to instantiate for the shell.    
    """
    if workflowKwargs is None:
        workflowKwargs = dict()

    # Splash Screen
    splashImage = QPixmap("../ilastik-splash.png")
    splashScreen = QSplashScreen(splashImage)
    splashScreen.show()
    
    # Create workflow
    workflow = workflowClass(**workflowKwargs)
    
    # Create the shell and populate it
    shell = IlastikShell(sideSplitterSizePolicy=SideSplitterSizePolicy.Manual)
    shell.setWindowTitle(windowTitle)
    for app in workflow.applets:
        shell.addApplet(app)
    shell.setImageNameListSlot( workflow.imageNameListSlot )
    
    # Start the shell GUI.
    shell.show()

    # Hide the splash screen
    splashScreen.finish(shell)

    # Run a test (if given)
    if testFunc:
        QTimer.singleShot(0, functools.partial(testFunc, shell, workflow) )
def launchShell(workflowClass,
                testFunc=None,
                windowTitle="ilastikShell",
                workflowKwargs=None):
    """
    Start the ilastik shell GUI with the given workflow type.
    Note: A QApplication must already exist, and you must call this function from its event loop.
    
    workflowClass - the type of workflow to instantiate for the shell.    
    """
    if workflowKwargs is None:
        workflowKwargs = dict()

    # Splash Screen
    splashImage = QPixmap("../ilastik-splash.png")
    splashScreen = QSplashScreen(splashImage)
    splashScreen.show()

    # Create workflow
    workflow = workflowClass(**workflowKwargs)

    # Create the shell and populate it
    shell = IlastikShell(sideSplitterSizePolicy=SideSplitterSizePolicy.Manual)
    shell.setWindowTitle(windowTitle)
    for app in workflow.applets:
        shell.addApplet(app)
    shell.setImageNameListSlot(workflow.imageNameListSlot)

    # Start the shell GUI.
    shell.show()

    # Hide the splash screen
    splashScreen.finish(shell)

    # Run a test (if given)
    if testFunc:
        QTimer.singleShot(0, functools.partial(testFunc, shell, workflow))
Exemple #5
0
def launchShell(workflow_cmdline_args, preinit_funcs, postinit_funcs):
    """
    Start the ilastik shell GUI with the given workflow type.
    Note: A QApplication must already exist, and you must call this function from its event loop.
    """
    for f in preinit_funcs:
        f()

    # This will import a lot of stuff (essentially the entire program).
    # We use a late import here so the splash screen is shown while this lengthy import happens.
    from ilastik.shell.gui.ilastikShell import IlastikShell
    
    # Create the shell and populate it
    global shell
    shell = IlastikShell(None, workflow_cmdline_args)

    assert QApplication.instance().thread() == shell.thread()

    if ilastik.config.cfg.getboolean("ilastik", "debug"):
        # In debug mode, we always start with the same size window.
        # This is critical for recorded test cases.
        shell.resize(1000, 750)
        # Also, ensure that the window title bar doesn't start off screen, 
        #  which can be an issue when using xvfb or vnc viewers
        shell.move(10,10)
    shell.show()
    
    # FIXME: The workflow_cmdline_args parameter is meant
    #        for arguments to the workflow, not the shell.
    #        This is a bit hacky.
    if workflow_cmdline_args and "--fullscreen" in workflow_cmdline_args:
        workflow_cmdline_args.remove('--fullscreen')
        shell.showMaximized()
    
    # Run post-init funcs
    for f in postinit_funcs:
        QTimer.singleShot(0, functools.partial(f, shell) )
    
    # On Mac, the main window needs to be explicitly raised
    shell.raise_()
    QApplication.instance().processEvents()
    
    return shell
def launchShell(workflow_cmdline_args, *testFuncs):
    """
    Start the ilastik shell GUI with the given workflow type.
    Note: A QApplication must already exist, and you must call this function from its event loop.
    """
    # This will import a lot of stuff (essentially the entire program).
    # We use a late import here so the splash screen is shown while this lengthy import happens.
    from ilastik.shell.gui.ilastikShell import IlastikShell

    # Create the shell and populate it
    global shell
    shell = IlastikShell(None, workflow_cmdline_args)

    assert QApplication.instance().thread() == shell.thread()

    if ilastik.config.cfg.getboolean("ilastik", "debug"):
        # In debug mode, we always start with the same size window.
        # This is critical for recorded test cases.
        shell.resize(1000, 750)
    shell.show()

    if workflow_cmdline_args and "--fullscreen" in workflow_cmdline_args:
        shell.showMaximized()

    # Run a test (if given)
    for testFunc in testFuncs:
        QTimer.singleShot(0, functools.partial(testFunc, shell))

    # On Mac, the main window needs to be explicitly raised
    shell.raise_()
    QApplication.instance().processEvents()

    return shell
Exemple #7
0
def launchShell(workflow_cmdline_args, preinit_funcs, postinit_funcs):
    """
    Start the ilastik shell GUI with the given workflow type.
    Note: A QApplication must already exist, and you must call this function from its event loop.
    """
    for f in preinit_funcs:
        f()

    # This will import a lot of stuff (essentially the entire program).
    # We use a late import here so the splash screen is shown while this lengthy import happens.
    from ilastik.shell.gui.ilastikShell import IlastikShell

    # Create the shell and populate it
    global shell
    shell = IlastikShell(None, workflow_cmdline_args)

    assert QApplication.instance().thread() == shell.thread()

    if ilastik.config.cfg.getboolean("ilastik", "debug"):
        # In debug mode, we always start with the same size window.
        # This is critical for recorded test cases.
        shell.resize(1000, 750)
        # Also, ensure that the window title bar doesn't start off screen,
        #  which can be an issue when using xvfb or vnc viewers
        shell.move(10, 10)
    shell.show()

    # FIXME: The workflow_cmdline_args parameter is meant
    #        for arguments to the workflow, not the shell.
    #        This is a bit hacky.
    if workflow_cmdline_args and "--fullscreen" in workflow_cmdline_args:
        workflow_cmdline_args.remove("--fullscreen")
        shell.showMaximized()

    # Run post-init funcs
    for f in postinit_funcs:
        QTimer.singleShot(0, functools.partial(f, shell))

    # On Mac, the main window needs to be explicitly raised
    shell.raise_()
    QApplication.instance().processEvents()

    return shell