예제 #1
0
 def test_if_returns_correct_values(self, template, image, result):
     transformation = trfs.HistogramMatchingTransformation(template)
     assert np.all(transformation(image) == result)
예제 #2
0
 def test_if_template_and_input_have_to_have_same_no_of_channels(self):
     image = np.random.rand(*INPUT_VOLUME_SHAPE_4D)
     template = np.random.rand(*TEMPLATE_VOLUME_SHAPE_4D)
     transformation = trfs.HistogramMatchingTransformation(template)
     with pytest.raises(IndexError):
         transformation(image)
예제 #3
0
 def test_if_template_has_to_have_same_ndim_as_input_image(self):
     image = np.random.rand(*INPUT_VOLUME_SHAPE_4D)
     template = np.random.rand(*INPUT_VOLUME_SHAPE_3D)
     transformation = trfs.HistogramMatchingTransformation(template)
     with pytest.raises(AssertionError):
         transformation(image)
예제 #4
0
 def test_if_4_dimensional_array_should_be_passed(self):
     image = np.random.rand(*INPUT_VOLUME_SHAPE_3D)
     transformation = trfs.HistogramMatchingTransformation(image)
     with pytest.raises(IndexError):
         transformation(image)
예제 #5
0
 def test_if_returns_same_for_identical_images(self):
     image = np.random.rand(*INPUT_VOLUME_SHAPE_4D)
     transformation = trfs.HistogramMatchingTransformation(image)
     assert np.all(image == transformation(image))
예제 #6
0
 def test_if_returns_with_same_shape(self):
     image = np.random.rand(*INPUT_VOLUME_SHAPE_4D)
     transformation = trfs.HistogramMatchingTransformation(image)
     assert image.shape == transformation(image).shape