code: def _json_view_size(params):
      """Define the size of the viewer.
  
      Returns: width_view, height_view
  
      """
      # slices_width = sagittal_width (y) + coronal_width (x) + axial_width (x)
      slices_width = params["nbSlice"]["Y"] + 2 * params["nbSlice"]["X"]
  
      # slices_height = max of sagittal_height (z), coronal_height (z), and
      # axial_height (y).
      # Also add 20% extra height for annotation and margin
      slices_height = np.max(
          [params["nbSlice"]["Y"], params["nbSlice"]["Z"]]
      )
      slices_height = 1.20 * slices_height
  
      # Get the final size of the viewer
      width_view = 600
      ratio = slices_height / slices_width
      height_view = np.ceil(ratio * width_view)
  
      return width_view, height_view
  
imports: import copy
  import json
  import os
  import warnings
  from base64 import b64encode
  from io import BytesIO
  import matplotlib
  import numpy
  from matplotlib.image import imsave
  from nibabel.affines import apply_affine
  from nilearn.plotting.html_document import HTMLDocument
  from .._utils import fill_doc
  from .._utils.extmath import fast_abs_percentile
  from .._utils.niimg import safe_get_data
  from .._utils.niimg_conversions import check_niimg_3d
  from .._utils.param_validation import check_threshold
  from ..datasets import load_mni152_template
  from ..image import get_data, new_img_like, reorder_img, resample_to_img
  from ..plotting import cm
  from ..plotting.find_cuts import find_xyz_cut_coords
  from ..plotting.img_plotting import load_anat
  from .js_plotting_utils import colorscale, get_html_template
label_desc: Use image node_id 10 for calling a global function with example usage: _json_view_size(params) and returns: width_view,  height_view