def load_sweep(posfile, headerfile, labfile):
    # load or generate header
    if os.path.isfile(headerfile):
        logging.info("Loading %s" % headerfile)
        header = [line.strip() for line in open(headerfile)]
    else:
        logging.debug("%s not found; generating default header" % headerfile)
        header = ema.generate_header()

    # load segmentation
    logging.info("Loading %s" % labfile)

    # load EMA sweep
    logging.info("Loading %s" % posfile)
    try:
        sweep = ema.Sweep(posfile, header, labfile)
    except IOError:
        logging.error(sys.exc_info()[1])
        sys.exit(1)
    return sweep
Exemple #2
0
def load_sweep(posfile, headerfile, labfile):
    # load or generate header
    if os.path.isfile(headerfile):
        logging.info("Loading %s" % headerfile)
        header = [line.strip() for line in open(headerfile)]
    else:
        logging.debug("%s not found; generating default header" % headerfile)
        header = ema.generate_header()
    
    # load segmentation
    logging.info("Loading %s" % labfile)
    
    # load EMA sweep
    logging.info("Loading %s" % posfile)
    try:
        sweep = ema.Sweep(posfile, header, labfile)
    except IOError:
        logging.error(sys.exc_info()[1])
        sys.exit(1)
    return sweep
    for mesh in bpy.data.meshes:
        bpy.data.meshes.remove(mesh)
    for action in bpy.data.actions:
        bpy.data.actions.remove(action)
    bpy.context.scene.frame_current = 1


#temporarily clean out scene
if DEBUG:
    cleanup()

# load sweep from pos file (with lab file, if available)
if DEBUG:
    print("loading", args.posfile)
if not args.header:
    header = ema.generate_header()
else:
    header = args.header

segmentation = None
if args.labfile:
    with open(args.labfile) as labfile:
        segmentation = lab.Segmentation(labfile)
sweep = ema.Sweep(args.posfile, header, segmentation)

# downsample EMA data
if DEBUG:
    print("downsampling EMA data")
sweep.subsample()

channels = sweep.coils
Exemple #4
0
        bpy.data.armatures.remove(armature)
    for mesh in bpy.data.meshes:
        bpy.data.meshes.remove(mesh)
    for action in bpy.data.actions:
        bpy.data.actions.remove(action)
    bpy.context.scene.frame_current = 1

#temporarily clean out scene
if DEBUG:
    cleanup()

# load sweep from pos file (with lab file, if available)
if DEBUG:
    print("loading", args.posfile)
if not args.header:
    header = ema.generate_header()
else:
    header = args.header

segmentation = None
if args.labfile:
    with open(args.labfile) as labfile:
        segmentation = lab.Segmentation(labfile)
sweep = ema.Sweep(args.posfile, header, segmentation)

# downsample EMA data
if DEBUG:
    print("downsampling EMA data")
sweep.subsample()

channels = sweep.coils