code: def test_json_view_size():
      # Build some minimal sprite Parameters
      sprite_params = {"nbSlice": {"X": 4, "Y": 4, "Z": 4}}
      width, height = html_stat_map._json_view_size(sprite_params)
  
      # This is a simple case: height is 4 pixels, width 3 x 4 = 12 pixels
      # with an additional 120% height factor for annotations and margins
      ratio = 1.2 * 4 / 12
  
      # check we received the expected width and height
      width_exp = 600
      height_exp = np.ceil(ratio * 600)
      assert (
          width == width_exp
      ), "html viewer does not have expected width"
      assert (
          height == height_exp
      ), "html viewer does not have expected height"
  
imports: import base64
  import warnings
  from io import BytesIO
  import numpy
  import pytest
  from matplotlib import pyplot
  from nibabel import Nifti1Image
  from nilearn import datasets, image
  from nilearn.image import get_data, new_img_like
  from nilearn.plotting import html_stat_map
  from ..js_plotting_utils import colorscale
label_desc: Use image node_id 13 for calling a global function with example usage: test_json_view_size() without return types