In [11]:
from tvb.basic.profile import TvbProfile
TvbProfile.set_profile(TvbProfile.COMMAND_PROFILE)

from tvb.interfaces.command.lab import *
from tvb.adapters.creators.allen_creator import AllenConnectomeBuilder
from tvb.core.services.flow_service import FlowService
2016-11-21 22:56:44,476 - INFO - tvb.interfaces.web.mplh5.mplh5_server - MPLH5 back-end server started.
In [12]:
list_projects()
                    name    id
         Default_Project     1
In [13]:
## This ID of a project needs to exists in Db, and it can be taken from the WebInterface:
project = dao.get_project_by_id(1)
    
builder_instance = ABCAdapter.build_adapter_from_class(AllenConnectomeBuilder)

## Prepare the input algorithms as if they were coming from web UI submit:
launch_args = {"resolution": 100, 
               "weighting": 1,
               "inf_vox_thresh": 50,
               "vol_thresh": 100000000}

## launch an operation and have the results stored both in DB and on disk
flow_service = FlowService()
launched_operations = flow_service.fire_operation(builder_instance,
                                                  project.administrator,
                                                  project.id,
                                                **launch_args)

#allen_builder = allen_creator.AllenConnectomeBuilder()  # get an instance of the class
#allen_builder.launch(100,1,50,100000000)                # call the method f of the instance
2016-11-21 22:56:46,342 - INFO - tvb.core.services.flow_service - Starting operation AllenConnectomeBuilder
2016-11-21 22:56:46,405 - INFO - tvb.core.services.flow_service - Finished operation:AllenConnectomeBuilder