def run_compute_feature_images(yamlfile):

    yparams = YamlParams(filename=yamlfile)
    params = yparams.get_params()

    # Logger stuff
    yparams.set_indent(1)
    yparams.startlogger(filename=params['resultfolder'] +
                        'compute_feature_images.log',
                        type='w',
                        name='ComputeFeatureImages')

    try:

        # experiment_parser(yparams, compute_feature_images, 'compute_feature_images')
        experiment_parser(yparams, compute_feature_images_multi,
                          'compute_feature_images')
        # compute_feature_images(yparams)

        yparams.logging('')
        yparams.stoplogger()

    except:
        raise
        yparams.errout('Unexpected error')
Beispiel #2
0
def run_random_forest(yamlfile,
                      logging=True,
                      make_only_feature_array=False,
                      debug=False,
                      write=True):

    yparams = YamlParams(filename=yamlfile)
    params = yparams.get_params()

    # Logger stuff
    yparams.set_indent(1)
    yparams.startlogger(filename=params['resultfolder'] + 'random_forest.log',
                        type='w',
                        name='RandomForest')

    try:

        random_forest(yparams, debug)

        yparams.logging('')
        yparams.stoplogger()

    except:
        raise
        yparams.errout('Unexpected error')
def run_compute_paths(yamlfile, logging=True):

    yparams = YamlParams(filename=yamlfile)
    params = yparams.get_params()

    # Logger stuff
    yparams.set_indent(1)
    yparams.startlogger(filename=params['resultfolder'] + 'compute_paths.log',
                        type='w',
                        name='ComputePaths')

    try:

        compute_paths(yparams)

        yparams.logging('')
        yparams.stoplogger()

    except:

        yparams.errout('Unexpected error')
Beispiel #4
0
def run_find_border_contacts(yamlfile, logging=True):

    yparams = YamlParams(filename=yamlfile)
    params = yparams.get_params()

    # Logger stuff
    yparams.set_indent(1)
    yparams.startlogger(filename=params['resultfolder'] +
                        'find_border_contacts.log',
                        type='w',
                        name='FindBorderContacts')

    try:

        find_border_contacts(yparams)

        yparams.logging('')
        yparams.stoplogger()

    except:

        yparams.errout('Unexpected error')
Beispiel #5
0
def run_remove_small_objects(yamlfile):

    yparams = YamlParams(filename=yamlfile)
    params = yparams.get_params()

    # Logger stuff
    yparams.set_indent(1)
    yparams.startlogger(filename=params['resultfolder'] +
                        'remove_small_objects.log',
                        type='w',
                        name='RemoveSmallObjects')

    try:

        remove_small_objects(yparams)

        yparams.logging('')
        yparams.stoplogger()

    except:

        yparams.errout('Unexpected error')
Beispiel #6
0
    if params['run_remove_small_objects']:
        yaml.logging('Removing small objects ...')
        run_remove_small_objects(paramfile_rso)

    if params['run_merge_adjacent_objects']:
        yaml.logging('Merging adjacent objects ...')
        run_merge_adjacent_objects(paramfile_mao)

    if params['run_compute_feature_images']:
        yaml.logging('Computing feature images ...')
        run_compute_feature_images(paramfile_cfi)

    if params['run_find_border_contacts']:
        yaml.logging('Finding border contacts ...')
        run_find_border_contacts(paramfile_fbc)

    if params['run_compute_paths']:
        yaml.logging('Calculating paths ...')
        run_compute_paths(paramfile_pth)

    if params['run_features_of_paths']:
        yaml.logging('Extracting features along paths ...')
        run_features_of_paths(paramfile_fop)

    if params['run_random_forest']:
        yaml.logging('Running random forst on paths ...')
        run_random_forest(paramfile_rdf)
    # _________________________________________________________________________________________

    yaml.stoplogger()