code: def _get_json_and_transform(direction):
      """Return the json filename and an affine transform, which has \
      been tweaked by hand to fit the MNI template."""
      direction_to_view_name = {
          "x": "side",
          "y": "back",
          "z": "top",
          "l": "side",
          "r": "side",
      }
  
      direction_to_transform_params = {
          "x": [0.38, 0, 0, 0.38, -108, -70],
          "y": [0.39, 0, 0, 0.39, -73, -73],
          "z": [0.36, 0, 0, 0.37, -71, -107],
          "l": [0.38, 0, 0, 0.38, -108, -70],
          "r": [0.38, 0, 0, 0.38, -108, -70],
      }
  
      dirname = os.path.dirname(os.path.abspath(__file__))
      dirname = os.path.join(dirname, "glass_brain_files")
      direction_to_filename = {
          _direction: os.path.join(
              dirname, f"brain_schematics_{view_name}.json"
          )
          for _direction, view_name in direction_to_view_name.items()
      }
  
      direction_to_transforms = {
          _direction: transforms.Affine2D.from_values(*params)
          for _direction, params in direction_to_transform_params.items()
      }
  
      direction_to_json_and_transform = {
          _direction: (
              direction_to_filename[_direction],
              direction_to_transforms[_direction],
          )
          for _direction in direction_to_filename
      }
  
      filename_and_transform = direction_to_json_and_transform.get(
          direction
      )
  
      if filename_and_transform is None:
          message = (
              f"No glass brain view associated with direction '{direction}'. "
              "Possible directions are "
              f"{list(direction_to_json_and_transform.keys())}"
          )
          raise ValueError(message)
  
      return filename_and_transform
  
file_path: nilearn/nilearn/plotting/glass_brain.py
imports: import json
  import os
  from matplotlib import colors, patches, transforms
  from matplotlib.path import Path
label_desc: Use image node_id 6 for calling a global function with example usage: _get_json_and_transform(direction) and returns: filename_and_transform