예제 #1
0
 def plate_grid(self):
     '''numpy.ndarray[int]: IDs of plates arranged according to
     their relative position of the plate within the experiment overview
     image (sorted row-wise by plate names)
     '''
     n = len(self.plates)
     dimensions = guess_stitch_dimensions(n)
     cooridinates = itertools.product(
         range(dimensions[1]), range(dimensions[0])
     )
     grid = np.zeros(dimensions, dtype=int)
     plates = sorted(self.plates, key=lambda p: p.id)
     for i, (x, y) in enumerate(cooridinates):
         try:
             grid[y, x] = plates[i].id
         except IndexError:
             continue
     return grid
예제 #2
0
def test_guess_stitch_dimensions_73_vertical():
    assert stitch.guess_stitch_dimensions(73, 'vertical') == (15, 5)
예제 #3
0
def test_guess_stitch_dimensions_22_horizontal():
    assert stitch.guess_stitch_dimensions(22, 'horizontal') == (3, 8)
예제 #4
0
def test_guess_stitch_dimensions_22_vertical():
    assert stitch.guess_stitch_dimensions(22, 'vertical') == (8, 3)
예제 #5
0
def test_guess_stitch_dimensions_10_horizontal():
    assert stitch.guess_stitch_dimensions(10, 'horizontal') == (2, 5)
예제 #6
0
def test_guess_stitch_dimensions_10_vertical():
    assert stitch.guess_stitch_dimensions(10, 'vertical') == (5, 2)
예제 #7
0
def test_guess_stitch_dimensions_9_horizontal():
    assert stitch.guess_stitch_dimensions(9, 'horizontal') == (3, 3)
예제 #8
0
def test_guess_stitch_dimensions_1_vertical():
    assert stitch.guess_stitch_dimensions(1, 'vertical') == (1, 1)
예제 #9
0
def test_guess_stitch_dimensions_9_vertical():
    assert stitch.guess_stitch_dimensions(9, 'vertical') == (3, 3)
예제 #10
0
def test_guess_stitch_dimensions_8_horizontal():
    assert stitch.guess_stitch_dimensions(8, 'horizontal') == (2, 4)
예제 #11
0
def test_guess_stitch_dimensions_8_vertical():
    assert stitch.guess_stitch_dimensions(8, 'vertical') == (4, 2)
예제 #12
0
def test_guess_stitch_dimensions_6_horizontal():
    assert stitch.guess_stitch_dimensions(6, 'horizontal') == (2, 3)
예제 #13
0
def test_guess_stitch_dimensions_6_vertical():
    assert stitch.guess_stitch_dimensions(6, 'vertical') == (3, 2)
예제 #14
0
def test_guess_stitch_dimensions_4_horizontal():
    assert stitch.guess_stitch_dimensions(4, 'horizontal') == (2, 2)
예제 #15
0
def test_guess_stitch_dimensions_73_horizontal():
    assert stitch.guess_stitch_dimensions(73, 'horizontal') == (5, 15)
예제 #16
0
def test_guess_stitch_dimensions_1_horizontal():
    assert stitch.guess_stitch_dimensions(1, 'horizontal') == (1, 1)
예제 #17
0
def test_guess_stitch_dimensions_4_vertical():
    assert stitch.guess_stitch_dimensions(4, 'vertical') == (2, 2)