Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block-wise connected components not working properly #18

Open
constantinpape opened this issue Feb 18, 2020 · 0 comments
Open

Block-wise connected components not working properly #18

constantinpape opened this issue Feb 18, 2020 · 0 comments

Comments

@constantinpape
Copy link
Owner

Not everything is merged across block boundaries properly.
In order to reproduce with data from platy browser:

import numpy as np
import pandas as pd
import elf.parallel
from elf.io import open_file

# leaving this here to reproduce issues with elf.parallel.label
def make_nephridia_segmentation():
    table_path = '../../data/0.6.5/tables/sbem-6dpf-1-whole-segmented-cilia/cell_mapping.csv'
    seg_path = '../../data/0.6.5/segmentations/sbem-6dpf-1-whole-segmented-cells.h5'
    out_path = '/g/kreshuk/pape/Work/nephr_tmp.n5'
    out_key = 'test'

    table = pd.read_csv(table_path, sep='\t')
    cell_ids = table['cell_id'].values
    cell_ids = np.unique(cell_ids)
    if cell_ids[0] == 0:
        cell_ids = cell_ids[1:]
    print(cell_ids)

    scale = 4 
    key = 't00000/s00/%i/cells' % scale
    with open_file(seg_path, 'r') as f, open_file(out_path) as f_out:
        ds = f[key]
        print(ds.shape)

        out = f_out.require_dataset(out_key, shape=ds.shape, chunks=ds.chunks, compression='gzip',
                                    dtype='uint8')

        print("Isin ...")
        out = elf.parallel.isin(ds, cell_ids, out=out, n_threads=16, verbose=True)
        print("Label ...")
        # FIXME label is still not doing a completely accurate job of merging across block boundaries         
        out = elf.parallel.label(out, out, n_threads=16, verbose=True)
        print("Compute max ...")
        max_id = elf.parallel.max(out, n_threads=16, verbose=True)
        print("Max component id:", max_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant