Пример #1
0
    def test_image_statistics_posiiton(self) -> None:

        module = ImageStatisticsModule(name_in='stat2',
                                       image_in_tag='read',
                                       stat_out_tag='stat2',
                                       position=(5, 5, 0.1))

        self.pipeline.add_module(module)
        self.pipeline.run_module('stat2')

        data = self.pipeline.get_data('stat2')
        assert np.sum(data) == pytest.approx(118.7138708968444,
                                             rel=self.limit,
                                             abs=0.)
        assert data.shape == (10, 6)
Пример #2
0
    def test_image_statistics_full(self) -> None:

        module = ImageStatisticsModule(name_in='stat1',
                                       image_in_tag='read',
                                       stat_out_tag='stat1',
                                       position=None)

        self.pipeline.add_module(module)
        self.pipeline.run_module('stat1')

        data = self.pipeline.get_data('stat1')
        assert np.sum(data) == pytest.approx(115.68591492205017,
                                             rel=self.limit,
                                             abs=0.)
        assert data.shape == (10, 6)
Пример #3
0
    def test_image_statistics_full(self):

        module = ImageStatisticsModule(name_in='stat1',
                                       image_in_tag='read',
                                       stat_out_tag='stat1',
                                       position=None)

        self.pipeline.add_module(module)
        self.pipeline.run_module('stat1')

        data = self.pipeline.get_data('stat1')
        assert np.allclose(data[0, 0],
                           -0.0007312880198509591,
                           rtol=limit,
                           atol=0.)
        assert np.allclose(np.sum(data),
                           48.479917666979716,
                           rtol=limit,
                           atol=0.)
        assert data.shape == (44, 6)
Пример #4
0
    def test_image_statistics_posiiton(self):

        module = ImageStatisticsModule(name_in='stat2',
                                       image_in_tag='read',
                                       stat_out_tag='stat2',
                                       position=(70, 20, 0.5))

        self.pipeline.add_module(module)
        self.pipeline.run_module('stat2')

        data = self.pipeline.get_data('stat2')
        assert np.allclose(data[0, 0],
                           -0.0006306714900382097,
                           rtol=limit,
                           atol=0.)
        assert np.allclose(np.sum(data),
                           -0.05448258074038106,
                           rtol=limit,
                           atol=0.)
        assert data.shape == (44, 6)
Пример #5
0
    def test_image_statistics_posiiton(self):

        module = ImageStatisticsModule(name_in="stat2",
                                       image_in_tag="read",
                                       stat_out_tag="stat2",
                                       position=(70, 20, 0.5))

        self.pipeline.add_module(module)
        self.pipeline.run_module("stat2")

        data = self.pipeline.get_data("stat2")
        assert np.allclose(data[0, 0],
                           -0.00046030773937605655,
                           rtol=limit,
                           atol=0.)
        assert np.allclose(np.sum(data),
                           0.19799486555625812,
                           rtol=limit,
                           atol=0.)
        assert data.shape == (44, 6)