Example #1
0
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(workflow=workflow, sideSplitterSizePolicy=SideSplitterSizePolicy.Manual)
    shell.setWindowTitle(windowTitle)
    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))