def test_standard_deviation_difference_range_value(space): I0 = odl.util.testutils.noise_element(space) value_shift = np.random.normal(0, 10) assert fom.standard_deviation_difference(I0, I0) == pytest.approx(0) assert (fom.standard_deviation_difference(10 * I0, I0, normalized=True) <= 1.0) assert (fom.standard_deviation_difference( I0, I0 + value_shift) == pytest.approx(0, abs=1e-5)) test_value = fom.standard_deviation_difference(space.one(), space.zero(), normalized=True) assert test_value == pytest.approx(0, abs=1e-6)
mask = (np.asarray(phantom) == 1) for stddev in np.linspace(0.1, 10, 100): phantom_noisy = phantom + odl.phantom.white_noise(reco_space, stddev=stddev) mse.append(fom.mean_squared_error(phantom_noisy, phantom, normalized=True)) mae.append(fom.mean_absolute_error(phantom_noisy, phantom, normalized=True)) mvd.append( fom.mean_value_difference(phantom_noisy, phantom, normalized=True)) std_diff.append( fom.standard_deviation_difference(phantom_noisy, phantom, normalized=True)) range_diff.append( fom.range_difference(phantom_noisy, phantom, normalized=True)) blur.append( fom.blurring(phantom_noisy, phantom, mask, normalized=True, smoothness_factor=30)) false_struct.append( fom.false_structures(phantom_noisy, phantom,