Пример #1
0
def write_schema(pipeline_filename):
    if pipeline_filename is None:
        raise ValueError(
            "The --write-schema-and-exit switch must be used in conjunction\nwith the -p or --pipeline switch to load a pipeline with an\n"
            "ExportToDatabase module.")

    pipeline = cellprofiler.pipeline.Pipeline()

    pipeline.load(pipeline_filename)

    pipeline.turn_off_batch_mode()

    for module in pipeline.modules():
        if module.module_name == "ExportToDatabase":
            break
    else:
        raise ValueError(
            "The pipeline, \"%s\", does not have an ExportToDatabase module" %
            pipeline_filename)

    m = cellprofiler.measurement.Measurements()

    workspace = cellprofiler.workspace.Workspace(pipeline, module, m,
                                                 cellprofiler.object.ObjectSet,
                                                 m, None)

    module.prepare_run(workspace)
Пример #2
0
def write_schema(pipeline_filename):
    if pipeline_filename is None:
        raise ValueError(
            "The --write-schema-and-exit switch must be used in conjunction\nwith the -p or --pipeline switch to load a pipeline with an\n"
            "ExportToDatabase module.")

    pipeline = cellprofiler.pipeline.Pipeline()

    pipeline.load(pipeline_filename)

    pipeline.turn_off_batch_mode()

    for module in pipeline.modules():
        if module.module_name == "ExportToDatabase":
            break
    else:
        raise ValueError("The pipeline, \"%s\", does not have an ExportToDatabase module" % pipeline_filename)

    m = cellprofiler.measurement.Measurements()

    workspace = cellprofiler.workspace.Workspace(pipeline, module, m, cellprofiler.object.ObjectSet, m, None)

    module.prepare_run(workspace)