diff --git a/tests/test_plottingfuncs.py b/tests/test_plottingfuncs.py index cc263d2d80..b8e3d5d82b 100644 --- a/tests/test_plottingfuncs.py +++ b/tests/test_plottingfuncs.py @@ -71,7 +71,6 @@ def test_load_mplstyle(style: str, axes_titlesize: int, font_size: float, image_ def test_dilate_binary_image(binary_image: np.ndarray, dilation_iterations: int, expected: np.ndarray) -> None: """Test the dilate binary images function of plottingfuncs.py.""" result = dilate_binary_image(binary_image=binary_image, dilation_iterations=dilation_iterations) - np.testing.assert_array_equal(result, expected) @@ -277,22 +276,6 @@ def test_high_dpi(minicircle_grain_gaussian_filter: Grains, plotting_config: dic return fig -@pytest.mark.mpl_image_compare(baseline_dir="resources/img/") -def test_mask_dilation(plotting_config: dict, tmp_path: Path) -> None: - """Test the plotting of a mask with a different colourmap (blu).""" - plotting_config["mask_cmap"] = "blue" - mask = np.zeros((1024, 1024)) - mask[500, :] = 1 - fig, _ = Images( - data=RNG.random((1024, 1024)), - output_dir=tmp_path, - filename="mask_dilation", - masked_array=mask, - **plotting_config, - ).plot_and_save() - return fig - - @pytest.mark.parametrize( ("n", "expected"), [ diff --git a/topostats/default_config.yaml b/topostats/default_config.yaml index d1e31fda02..e6ce12d07c 100644 --- a/topostats/default_config.yaml +++ b/topostats/default_config.yaml @@ -96,7 +96,7 @@ plotting: savefig_dpi: 600 # Options : null (defaults to the value in topostats/plotting_dictionary.yaml), see https://afm-spm.github.io/TopoStats/main/configuration.html#further-customisation and https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html pixel_interpolation: null # Options : https://matplotlib.org/stable/gallery/images_contours_and_fields/interpolation_methods.html image_set: core # Options : all, core - zrange: [-2, 6] # low and high height range for core images (can take [null, null]). low <= high + zrange: [null, null] # low and high height range for core images (can take [null, null]). low <= high colorbar: true # Options : true, false axes: true # Options : true, false (due to off being a bool when parsed) num_ticks: [null, null] # Number of ticks to have along the x and y axes. Options : null (auto) or integer > 1 diff --git a/topostats/plottingfuncs.py b/topostats/plottingfuncs.py index b0231f1227..c3da4f8517 100644 --- a/topostats/plottingfuncs.py +++ b/topostats/plottingfuncs.py @@ -334,14 +334,6 @@ def save_figure(self): vmax=self.zrange[1], ) if isinstance(self.masked_array, np.ndarray): - # self.masked_array[self.masked_array != 0] = 1 - # If the image is too large for singles to be resolved in the mask, then dilate the mask proportionally - # to image size to enable clear viewing. - # if np.max(self.masked_array.shape) > 500: - # dilation_strength = int(np.max(self.masked_array.shape) / 256) - # self.masked_array = dilate_binary_image( - # binary_image=self.masked_array, dilation_iterations=dilation_strength - # ) mask = np.ma.masked_where(self.masked_array == 0, self.masked_array) ax.imshow( mask,