diff --git a/tests/test_contrast_limits.py b/tests/test_contrast_limits.py index e115e40..9574c44 100644 --- a/tests/test_contrast_limits.py +++ b/tests/test_contrast_limits.py @@ -7,10 +7,10 @@ def test_percentile_contrast_limits(): data = np.arange(100).reshape(10, 5, 2) calculator = ContrastLimitCalculator(data) - limits = calculator.contrast_limits_from_percentiles(5.0, 95.0) + limits = calculator.compute_contrast_limit(5.0, 95.0) assert np.allclose(limits, (5.0, 94.0), atol=0.1) - limits = calculator.contrast_limits_from_percentiles(0.0, 100.0) + limits = calculator.compute_contrast_limit(0.0, 100.0) assert limits == (0.0, 99.0) # Test with a 3D numpy array with Z as the first axis, and remove some slices @@ -18,11 +18,11 @@ def test_percentile_contrast_limits(): new_data[10:20] = data calculator.volume = new_data - limits = calculator.contrast_limits_from_percentiles(0.0, 100.0) + limits = calculator.compute_contrast_limit(0.0, 100.0) assert limits == (0.0, 500.0) calculator.set_volume_and_z_limits(new_data, z_radius=5) - limits = calculator.contrast_limits_from_percentiles(0.0, 100.0) + limits = calculator.compute_contrast_limit(0.0, 100.0) assert limits == (0.0, 99.0) diff --git a/tests/test_shader.py b/tests/test_shader.py index 9b05403..35adab1 100644 --- a/tests/test_shader.py +++ b/tests/test_shader.py @@ -10,11 +10,11 @@ def test_get_default_image_vr_shader(): contrast_name = "contrast" threedee_contrast_name = "contrast3D" expected_shader = """ -#uicontrol invlerp contrast(clamp=false) +#uicontrol invlerp contrast #uicontrol bool invert_contrast checkbox #uicontrol invlerp contrast3D(clamp=false) #uicontrol bool invert_contrast3D checkbox -#uicontrol bool hide_white_outside_range_3D checkbox +#uicontrol bool hide_values_outside_limits_3D checkbox float get_contrast() { float value = invert_contrast ? 1.0 - contrast() : contrast(); @@ -22,7 +22,7 @@ def test_get_default_image_vr_shader(): } float get_contrast3D() { float value = invert_contrast3D ? 1.0 - contrast3D() : contrast3D(); - value = (hide_white_outside_range_3D && value > 1.0) ? 0.0 : clamp(value, 0.0, 1.0); + value = (hide_values_outside_limits_3D && value > 1.0) ? 0.0 : clamp(value, 0.0, 1.0); return value; }