Example #1
0
def decouple_ventricles_fn(ventricles, white_matter):
    from forward.mesh import (check_intersecting_fn,
                                           cut_outer_fn, decouple_inin_fn, clean_mesh_fn)

    intersections = check_intersecting_fn(white_matter, ventricles)
    while(intersections):
        ventricles = decouple_inin_fn(ventricles, white_matter)
        ventricles = cut_outer_fn(ventricles, white_matter)
        ventricles = clean_mesh_fn(ventricles)
        intersections = check_intersecting_fn(white_matter, ventricles)
    return ventricles
Example #2
0
def decouple_input_from_GM_fn(mesh_file, gray_matter):
    from forward.mesh import (check_intersecting_fn,
                                           cut_outer_fn, decouple_outin_fn, clean_mesh_fn)

    intersections = check_intersecting_fn(gray_matter, mesh_file)
    while(intersections):
        mesh_file = decouple_outin_fn(mesh_file, gray_matter)
        mesh_file = cut_outer_fn(mesh_file, gray_matter)
        mesh_file = clean_mesh_fn(mesh_file)
        intersections = check_intersecting_fn(gray_matter, mesh_file)
    return mesh_file
Example #3
0
def remove_spikes_fn(outer_mesh, inner_mesh):
    from forward.mesh import (check_intersecting_fn,
                                           cut_outer_fn, decouple_inin_fn, clean_mesh_fn)

    intersections = check_intersecting_fn(outer_mesh, inner_mesh)
    if intersections:
        inner_mesh = cut_outer_fn(inner_mesh, outer_mesh)
        inner_mesh = clean_mesh_fn(inner_mesh)

        for i in xrange(0, 3):
            intersections = check_intersecting_fn(outer_mesh, inner_mesh)
            if intersections:
                inner_mesh = decouple_inin_fn(inner_mesh, outer_mesh)
                inner_mesh = clean_mesh_fn(inner_mesh)
            else:
                break
    return inner_mesh