Exemplo n.º 1
0
    def test_mosaic_shape(self):
        tile_size = 10
        tiler = Tiler(data_shape=self.data.shape, tile_shape=(tile_size, ))
        tiler2 = Tiler(data_shape=(3, ) + self.data.shape,
                       tile_shape=(
                           3,
                           tile_size,
                       ),
                       channel_dimension=0)
        tiler3 = Tiler(data_shape=(9, ) + self.data.shape,
                       tile_shape=(
                           3,
                           tile_size,
                       ),
                       channel_dimension=0)
        tiler4 = Tiler(data_shape=(9, ) + self.data.shape,
                       tile_shape=(
                           3,
                           tile_size,
                       ))

        np.testing.assert_equal([10], tiler.get_mosaic_shape())
        np.testing.assert_equal([10],
                                tiler.get_mosaic_shape(with_channel_dim=True))

        np.testing.assert_equal([10], tiler2.get_mosaic_shape())
        np.testing.assert_equal([1, 10],
                                tiler2.get_mosaic_shape(with_channel_dim=True))

        np.testing.assert_equal([10], tiler3.get_mosaic_shape())
        np.testing.assert_equal([1, 10],
                                tiler3.get_mosaic_shape(with_channel_dim=True))

        np.testing.assert_equal([3, 10], tiler4.get_mosaic_shape())
        np.testing.assert_equal([3, 10],
                                tiler4.get_mosaic_shape(with_channel_dim=True))