Esempio n. 1
0
def test_scalar_coordinates():
    """Set up an ImageStack where only a single scalar physical coordinate is provided per axis.
    Internally, this should be converted to a range where the two endpoints are identical to the
    physical coordinate provided.
    """
    stack = ImageStack.synthetic_stack(NUM_ROUND,
                                       NUM_CH,
                                       NUM_Z,
                                       HEIGHT,
                                       WIDTH,
                                       tile_fetcher=tile_fetcher_factory(
                                           OffsettedScalarTiles,
                                           True,
                                       ))

    assert stack.tiles_aligned is False

    for selectors in stack._iter_axes({Axes.ROUND, Axes.CH, Axes.ZPLANE}):
        expected_x = round_to_x(selectors[Axes.ROUND])[0]
        expected_y = round_to_y(selectors[Axes.ROUND])[0]
        expected_z = round_to_z(selectors[Axes.ROUND])[0]

        verify_physical_coordinates(
            stack,
            selectors,
            (expected_x, expected_x),
            (expected_y, expected_y),
            (expected_z, expected_z),
        )
Esempio n. 2
0
def test_aligned_coordinates():
    """Set up an ImageStack where all the tiles are aligned (have the same physical coordinate values).
    Assert that the resulting Imagestack's tiles_aligned attribute is True
    """
    stack = ImageStack.synthetic_stack(NUM_ROUND,
                                       NUM_CH,
                                       NUM_Z,
                                       HEIGHT,
                                       WIDTH,
                                       tile_fetcher=tile_fetcher_factory(
                                           AlignedTiles,
                                           True,
                                       ))
    assert stack.tiles_aligned is True
Esempio n. 3
0
def test_coordinates():
    """Set up an ImageStack with tiles that are offset based on round.  Verify that the coordinates
    retrieved match.
    """
    stack = ImageStack.synthetic_stack(NUM_ROUND,
                                       NUM_CH,
                                       NUM_Z,
                                       HEIGHT,
                                       WIDTH,
                                       tile_fetcher=tile_fetcher_factory(
                                           OffsettedTiles,
                                           True,
                                       ))

    assert stack.tiles_aligned is False

    for selectors in stack._iter_axes({Axes.ROUND, Axes.CH, Axes.ZPLANE}):
        verify_physical_coordinates(
            stack,
            selectors,
            round_to_x(selectors[Axes.ROUND]),
            round_to_y(selectors[Axes.ROUND]),
            round_to_z(selectors[Axes.ROUND]),
        )