Exemple #1
0
    # load cell file
    mm3.information('Loading cell data.')
    if namespace.cellfile:
        cell_file_path = namespace.cellfile
    else:
        mm3.warning('No cell file specified. Using complete_cells.pkl.')
        cell_file_path = os.path.join(p['cell_dir'], 'complete_cells.pkl')

    with open(cell_file_path, 'rb') as cell_file:
        Cells = pickle.load(cell_file)

    # load specs file
    specs = mm3.load_specs()

    # load time table. Puts in params dictionary
    mm3.load_time_table()

    # make list of FOVs to process (keys of channel_mask file)
    fov_id_list = sorted([fov_id for fov_id in specs.keys()])
    ### foci analysis

    for cell_id, cell in six.iteritems(Cells):
        if cell.death is None:
            cell.death = np.nan

    mm3.information("Starting foci analysis.")

    # create dictionary which organizes cells by fov and peak_id
    Cells_by_peak = organize_cells_by_channel(Cells, specs)
    # for each set of cells in one fov/peak, find the foci
    for fov_id in fov_id_list:
Exemple #2
0
        user_spec_peaks = []

    # set segmentation image name for saving and loading segmented images
    if namespace.command == 'cells':
        p['seg_img'] = 'seg_unet'
    elif namespace.command == 'foci':
        p['seg_img'] = 'foci_seg_unet'
    else:
        sys.exit(
            "ERROR: your final argument to {} must be either 'cells' or 'foci'"
            .format(sys.argv[0]))

    # load specs file
    if namespace.chtc:
        specs = mm3.load_specs(fname=namespace.specfile)
        mm3.load_time_table(fname=namespace.timefile)
    else:
        specs = mm3.load_specs()
        mm3.load_time_table()

    if namespace.command == 'cells':
        if namespace.phase_file_name:
            track_single_file(namespace.phase_file_name,
                              namespace.seg_file_name, p, namespace)

    if not os.path.exists(p['cell_dir']):
        os.makedirs(p['cell_dir'])

    # make list of FOVs to process (keys of channel_mask file)
    fov_id_list = sorted([fov_id for fov_id in specs.keys()])