示例#1
0
def test_no_overlap_3D():
    '''
    Testing the 3D overlap function with a pair that should be joined.
    '''

    bub1 = Bubble3D.load_bubble("data/no_overlap_join_bubble_1.pkl")
    bub2 = Bubble3D.load_bubble("data/single_overlap_join_bubble_2.pkl")

    bubbles, join_regions = \
        threeD_overlaps([[bub1, bub2]], overlap_frac=0.6, overlap_corr=0.7,
                        min_chan_overlap=2,
                        multiprocess=False, join_overlap_frac=0.6,
                        join_overlap_corr=0.6, min_multi_size=100,
                        n_jobs=None)

    # No joining
    assert len(join_regions) == 0
    assert len(bubbles) == 2
示例#2
0
def test_join_no_overlap_3D():
    '''
    Testing the 3D overlap function with a pair that should be joined.
    '''

    bub1 = Bubble3D.load_bubble("data/no_overlap_join_bubble_1.pkl")
    bub2 = Bubble3D.load_bubble("data/no_overlap_join_bubble_2.pkl")

    bubbles, join_regions = \
        threeD_overlaps([[bub1, bub2]], overlap_frac=0.6, overlap_corr=0.7,
                        min_chan_overlap=2,
                        multiprocess=False, join_overlap_frac=0.6,
                        join_overlap_corr=0.6, min_multi_size=100,
                        n_jobs=None)

    # Should have the same output as in test_join_no_overlap

    # There should be one less region in the output
    initial_num_regions = len(bub1.twoD_regions) + len(bub2.twoD_regions)
    final_num_regions = len(join_regions[0])

    assert final_num_regions == initial_num_regions
    assert len(bubbles) == 0